blob: a39d1deecef81595e28110f17d0185e6ad6f0eb6 [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 Murdochbab399f2018-12-06 11:01:38 +0000206 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800207 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800208 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
209 117 [(log_from_module) = "docsui"];
210 DocsUIPickResultReported docs_ui_pick_result_reported =
211 118 [(log_from_module) = "docsui"];
212 DocsUISearchModeReported docs_ui_search_mode_reported =
213 119 [(log_from_module) = "docsui"];
214 DocsUISearchTypeReported docs_ui_search_type_reported =
215 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800216 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000217 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000218 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800219 GnssNiEventReported gnss_ni_event_reported = 124;
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;
Emilian Peev6729f372019-08-29 09:14:09 -0700337 CameraActionEvent camera_action_event = 227;
atrost01a20932019-08-28 15:40:37 +0100338 AppCompatibilityChangeReported app_compatibility_change_reported =
339 228 [(allow_from_any_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000340 }
David Chenc8a43242017-10-17 16:23:28 -0700341
David Chen6e3e6cb2018-01-03 16:14:06 -0800342 // Pulled events will start at field 10000.
Alec Mourie088e762019-07-02 13:10:55 -0700343 // Next: 10064
David Chenc8a43242017-10-17 16:23:28 -0700344 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800345 WifiBytesTransfer wifi_bytes_transfer = 10000;
346 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
347 MobileBytesTransfer mobile_bytes_transfer = 10002;
348 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800349 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800350 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800351 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800352 CpuTimePerFreq cpu_time_per_freq = 10008;
353 CpuTimePerUid cpu_time_per_uid = 10009;
354 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800355 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800356 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800357 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800358 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800359 SystemElapsedRealtime system_elapsed_realtime = 10014;
360 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800361 CpuActiveTime cpu_active_time = 10016;
362 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000363 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800364 RemainingBatteryCapacity remaining_battery_capacity = 10019;
365 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800366 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100367 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100368 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100369 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000370 DiskStats disk_stats = 10025;
371 DirectoryUsage directory_usage = 10026;
372 AppSize app_size = 10027;
373 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700374 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700375 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800376 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700377 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700378 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800379 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700380 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100381 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100382 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700383 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800384 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
385 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
386 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000387 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800388 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800389 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800390 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000391 DebugElapsedClock debug_elapsed_clock = 10046;
392 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800393 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800394 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800395 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800396 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000397 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000398 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800399 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
400 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000401 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000402 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700403 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700404 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200405 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100406 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700407 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
408 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
David Chenc8a43242017-10-17 16:23:28 -0700409 }
yroa1fe77c2018-02-26 14:22:54 -0800410
Bookatz76aafcf2018-09-17 16:17:10 -0700411 // DO NOT USE field numbers above 100,000 in AOSP.
412 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
413 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700414}
415
Yao Chend54f9dd2017-10-17 17:37:48 +0000416/**
Yangster-mac20877162017-12-22 17:19:39 -0800417 * This proto represents a node of an attribution chain.
418 * Note: All attribution chains are represented as a repeated field of type
419 * AttributionNode. It is understood that in such arrays, the order is that
420 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000421 */
Yangster-mac20877162017-12-22 17:19:39 -0800422message AttributionNode {
423 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800424 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800425
Yangster-mac20877162017-12-22 17:19:39 -0800426 // The (optional) string tag for an element in the attribution chain. If the
427 // element has no tag, it is encoded as an empty string.
428 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700429}
430
Yangster-mac48b3d622018-08-18 12:38:11 -0700431message KeyValuePair {
432 optional int32 key = 1;
433 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700434 int32 value_int = 2;
435 int64 value_long = 3;
436 string value_str = 4;
437 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700438 }
439}
440
441message KeyValuePairsAtom {
442 optional int32 uid = 1;
443 repeated KeyValuePair pairs = 2;
444}
445
Yao Chend54f9dd2017-10-17 17:37:48 +0000446/*
447 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800448 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000449 *
450 * RULES:
451 * - The field ids for each atom must start at 1, and count upwards by 1.
452 * Skipping field ids is not allowed.
453 * - These form an API, so renaming, renumbering or removing fields is
454 * not allowed between android releases. (This is not currently enforced,
455 * but there will be a tool to enforce this restriction).
456 * - The types must be built-in protocol buffer types, namely, no sub-messages
457 * are allowed (yet). The bytes type is also not allowed.
458 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800459 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000460 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800461 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000462 * - A field that is a uid should be a string field, tagged with the [xxx]
463 * annotation. The generated code on android will be represented by UIDs,
464 * and those UIDs will be translated in xxx to those strings.
465 *
466 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700467 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000468 * - If there is a UID, it goes first. Think in an object-oriented fashion.
469 * *****************************************************************************
470 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700471
Yao Chend54f9dd2017-10-17 17:37:48 +0000472/**
Tej Singha72344992019-04-17 18:55:08 -0700473 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700474 * Logs when the Thermal service HAL notifies the throttling start/stop events.
475 *
476 * Logged from:
477 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
478 */
479message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700480 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700481 optional android.os.TemperatureTypeEnum sensor_type = 1;
482
Maggie White442b6312019-04-05 16:26:44 -0700483 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700484 enum State {
485 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700486 START = 1; // START indicated that throttling was triggered.
487 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700488 }
Yangster-mace16189a2018-08-26 12:20:16 -0700489 optional State state = 2;
490
491 optional float temperature = 3;
492}
493
494/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000495 * Logs when the screen state changes.
496 *
497 * Logged from:
498 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
499 */
500message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800501 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700502 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700503}
Yao Chend54f9dd2017-10-17 17:37:48 +0000504
505/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700506 * Logs that the process state of the uid, as determined by ActivityManager
507 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000508 *
509 * Logged from:
510 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
511 */
Bookatzc1a050a2017-10-10 15:49:28 -0700512message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700513 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000514
Bookatzdb026a22018-01-10 19:01:56 -0800515 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700516 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000517}
518
519/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700520 * Logs process state change of a process, as per the activity manager.
521 *
522 * Logged from:
523 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
524 */
525message ProcessStateChanged {
526 optional int32 uid = 1;
527 optional string process_name = 2;
528 optional string package_name = 3;
529 // TODO: remove this when validation is done
530 optional int64 version = 5;
531 // The state, from frameworks/base/core/proto/android/app/enums.proto.
532 optional android.app.ProcessStateEnum state = 4;
533}
534
535/**
536 * Logs when ActivityManagerService sleep state is changed.
537 *
538 * Logged from:
539 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
540 */
541message ActivityManagerSleepStateChanged {
542 // TODO: import frameworks proto
543 enum State {
544 UNKNOWN = 0;
545 ASLEEP = 1;
546 AWAKE = 2;
547 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700548 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700549}
550
551/**
552 * Logs when system memory state changes.
553 *
554 * Logged from:
555 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
556 */
557message MemoryFactorStateChanged {
558 // TODO: import frameworks proto
559 enum State {
560 MEMORY_UNKNOWN = 0;
561 NORMAL = 1; // normal.
562 MODERATE = 2; // moderate memory pressure.
563 LOW = 3; // low memory.
564 CRITICAL = 4; // critical memory.
565
566 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700567 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700568}
569
570/**
571 * Logs when app is using too much cpu, according to ActivityManagerService.
572 *
573 * Logged from:
574 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
575 */
576message ExcessiveCpuUsageReported {
577 optional int32 uid = 1;
578 optional string process_name = 2;
579 optional string package_name = 3;
580 // package version. TODO: remove this when validation is done
581 optional int64 version = 4;
582}
583
584/**
585 * Logs when a cached process is killed, along with its pss.
586 *
587 * Logged from:
588 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
589 */
590message CachedKillReported {
591 optional int32 uid = 1;
592 optional string process_name = 2;
593 optional string package_name = 3;
594 // TODO: remove this when validation is done
595 optional int64 version = 5;
596 optional int64 pss = 4;
597}
598
599/**
600 * Logs when memory stats of a process is reported.
601 *
602 * Logged from:
603 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
604 */
605message ProcessMemoryStatReported {
606 optional int32 uid = 1;
607 optional string process_name = 2;
608 optional string package_name = 3;
609 //TODO: remove this when validation is done
610 optional int64 version = 9;
611 optional int64 pss = 4;
612 optional int64 uss = 5;
613 optional int64 rss = 6;
614 enum Type {
615 ADD_PSS_INTERNAL_SINGLE = 0;
616 ADD_PSS_INTERNAL_ALL_MEM = 1;
617 ADD_PSS_INTERNAL_ALL_POLL = 2;
618 ADD_PSS_EXTERNAL = 3;
619 ADD_PSS_EXTERNAL_SLOW = 4;
620 }
621 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800622 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700623}
624
625/**
Bookatzc1a050a2017-10-10 15:49:28 -0700626 * Logs that a process started, finished, crashed, or ANRed.
627 *
628 * Logged from:
629 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
630 */
631message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700632 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700633
David Chen0b5c90c2018-01-25 16:51:49 -0800634 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800635 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700636
Bookatzddccf0a2017-11-28 16:48:14 -0800637 // What lifecycle state the process changed to.
638 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800639 enum State {
640 FINISHED = 0;
641 STARTED = 1;
642 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800643 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800644 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700645}
646
Bookatzc1a050a2017-10-10 15:49:28 -0700647/**
648 * Logs when the ble scan state changes.
649 *
650 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700651 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700652 */
653message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800654 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700655
656 enum State {
657 OFF = 0;
658 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700659 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
660 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700661 }
662 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700663
Bookatze5ec0b42018-03-26 13:34:56 -0700664 // Does the scan have a filter.
665 optional bool is_filtered = 3;
666 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
667 optional bool is_first_match = 4;
668 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
669 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700670}
671
672/**
673 * Logs reporting of a ble scan finding results.
674 *
675 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700676 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700677 */
Bookatzae6738e2018-09-13 11:38:56 -0700678// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700679message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800680 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700681
682 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800683 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700684}
685
686/**
687 * Logs when a sensor state changes.
688 *
689 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700690 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700691 */
692message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800693 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700694
Bookatzc1a050a2017-10-10 15:49:28 -0700695 // The id (int) of the sensor.
696 optional int32 sensor_id = 2;
697
698 enum State {
699 OFF = 0;
700 ON = 1;
701 }
702 optional State state = 3;
703}
704
Bookatzc1a050a2017-10-10 15:49:28 -0700705/**
706 * Logs when GPS state changes.
707 *
708 * Logged from:
709 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
710 */
711message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800712 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700713
714 enum State {
715 OFF = 0;
716 ON = 1;
717 }
718 optional State state = 2;
719}
720
Bookatz48d362e2018-11-06 15:49:08 -0800721/**
722 * Logs when GPS signal quality.
723 *
724 * Logged from:
725 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
726 */
727message GpsSignalQualityChanged {
728 optional android.server.location.GpsSignalQualityEnum level = 1;
729}
730
Bookatzc1a050a2017-10-10 15:49:28 -0700731
732/**
733 * Logs when a sync manager sync state changes.
734 *
735 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700736 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700737 */
738message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800739 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700740
David Chen0b5c90c2018-01-25 16:51:49 -0800741 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800742 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700743
744 enum State {
745 OFF = 0;
746 ON = 1;
747 }
748 optional State state = 3;
749}
750
Yangster-mac96353002018-09-05 11:18:55 -0700751/*
752 * Deferred job stats.
753 *
754 * Logged from:
755 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
756*/
757message DeferredJobStatsReported {
758 repeated AttributionNode attribution_node = 1;
759
760 // Number of jobs deferred.
761 optional int32 num_jobs_deferred = 2;
762
763 // Time since the last job runs.
764 optional int64 time_since_last_job_millis = 3;
765}
766
Bookatzc1a050a2017-10-10 15:49:28 -0700767/**
768 * Logs when a job scheduler job state changes.
769 *
770 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700771 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700772 */
773message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800774 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700775
776 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800777 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700778
779 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800780 FINISHED = 0;
781 STARTED = 1;
782 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700783 }
784 optional State state = 3;
785
Tej Singh33a412b2018-03-16 18:43:59 -0700786 // The reason a job has stopped.
787 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700788 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700789 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100790
791 // The standby bucket of the app that scheduled the job. These match the framework constants
792 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
793 // already assigned 0.
794 enum Bucket {
795 UNKNOWN = -1;
796 ACTIVE = 0;
797 WORKING_SET = 1;
798 FREQUENT = 2;
799 RARE = 3;
800 NEVER = 4;
801 }
802 optional Bucket standby_bucket = 5 [default = UNKNOWN];
803
804 // The job id (as assigned by the app).
805 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700806}
807
808/**
809 * Logs when the audio state changes.
810 *
811 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700812 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700813 */
814message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800815 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700816
817 enum State {
818 OFF = 0;
819 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700820 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
821 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700822 }
823 optional State state = 2;
824}
825
826/**
827 * Logs when the video codec state changes.
828 *
829 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700830 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700831 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800832message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800833 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700834
835 enum State {
836 OFF = 0;
837 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700838 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
839 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700840 }
841 optional State state = 2;
842}
843
844/**
845 * Logs when the flashlight state changes.
846 *
847 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700848 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700849 */
850message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800851 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700852
853 enum State {
854 OFF = 0;
855 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700856 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
857 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700858 }
859 optional State state = 2;
860}
861
862/**
863 * Logs when the camera state changes.
864 *
865 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700866 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700867 */
868message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800869 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700870
871 enum State {
872 OFF = 0;
873 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700874 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
875 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700876 }
877 optional State state = 2;
878}
879
880/**
881 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000882 *
883 * Logged from:
884 * TODO
885 */
Bookatzd6746242017-10-24 18:39:35 -0700886message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800887 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000888
Bookatz1a1b0462018-01-12 11:47:03 -0800889 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
890 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700891 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700892
893 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
894 optional string tag = 3;
895
896 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800897 RELEASE = 0;
898 ACQUIRE = 1;
899 CHANGE_RELEASE = 2;
900 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700901 }
902 optional State state = 4;
903}
904
905/**
Bookatzc1a050a2017-10-10 15:49:28 -0700906 * Logs when a partial wakelock is considered 'long' (over 1 min).
907 *
908 * Logged from:
909 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
910 */
911message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800912 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700913
Yao Chend54f9dd2017-10-17 17:37:48 +0000914 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
915 optional string tag = 2;
916
Bookatzc1a050a2017-10-10 15:49:28 -0700917 // TODO: I have no idea what this is.
918 optional string history_tag = 3;
919
920 enum State {
921 OFF = 0;
922 ON = 1;
923 }
924 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000925}
926
Bookatzc1a050a2017-10-10 15:49:28 -0700927/**
Bookatza66083f2018-09-20 17:24:00 -0700928 * Logs when the device is interactive, according to the PowerManager Notifier.
929 *
930 * Logged from:
931 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
932 */
933message InteractiveStateChanged {
934 enum State {
935 OFF = 0;
936 ON = 1;
937 }
938 optional State state = 1;
939}
940
941/**
Bookatzc1a050a2017-10-10 15:49:28 -0700942 * Logs Battery Saver state change.
943 *
944 * Logged from:
945 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
946 */
947message BatterySaverModeStateChanged {
948 enum State {
949 OFF = 0;
950 ON = 1;
951 }
952 optional State state = 1;
953}
954
955/**
956 * Logs Doze mode state change.
957 *
958 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800959 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700960 */
961message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800962 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800963}
964
965
966/**
967 * Logs state change of Doze mode including maintenance windows.
968 *
969 * Logged from:
970 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
971 */
972message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800973 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700974}
975
976/**
977 * Logs screen brightness level.
978 *
979 * Logged from:
980 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
981 */
982message ScreenBrightnessChanged {
983 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
984 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700985}
986
987/**
988 * Logs battery level (percent full, from 0 to 100).
989 *
990 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700991 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700992 */
993message BatteryLevelChanged {
994 // Battery level. Should be in [0, 100].
995 optional int32 battery_level = 1;
996}
997
998/**
999 * Logs change in charging status of the device.
1000 *
1001 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001002 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001003 */
1004message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001005 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1006 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001007}
1008
1009/**
1010 * Logs whether the device is plugged in, and what power source it is using.
1011 *
1012 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001013 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001014 */
1015message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001016 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1017 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001018}
1019
Bookatz8c6571b2017-10-24 15:04:41 -07001020/**
1021 * Logs when an app's wakeup alarm fires.
1022 *
1023 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001024 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001025 */
1026message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001027 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001028
1029 // Name of the wakeup alarm.
1030 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001031
1032 // Name of source package (for historical reasons, since BatteryStats tracked it).
1033 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001034
1035 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1036 enum Bucket {
1037 UNKNOWN = 0;
1038 EXEMPTED = 5;
1039 ACTIVE = 10;
1040 WORKING_SET = 20;
1041 FREQUENT = 30;
1042 RARE = 40;
1043 NEVER = 50;
1044 }
1045 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1046 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001047}
1048
1049/**
1050 * Logs when an an app causes the mobile radio to change state.
1051 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1052 *
1053 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001054 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001055 */
1056message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001057 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001058
Bookatz1a1b0462018-01-12 11:47:03 -08001059 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1060 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001061}
1062
1063/**
1064 * Logs when an an app causes the wifi radio to change state.
1065 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1066 *
1067 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001068 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001069 */
1070message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001071 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001072
Bookatz1a1b0462018-01-12 11:47:03 -08001073 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1074 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001075}
1076
1077/**
1078 * Logs kernel wakeup reasons and aborts.
1079 *
1080 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001081 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001082 */
1083message KernelWakeupReported {
1084 // Name of the kernel wakeup reason (or abort).
1085 optional string wakeup_reason_name = 1;
1086
1087 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001088 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001089}
1090
1091/**
Bookatzda1798c2018-12-13 14:16:00 -08001092 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001093 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001094 *
1095 * Logged from:
1096 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1097 */
1098message WifiEnabledStateChanged {
1099 enum State {
1100 OFF = 0;
1101 ON = 1;
1102 }
1103 optional State state = 1;
1104}
1105
1106/**
1107 * 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 -08001108 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1109 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001110 *
1111 * Logged from:
1112 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1113 */
1114message WifiRunningStateChanged {
1115 repeated AttributionNode attribution_node = 1;
1116
1117 enum State {
1118 OFF = 0;
1119 ON = 1;
1120 }
1121 optional State state = 2;
1122}
1123
1124/**
Bookatze5885242017-10-24 20:10:31 -07001125 * Logs wifi locks held by an app.
1126 *
1127 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001128 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001129 */
1130message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001131 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001132
1133 enum State {
1134 OFF = 0;
1135 ON = 1;
1136 }
1137 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001138
1139 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1140 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001141}
1142
1143/**
1144 * Logs wifi signal strength changes.
1145 *
1146 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001147 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001148 */
1149message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001150 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1151 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001152}
1153
1154/**
1155 * Logs wifi scans performed by an app.
1156 *
1157 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001158 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001159 */
1160message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001161 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001162
1163 enum State {
1164 OFF = 0;
1165 ON = 1;
1166 }
1167 optional State state = 2;
1168}
1169
1170/**
Tej Singh4503e102018-01-04 14:35:01 -08001171 * Logs wifi multicast locks held by an app
1172 *
1173 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001174 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001175 */
1176message WifiMulticastLockStateChanged {
1177 repeated AttributionNode attribution_node = 1;
1178
1179 enum State {
1180 OFF = 0;
1181 ON = 1;
1182 }
1183 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001184
1185 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001186}
1187
1188/**
Tej Singh1ea42892018-01-19 09:27:00 -08001189 * Logs shutdown reason and duration on next boot.
1190 *
1191 * Logged from:
1192 * frameworks/base/core/java/com/android/server/BootReceiver.java
1193 */
1194message ShutdownSequenceReported {
1195 // True if shutdown is for a reboot. Default: false if we do not know.
1196 optional bool reboot = 1;
1197
1198 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1199 optional string reason = 2;
1200
1201 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1202 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001203 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001204
1205 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001206 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001207}
1208
Tej Singh6483ea42018-01-25 17:45:49 -08001209
1210/**
1211 * Logs boot reason and duration.
1212 *
1213 * Logged from:
1214 * system/core/bootstat/bootstat.cpp
1215 */
1216message BootSequenceReported {
1217 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1218 // Default: "<EMPTY>" if not available.
1219 optional string bootloader_reason = 1;
1220
1221 // Reason for system boot. Eg. bootloader, reboot,userrequested
1222 // Default: "<EMPTY>" if not available.
1223 optional string system_reason = 2;
1224
1225 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001226 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001227
1228 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001229 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001230
1231 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001232 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001233
1234 // Time since last boot in ms. Default: 0 if not available.
1235 optional int64 time_since_last_boot = 6;
1236}
1237
Tej Singhc477d9c2018-02-05 18:31:39 -08001238
1239/**
1240 * Logs call state and disconnect cause (if applicable).
1241 *
1242 * Logged from:
1243 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1244 */
1245message CallStateChanged {
1246 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1247 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1248 optional android.telecom.CallStateEnum call_state = 1;
1249
1250 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1251 // This value is only applicable when the call_state is DISCONNECTED, and
1252 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1253 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1254 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1255
1256 // True if the call is self-managed, which are apps that use the
1257 // telecom infrastructure to make their own calls.
1258 optional bool self_managed = 3;
1259
1260 // True if call is external. External calls are calls on connected Wear
1261 // devices but show up in Telecom so the user can pull them onto the device.
1262 optional bool external_call = 4;
1263}
1264
Tej Singh1ea42892018-01-19 09:27:00 -08001265/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001266 * Logs keyguard state. The keyguard is the lock screen.
1267 *
1268 * Logged from:
1269 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1270 */
1271message KeyguardStateChanged {
1272 enum State {
1273 UNKNOWN = 0;
1274 // The keyguard is hidden when the phone is unlocked.
1275 HIDDEN = 1;
1276 // The keyguard is shown when the phone is locked (screen turns off).
1277 SHOWN= 2;
1278 // The keyguard is occluded when something is overlaying the keyguard.
1279 // Eg. Opening the camera while on the lock screen.
1280 OCCLUDED = 3;
1281 }
1282 optional State state = 1;
1283}
1284
1285/**
1286 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1287 * prompts the user to enter a password (pattern, pin, etc).
1288 *
1289 * Logged from:
1290 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1291 */
1292
1293message KeyguardBouncerStateChanged {
1294 enum State {
1295 UNKNOWN = 0;
1296 // Bouncer is hidden, either as a result of successfully entering the
1297 // password, screen timing out, or user going back to lock screen.
1298 HIDDEN = 1;
1299 // This is when the user is being prompted to enter the password.
1300 SHOWN = 2;
1301 }
1302 optional State state = 1;
1303}
1304
1305/**
1306 * Logs the result of entering a password into the keyguard bouncer.
1307 *
1308 * Logged from:
1309 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1310 */
1311message KeyguardBouncerPasswordEntered {
1312 enum BouncerResult {
1313 UNKNOWN = 0;
1314 // The password entered was incorrect.
1315 FAILURE = 1;
1316 // The password entered was correct.
1317 SUCCESS = 2;
1318 }
1319 optional BouncerResult result = 1;
1320}
1321
Tej Singha883b372018-02-15 11:30:01 -08001322/*
1323 * Logs changes to the configuration of the device. The configuration is defined
1324 * in frameworks/base/core/java/android/content/res/Configuration.java
1325 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1326 * Please go there to interpret the possible values each field can be.
1327 *
1328 * Logged from:
1329 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1330 */
1331message ResourceConfigurationChanged {
1332 // Bit mask of color capabilities of the screen.
1333 // Contains information about the color gamut and hdr mode of the screen.
1334 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001335 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001336
1337 // The target screen density being rendered to.
1338 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001339 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001340
1341 // Current user preference for the scaling factor for fonts,
1342 // relative to the base density scaling.
1343 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001344 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001345
1346 // Flag indicating whether the hard keyboard is hidden.
1347 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001348 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001349
1350 // The type of keyboard attached to the device.
1351 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1352 optional int32 keyboard = 5;
1353
1354 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1355 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001356 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001357
1358 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1359 // 0 if undefined.
1360 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1361 optional int32 mcc = 7;
1362
1363 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1364 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1365 // MNC_ZERO symbol defined in Configuration.java.
1366 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1367 optional int32 mnc = 8;
1368
1369 // The kind of navigation available on the device.
1370 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1371 optional int32 navigation = 9;
1372
1373 // Flag indicating whether the navigation is available.
1374 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001375 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001376
1377 // Overall orientation of the screen.
1378 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1379 optional int32 orientation = 11;
1380
1381 // The current height of the available screen space, in dp units.
1382 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001383 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001384
1385 // Bit mask of overall layout of the screen.
1386 // Contains information about screen size, whether the screen is wider/taller
1387 // than normal, whether the screen layout is right-tl-left or left-to-right,
1388 // and whether the screen has a rounded shape.
1389 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001390 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001391
1392 // Current width of the available screen space, in dp units.
1393 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001394 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001395
1396 // The smallest screen size an application will see in normal operation.
1397 // This is the smallest value of both screenWidthDp and screenHeightDp
1398 // in portrait and landscape.
1399 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001400 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001401
1402 // The type of touch screen attached to the device.
1403 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1404 optional int32 touchscreen = 16;
1405
1406 // Bit mask of the ui mode.
1407 // Contains information about the overall ui mode of the device.
1408 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1409 // Also contains information about whether the device is in night mode.
1410 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001411 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001412}
1413
Tej Singheee317b2018-03-07 19:28:05 -08001414
1415/**
1416 * Logs changes in the connection state of the mobile radio.
1417 *
1418 * Logged from:
1419 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1420 */
1421message MobileConnectionStateChanged {
1422 // States are from the state machine DataConnection.java.
1423 enum State {
1424 UNKNOWN = 0;
1425 // The connection is inactive, or disconnected.
1426 INACTIVE = 1;
1427 // The connection is being activated, or connecting.
1428 ACTIVATING = 2;
1429 // The connection is active, or connected.
1430 ACTIVE = 3;
1431 // The connection is disconnecting.
1432 DISCONNECTING = 4;
1433 // The connection is disconnecting after creating a connection.
1434 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1435 }
1436 optional State state = 1;
1437 // For multi-sim phones, this distinguishes between the sim cards.
1438 optional int32 sim_slot_index = 2;
1439 // Used to identify the connection. Starts at 0 and increments by 1 for
1440 // every new network created. Resets whenever the device reboots.
1441 optional int32 data_connection_id = 3;
1442 // A bitmask for the capabilities of this connection.
1443 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1444 // Default value (if we have no information): 0
1445 optional int64 capabilities = 4;
1446 // If this connection has internet.
1447 // This just checks if the DEFAULT bit of capabilities is set.
1448 optional bool has_internet = 5;
1449}
1450
1451/**
1452 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1453 *
1454 * Logged from:
1455 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1456 */
1457message MobileRadioTechnologyChanged {
1458 optional android.telephony.NetworkTypeEnum state = 1;
1459 // For multi-sim phones, this distinguishes between the sim cards.
1460 optional int32 sim_slot_index = 2;
1461}
1462
Andrew Chantb56388b2018-03-22 21:07:33 -07001463/**
1464 * Logs the VID and PID of any connected USB devices.
1465 *
1466 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1467 *
1468 * Logged by Vendor.
1469 */
1470message UsbDeviceAttached {
1471 optional int32 vid = 1;
1472 optional int32 pid = 2;
1473 optional bool has_audio = 3;
1474 optional bool has_hid = 4;
1475 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001476 enum State {
1477 STATE_DISCONNECTED = 0;
1478 STATE_CONNECTED = 1;
1479 }
1480 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001481 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001482}
1483
Tej Singheee317b2018-03-07 19:28:05 -08001484
Tej Singhdd7bd352018-02-09 19:33:15 -08001485/**
Tej Singh5d991e12018-03-09 19:48:11 -08001486 * Logs when Bluetooth is enabled and disabled.
1487 *
1488 * Logged from:
1489 * services/core/java/com/android/server/BluetoothManagerService.java
1490 */
1491message BluetoothEnabledStateChanged {
1492 repeated AttributionNode attribution_node = 1;
1493 // Whether or not bluetooth is enabled on the device.
1494 enum State {
1495 UNKNOWN = 0;
1496 ENABLED = 1;
1497 DISABLED = 2;
1498 }
1499 optional State state = 2;
1500 // The reason for being enabled/disabled.
1501 // Eg. Airplane mode, crash, application request.
1502 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1503 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001504 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001505}
1506
1507/**
Jack Hed9837c82019-01-09 01:19:13 -08001508 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001509 *
1510 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001511 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1512 *
1513 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001514 */
1515message BluetoothConnectionStateChanged {
1516 // The state of the connection.
1517 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1518 optional android.bluetooth.ConnectionStateEnum state = 1;
1519 // An identifier that can be used to match connect and disconnect events.
1520 // Currently is last two bytes of a hash of a device level ID and
1521 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001522 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001523 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001524 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1525 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001526 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001527 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001528 // An identifier that can be used to match events for this device.
1529 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1530 // Salt: Randomly generated 256 bit value
1531 // Hash algorithm: HMAC-SHA256
1532 // Size: 32 byte
1533 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001534 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001535}
1536
1537/**
1538 * Logs when a Bluetooth device connects and disconnects over ACL
1539 *
1540 * Logged from:
1541 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1542 *
1543 * Next Tag: 3
1544 */
1545message BluetoothAclConnectionStateChanged {
1546 // An identifier that can be used to match events for this device.
1547 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1548 // Salt: Randomly generated 256 bit value
1549 // Hash algorithm: HMAC-SHA256
1550 // Size: 32 byte
1551 // Default: null or empty if the device identifier is not known
1552 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1553 // The state of the connection.
1554 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1555 optional android.bluetooth.ConnectionStateEnum state = 2;
1556}
1557
1558/**
1559 * Logs when a Bluetooth device connects and disconnects over SCO
1560 *
1561 * Logged from:
1562 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1563 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1564 *
1565 * Next Tag: 4
1566 */
1567message BluetoothScoConnectionStateChanged {
1568 // An identifier that can be used to match events for this device.
1569 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1570 // Salt: Randomly generated 256 bit value
1571 // Hash algorithm: HMAC-SHA256
1572 // Size: 32 byte
1573 // Default: null or empty if the device identifier is not known
1574 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1575 // The state of the connection.
1576 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1577 optional android.bluetooth.ConnectionStateEnum state = 2;
1578 // Codec used for this SCO connection
1579 // Default: UNKNOWN
1580 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001581}
1582
Jack Hec27040a2019-01-09 20:54:41 -08001583/**
1584 * Logged when active device of a profile changes
1585 *
1586 * Logged from:
1587 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1588 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1589 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1590 */
1591message BluetoothActiveDeviceChanged {
1592 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1593 // From android.bluetooth.BluetoothProfile
1594 optional int32 bt_profile = 1;
1595 // An identifier that can be used to match events for this new active device.
1596 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1597 // Salt: Randomly generated 256 bit value
1598 // Hash algorithm: HMAC-SHA256
1599 // Size: 32 byte
1600 // Default: null or empty if there is no active device for this profile
1601 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1602}
1603
Jack Heab86dbd22018-12-18 15:43:27 -08001604// Logs when there is an event affecting Bluetooth device's link layer connection.
1605// - This event is triggered when there is a related HCI command or event
1606// - Users of this metrics can deduce Bluetooth device's connection state from these events
1607// - HCI commands are logged before the command is sent, after receiving command status, and after
1608// receiving command complete
1609// - HCI events are logged when they arrive
1610//
1611// Low level log from system/bt
1612//
1613// Bluetooth classic commands:
1614// - CMD_CREATE_CONNECTION
1615// - CMD_DISCONNECT
1616// - CMD_CREATE_CONNECTION_CANCEL
1617// - CMD_ACCEPT_CONNECTION_REQUEST
1618// - CMD_REJECT_CONNECTION_REQUEST
1619// - CMD_SETUP_ESCO_CONNECTION
1620// - CMD_ACCEPT_ESCO_CONNECTION
1621// - CMD_REJECT_ESCO_CONNECTION
1622// - CMD_ENH_SETUP_ESCO_CONNECTION
1623// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1624//
1625// Bluetooth low energy commands:
1626// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1627// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1628// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1629// - CMD_BLE_CLEAR_WHITE_LIST
1630// - CMD_BLE_ADD_WHITE_LIST
1631// - CMD_BLE_REMOVE_WHITE_LIST
1632//
1633// Bluetooth classic events:
1634// - EVT_CONNECTION_COMP
1635// - EVT_CONNECTION_REQUEST
1636// - EVT_DISCONNECTION_COMP
1637// - EVT_ESCO_CONNECTION_COMP
1638// - EVT_ESCO_CONNECTION_CHANGED
1639//
1640// Bluetooth low energy meta events:
1641// - BLE_EVT_CONN_COMPLETE_EVT
1642// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1643//
1644// Next tag: 10
1645message BluetoothLinkLayerConnectionEvent {
1646 // An identifier that can be used to match events for this device.
1647 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1648 // Salt: Randomly generated 256 bit value
1649 // Hash algorithm: HMAC-SHA256
1650 // Size: 32 byte
1651 // Default: null or empty if the device identifier is not known
1652 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1653 // Connection handle of this connection if available
1654 // Range: 0x0000 - 0x0EFF (12 bits)
1655 // Default: 0xFFFF if the handle is unknown
1656 optional int32 connection_handle = 2;
1657 // Direction of the link
1658 // Default: DIRECTION_UNKNOWN
1659 optional android.bluetooth.DirectionEnum direction = 3;
1660 // Type of this link
1661 // Default: LINK_TYPE_UNKNOWN
1662 optional android.bluetooth.LinkTypeEnum type = 4;
1663
1664 // Reason metadata for this link layer connection event, rules for interpretation:
1665 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1666 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1667 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1668 // set and valid, ignore hci_ble_event
1669
1670 // HCI command associated with this event
1671 // Default: CMD_UNKNOWN
1672 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1673 // HCI event associated with this event
1674 // Default: EVT_UNKNOWN
1675 optional android.bluetooth.hci.EventEnum hci_event = 6;
1676 // HCI BLE meta event associated with this event
1677 // Default: BLE_EVT_UNKNOWN
1678 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1679 // HCI command status code if this is triggerred by hci_cmd
1680 // Default: STATUS_UNKNOWN
1681 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1682 // HCI reason code associated with this event
1683 // Default: STATUS_UNKNOWN
1684 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1685}
1686
Howard Roe103fe22019-01-17 16:52:16 -08001687/**
1688 * Logs when a module is rolled back by Watchdog.
1689 *
1690 * Logged from: Rollback Manager
1691 */
1692message WatchdogRollbackOccurred {
1693 enum RollbackType {
1694 UNKNOWN = 0;
1695 ROLLBACK_INITIATE = 1;
1696 ROLLBACK_SUCCESS = 2;
1697 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001698 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001699 }
1700 optional RollbackType rollback_type = 1;
1701
1702 optional string package_name = 2;
1703
1704 optional int32 package_version_code = 3;
1705}
1706
Jack Hec27040a2019-01-09 20:54:41 -08001707/**
1708 * Logs when there is a change in Bluetooth A2DP playback state
1709 *
1710 * Logged from:
1711 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1712 */
1713message BluetoothA2dpPlaybackStateChanged {
1714 // An identifier that can be used to match events for this device.
1715 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1716 // Salt: Randomly generated 256 bit value
1717 // Hash algorithm: HMAC-SHA256
1718 // Size: 32 byte
1719 // Default: null or empty if the device identifier is not known
1720 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1721 // Current playback state
1722 // Default: PLAYBACK_STATE_UNKNOWN
1723 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1724 // Current audio coding mode
1725 // Default: AUDIO_CODING_MODE_UNKNOWN
1726 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1727}
1728
1729/**
1730 * Logs when there is a change in A2DP codec config for a particular remote device
1731 *
1732 * Logged from:
1733 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1734 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1735 */
1736message BluetoothA2dpCodecConfigChanged {
1737 // An identifier that can be used to match events for this device.
1738 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1739 // Salt: Randomly generated 256 bit value
1740 // Hash algorithm: HMAC-SHA256
1741 // Size: 32 byte
1742 // Default: null or empty if the device identifier is not known
1743 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1744 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1745 // Default SOURCE_CODEC_TYPE_INVALID
1746 optional int32 codec_type = 2;
1747 // Codec priroity, the higher the more preferred, -1 for disabled
1748 // Default: CODEC_PRIORITY_DEFAULT
1749 optional int32 codec_priority = 3;
1750 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1751 // Default: SAMPLE_RATE_NONE
1752 optional int32 sample_rate = 4;
1753 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1754 // Default: BITS_PER_SAMPLE_NONE
1755 optional int32 bits_per_sample = 5;
1756 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1757 // Default: CHANNEL_MODE_NONE
1758 optional int32 channel_mode = 6;
1759 // Codec specific values
1760 // Default 0
1761 optional int64 codec_specific_1 = 7;
1762 optional int64 codec_specific_2 = 8;
1763 optional int64 codec_specific_3 = 9;
1764 optional int64 codec_specific_4 = 10;
1765}
1766
1767/**
1768 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1769 * Each codec's capability is logged separately due to statsd restriction
1770 *
1771 * Logged from:
1772 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1773 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1774 */
1775message BluetoothA2dpCodecCapabilityChanged {
1776 // An identifier that can be used to match events for this device.
1777 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1778 // Salt: Randomly generated 256 bit value
1779 // Hash algorithm: HMAC-SHA256
1780 // Size: 32 byte
1781 // Default: null or empty if the device identifier is not known
1782 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1783 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1784 // Default SOURCE_CODEC_TYPE_INVALID
1785 optional int32 codec_type = 2;
1786 // Codec priroity, the higher the more preferred, -1 for disabled
1787 // Default: CODEC_PRIORITY_DEFAULT
1788 optional int32 codec_priority = 3;
1789 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1790 // in BluetoothCodecConfig
1791 // Default: empty and SAMPLE_RATE_NONE for individual item
1792 optional int32 sample_rate = 4;
1793 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1794 // in BluetoothCodecConfig
1795 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1796 optional int32 bits_per_sample = 5;
1797 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1798 // BluetoothCodecConfig
1799 // Default: empty and CHANNEL_MODE_NONE for individual item
1800 optional int32 channel_mode = 6;
1801 // Codec specific values
1802 // Default 0
1803 optional int64 codec_specific_1 = 7;
1804 optional int64 codec_specific_2 = 8;
1805 optional int64 codec_specific_3 = 9;
1806 optional int64 codec_specific_4 = 10;
1807}
1808
1809/**
1810 * Logs when A2DP failed to read from PCM source.
1811 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1812 *
1813 * Logged from:
1814 * system/bt
1815 */
1816message BluetoothA2dpAudioUnderrunReported {
1817 // An identifier that can be used to match events for this device.
1818 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1819 // Salt: Randomly generated 256 bit value
1820 // Hash algorithm: HMAC-SHA256
1821 // Size: 32 byte
1822 // Default: null or empty if the device identifier is not known
1823 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1824 // Encoding interval in nanoseconds
1825 // Default: 0
1826 optional int64 encoding_interval_nanos = 2;
1827 // Number of bytes of PCM data that could not be read from the source
1828 // Default: 0
1829 optional int32 num_missing_pcm_bytes = 3;
1830}
1831
1832/**
1833 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1834 * buffer queue is full and we have to drop data
1835 *
1836 * Logged from:
1837 * system/bt
1838 */
1839message BluetoothA2dpAudioOverrunReported {
1840 // An identifier that can be used to match events for this device.
1841 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1842 // Salt: Randomly generated 256 bit value
1843 // Hash algorithm: HMAC-SHA256
1844 // Size: 32 byte
1845 // Default: null or empty if the device identifier is not known
1846 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1847 // Encoding interval in nanoseconds
1848 // Default: 0
1849 optional int64 encoding_interval_nanos = 2;
1850 // Number of buffers dropped in this event
1851 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1852 // Default: 0
1853 optional int32 num_dropped_buffers = 3;
1854 // Number of encoded buffers dropped in this event
1855 // Default 0
1856 optional int32 num_dropped_encoded_frames = 4;
1857 // Number of encoded bytes dropped in this event
1858 // Default: 0
1859 optional int32 num_dropped_encoded_bytes = 5;
1860}
1861
1862/**
1863 * Logs when we receive reports regarding a device's RSSI value
1864 *
1865 * Logged from:
1866 * system/bt
1867 */
1868message BluetoothDeviceRssiReported {
1869 // An identifier that can be used to match events for this device.
1870 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1871 // Salt: Randomly generated 256 bit value
1872 // Hash algorithm: HMAC-SHA256
1873 // Size: 32 byte
1874 // Default: null or empty if the device identifier is not known
1875 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1876 // Connection handle of this connection if available
1877 // Range: 0x0000 - 0x0EFF (12 bits)
1878 // Default: 0xFFFF if the handle is unknown
1879 optional int32 connection_handle = 2;
1880 // HCI command status code if this is triggerred by hci_cmd
1881 // Default: STATUS_UNKNOWN
1882 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1883 // BR/EDR
1884 // Range: -128 ≤ N ≤ 127 (signed integer)
1885 // Units: dB
1886 // LE:
1887 // Range: -127 to 20, 127 (signed integer)
1888 // Units: dBm
1889 // Invalid when an out of range value is reported
1890 optional int32 rssi = 4;
1891}
1892
1893/**
1894 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1895 *
1896 * Logged from:
1897 * system/bt
1898 */
1899message BluetoothDeviceFailedContactCounterReported {
1900 // An identifier that can be used to match events for this device.
1901 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1902 // Salt: Randomly generated 256 bit value
1903 // Hash algorithm: HMAC-SHA256
1904 // Size: 32 byte
1905 // Default: null or empty if the device identifier is not known
1906 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1907 // Connection handle of this connection if available
1908 // Range: 0x0000 - 0x0EFF (12 bits)
1909 // Default: 0xFFFF if the handle is unknown
1910 optional int32 connection_handle = 2;
1911 // HCI command status code if this is triggerred by hci_cmd
1912 // Default: STATUS_UNKNOWN
1913 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1914 // Number of consecutive failed contacts for a connection corresponding to the Handle
1915 // Range: uint16_t, 0-0xFFFF
1916 // Default: 0xFFFFF
1917 optional int32 failed_contact_counter = 4;
1918}
1919
1920/**
1921 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1922 *
1923 * Logged from:
1924 * system/bt
1925 */
1926message BluetoothDeviceTxPowerLevelReported {
1927 // An identifier that can be used to match events for this device.
1928 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1929 // Salt: Randomly generated 256 bit value
1930 // Hash algorithm: HMAC-SHA256
1931 // Size: 32 byte
1932 // Default: null or empty if the device identifier is not known
1933 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1934 // Connection handle of this connection if available
1935 // Range: 0x0000 - 0x0EFF (12 bits)
1936 // Default: 0xFFFF if the handle is unknown
1937 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001938 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001939 // Default: STATUS_UNKNOWN
1940 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1941 // Range: -30 ≤ N ≤ 20
1942 // Units: dBm
1943 // Invalid when an out of range value is reported
1944 optional int32 transmit_power_level = 4;
1945}
Jack Heab86dbd22018-12-18 15:43:27 -08001946
Tej Singh5d991e12018-03-09 19:48:11 -08001947/**
Jack He1021a612019-01-20 21:22:46 -08001948 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1949 * receiving an HCI command from the host
1950 *
1951 * Logged from: system/bt
1952 */
1953message BluetoothHciTimeoutReported {
1954 // HCI command associated with this event
1955 // Default: CMD_UNKNOWN
1956 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1957}
1958
1959/**
1960 * Logs when we receive Bluetooth Link Quality Report event from the controller
1961 * See Android Bluetooth HCI specification for more details
1962 *
1963 * Note: all count and bytes field are counted since last event
1964 *
1965 * Logged from: system/bt
1966 */
1967message BluetoothQualityReportReported {
1968 // Quality report ID
1969 // Original type: uint8_t
1970 // Default: BQR_ID_UNKNOWN
1971 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1972 // Packet type of the connection
1973 // Original type: uint8_t
1974 // Default: BQR_PACKET_TYPE_UNKNOWN
1975 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1976 // Connection handle of the connection
1977 // Original type: uint16_t
1978 optional int32 connection_handle = 3;
1979 // Performing Role for the connection
1980 // Original type: uint8_t
1981 optional int32 connection_role = 4;
1982 // Current Transmit Power Level for the connection. This value is the same as the controller's
1983 // response to the HCI_Read_Transmit_Power_Level HCI command
1984 // Original type: uint8_t
1985 optional int32 tx_power_level = 5;
1986 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1987 // absolute receiver signal strength value
1988 // Original type: int8_t
1989 optional int32 rssi = 6;
1990 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1991 // channels used by the link currently
1992 // Original type: uint8_t
1993 optional int32 snr = 7;
1994 // Indicates the number of unused channels in AFH_channel_map
1995 // Original type: uint8_t
1996 optional int32 unused_afh_channel_count = 8;
1997 // Indicates the number of the channels which are interfered and quality is bad but are still
1998 // selected for AFH
1999 // Original type: uint8_t
2000 optional int32 afh_select_unideal_channel_count = 9;
2001 // Current Link Supervision Timeout Setting
2002 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2003 // Original type: uint16_t
2004 optional int32 lsto = 10;
2005 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2006 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2007 // 0x01 (Piconet Clock)
2008 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2009 // Original type: uint32_t
2010 optional int64 connection_piconet_clock = 11;
2011 // The count of retransmission
2012 // Original type: uint32_t
2013 optional int64 retransmission_count = 12;
2014 // The count of no RX
2015 // Original type: uint32_t
2016 optional int64 no_rx_count = 13;
2017 // The count of NAK (Negative Acknowledge)
2018 // Original type: uint32_t
2019 optional int64 nak_count = 14;
2020 // Controller timestamp of last TX ACK
2021 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2022 // Original type: uint32_t
2023 optional int64 last_tx_ack_timestamp = 15;
2024 // The count of Flow-off (STOP)
2025 // Original type: uint32_t
2026 optional int64 flow_off_count = 16;
2027 // Controller timestamp of last Flow-on (GO)
2028 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2029 // Original type: uint32_t
2030 optional int64 last_flow_on_timestamp = 17;
2031 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2032 // Original type: uint32_t
2033 optional int64 buffer_overflow_bytes = 18;
2034 // Buffer underflow count (in byte) since last event
2035 // Original type: uint32_t
2036 optional int64 buffer_underflow_bytes = 19;
2037}
2038
2039/**
2040 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2041 *
2042 * Notes:
2043 * - Each event can be partially filled as we might learn different pieces of device
2044 * information at different time
2045 * - Multiple device info events can be combined to give more complete picture
2046 * - When multiple device info events tries to describe the same information, the
2047 * later one wins
2048 *
2049 * Logged from:
2050 * packages/apps/Bluetooth
2051 */
Jack Heaea26982019-04-04 11:19:48 -07002052message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002053 // An identifier that can be used to match events for this device.
2054 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2055 // Salt: Randomly generated 256 bit value
2056 // Hash algorithm: HMAC-SHA256
2057 // Size: 32 byte
2058 // Default: null or empty if the device identifier is not known
2059 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2060 // Where is this device info obtained from
2061 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2062 // Name of the data source
2063 // For EXTERNAL: package name of the data source
2064 // For INTERNAL: null for general case, component name otherwise
2065 optional string source_name = 3;
2066 // Name of the manufacturer of this device
2067 optional string manufacturer = 4;
2068 // Model of this device
2069 optional string model = 5;
2070 // Hardware version of this device
2071 optional string hardware_version = 6;
2072 // Software version of this device
2073 optional string software_version = 7;
2074}
2075
2076/**
2077 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2078 * device, as documented by the Bluetooth Core HCI specification
2079 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2080 * Vol 2, Part E, Page 1118
2081 *
2082 * Logged from:
2083 * system/bt
2084 */
2085message BluetoothRemoteVersionInfoReported {
2086 // Connection handle of the connection
2087 // Original type: uint16_t
2088 optional int32 connection_handle = 1;
2089 // HCI command status code
2090 // Default: STATUS_UNKNOWN
2091 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2092 // 1 byte Version of current LMP in the remote controller
2093 optional int32 lmp_version = 3;
2094 // 2 bytes LMP manufacturer code of the remote controller
2095 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2096 optional int32 lmp_manufacturer_code = 4;
2097 // 4 bytes subversion of the LMP in the remote controller
2098 optional int32 lmp_subversion = 5;
2099}
2100
2101/**
2102 * Logs when certain Bluetooth SDP attributes are discovered
2103 * Constant definitions are from:
2104 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2105 *
2106 * Current logged attributes:
2107 * - BluetoothProfileDescriptorList
2108 * - Supported Features Bitmask
2109 *
2110 * Logged from:
2111 * system/bt
2112 */
2113message BluetoothSdpAttributeReported {
2114 // An identifier that can be used to match events for this device.
2115 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2116 // Salt: Randomly generated 256 bit value
2117 // Hash algorithm: HMAC-SHA256
2118 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2119 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2120 // Original type: uint16_t
2121 optional int32 protocol_uuid = 2;
2122 // Short form UUIDs used to identify Bluetooth SDP attribute types
2123 // Original type: uint16_t
2124 optional int32 attribute_id = 3;
2125 // Attribute value for the particular attribute
2126 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2127}
2128
2129/**
2130 * Logs when bond state of a Bluetooth device changes
2131 *
2132 * Logged from:
2133 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2134 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2135 */
2136message BluetoothBondStateChanged {
2137 // An identifier that can be used to match events for this device.
2138 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2139 // Salt: Randomly generated 256 bit value
2140 // Hash algorithm: HMAC-SHA256
2141 // Size: 32 byte
2142 // Default: null or empty if the device identifier is not known
2143 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2144 // Preferred transport type to remote dual mode device
2145 // Default: TRANSPORT_AUTO means no preference
2146 optional android.bluetooth.TransportTypeEnum transport = 2;
2147 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2148 // Default: UNKNOWN
2149 optional android.bluetooth.DeviceTypeEnum type = 3;
2150 // Current bond state (NONE, BONDING, BONDED)
2151 // Default: BOND_STATE_UNKNOWN
2152 optional android.bluetooth.BondStateEnum bond_state = 4;
2153 // Bonding sub state
2154 // Default: BOND_SUB_STATE_UNKNOWN
2155 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2156 // Unbond Reason
2157 // Default: UNBOND_REASON_UNKNOWN
2158 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2159}
2160
2161/**
2162 * Logs there is an event related Bluetooth classic pairing
2163 *
2164 * Logged from:
2165 * system/bt
2166 */
2167message BluetoothClassicPairingEventReported {
2168 // An identifier that can be used to match events for this device.
2169 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2170 // Salt: Randomly generated 256 bit value
2171 // Hash algorithm: HMAC-SHA256
2172 // Size: 32 byte
2173 // Default: null or empty if the device identifier is not known
2174 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2175 // Connection handle of this connection if available
2176 // Range: 0x0000 - 0x0EFF (12 bits)
2177 // Default: 0xFFFF if the handle is unknown
2178 optional int32 connection_handle = 2;
2179 // HCI command associated with this event
2180 // Default: CMD_UNKNOWN
2181 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2182 // HCI event associated with this event
2183 // Default: EVT_UNKNOWN
2184 optional android.bluetooth.hci.EventEnum hci_event = 4;
2185 // HCI command status code if this is triggerred by hci_cmd
2186 // Default: STATUS_UNKNOWN
2187 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2188 // HCI reason code associated with this event
2189 // Default: STATUS_UNKNOWN
2190 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002191 // A status value related to this specific event
2192 // Default: 0
2193 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002194}
2195
2196/**
2197 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2198 *
2199 * Logged from:
2200 * system/bt
2201 */
2202message BluetoothSmpPairingEventReported {
2203 // An identifier that can be used to match events for this device.
2204 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2205 // Salt: Randomly generated 256 bit value
2206 // Hash algorithm: HMAC-SHA256
2207 // Size: 32 byte
2208 // Default: null or empty if the device identifier is not known
2209 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2210 // SMP command sent or received over L2CAP
2211 // Default: CMD_UNKNOWN
2212 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2213 // Whether this command is sent or received
2214 // Default: DIRECTION_UNKNOWN
2215 optional android.bluetooth.DirectionEnum direction = 3;
2216 // SMP failure reason code
2217 // Default: PAIRING_FAIL_REASON_DEFAULT
2218 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2219}
2220
2221/**
Jack He815cdba2019-01-30 17:24:55 -08002222 * Logs when a Bluetooth socket’s connection state changed
2223 *
2224 * Logged from:
2225 * system/bt
2226 */
2227message BluetoothSocketConnectionStateChanged {
2228 // An identifier that can be used to match events for this device.
2229 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2230 // Salt: Randomly generated 256 bit value
2231 // Hash algorithm: HMAC-SHA256
2232 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002233 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002234 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002235 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002236 // Default 0 when unknown or don't care
2237 optional int32 port = 2;
2238 // Socket type as mentioned in
2239 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2240 // Default: SOCKET_TYPE_UNKNOWN
2241 optional android.bluetooth.SocketTypeEnum type = 3;
2242 // Socket connection state
2243 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2244 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2245 // Number of bytes sent to remote device during this connection
2246 optional int64 tx_bytes = 5;
2247 // Number of bytes received from remote device during this connection
2248 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002249 // Socket owner's UID
2250 optional int32 uid = 7 [(is_uid) = true];
2251 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2252 // |port| must be spawned by |server_port|
2253 // Default 0 when unknown or don't care
2254 optional int32 server_port = 8;
2255 // Whether this is a server listener socket
2256 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002257}
2258
2259/**
Jack He71426802019-04-02 13:32:52 -07002260 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2261 *
2262 * Logged from:
2263 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2264 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2265 *
2266 */
2267message BluetoothClassOfDeviceReported {
2268 // An identifier that can be used to match events for this device.
2269 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2270 // Salt: Randomly generated 256 bit value
2271 // Hash algorithm: HMAC-SHA256
2272 // Size: 32 byte
2273 // Default: null or empty if this is a server listener socket
2274 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2275 // Class of Device (CoD) value including both Major, Minor device class and service class
2276 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2277 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2278 // Default: 0
2279 optional int32 class_of_device = 2;
2280}
2281
2282/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002283 * Logs when something is plugged into or removed from the USB-C connector.
2284 *
2285 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002286 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002287 */
2288message UsbConnectorStateChanged {
2289 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002290 STATE_DISCONNECTED = 0;
2291 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002292 }
2293 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002294 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002295 // Last active session in ms.
2296 // 0 when the port is in connected state.
2297 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002298}
2299
2300/**
2301 * Logs the reported speaker impedance.
2302 *
2303 * Logged from:
2304 * Vendor audio implementation.
2305 */
2306message SpeakerImpedanceReported {
2307 optional int32 speaker_location = 1;
2308 optional int32 impedance = 2;
2309}
2310
2311/**
2312 * Logs the report of a failed hardware.
2313 *
2314 * Logged from:
2315 * Vendor HALs.
2316 *
2317 */
2318message HardwareFailed {
2319 enum HardwareType {
2320 HARDWARE_FAILED_UNKNOWN = 0;
2321 HARDWARE_FAILED_MICROPHONE = 1;
2322 HARDWARE_FAILED_CODEC = 2;
2323 HARDWARE_FAILED_SPEAKER = 3;
2324 HARDWARE_FAILED_FINGERPRINT = 4;
2325 }
2326 optional HardwareType hardware_type = 1;
2327
Maggie White6dcd8572019-01-31 14:11:50 -08002328 /**
2329 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002330 * the same hardware_type. The specific locations are vendor defined integers,
2331 * referring to board-specific numbering schemes.
2332 */
2333 optional int32 hardware_location = 2;
2334
Maggie White6dcd8572019-01-31 14:11:50 -08002335 /**
2336 * failure_code is specific to the HardwareType of the failed hardware.
2337 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002338 */
Maggie White6dcd8572019-01-31 14:11:50 -08002339 enum HardwareErrorCode {
2340 UNKNOWN = 0;
2341 COMPLETE = 1;
2342 SPEAKER_HIGH_Z = 2;
2343 SPEAKER_SHORT = 3;
2344 FINGERPRINT_SENSOR_BROKEN = 4;
2345 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002346 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002347 }
2348 optional int32 failure_code = 3;
2349}
2350
2351/**
2352 * Log an event when the device has been physically dropped.
2353 * Reported from the /vendor partition.
2354 */
2355message PhysicalDropDetected {
2356 // Confidence that the event was actually a drop, 0 -> 100
2357 optional int32 confidence_pctg = 1;
2358 // Peak acceleration of the drop, in 1/1000s of a g.
2359 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002360 // Duration of freefall in ms
2361 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002362}
2363
2364/**
2365 * Log bucketed battery charge cycles.
2366 *
2367 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002368 * a given charge point. For example, if 10 cycle buckets are
2369 * initialized, bucket 1 is the lowest 1/10th of the battery,
2370 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002371 *
2372 * Logged from:
2373 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2374 */
2375message ChargeCyclesReported {
2376 optional int32 cycle_bucket_1 = 1;
2377 optional int32 cycle_bucket_2 = 2;
2378 optional int32 cycle_bucket_3 = 3;
2379 optional int32 cycle_bucket_4 = 4;
2380 optional int32 cycle_bucket_5 = 5;
2381 optional int32 cycle_bucket_6 = 6;
2382 optional int32 cycle_bucket_7 = 7;
2383 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002384 optional int32 cycle_bucket_9 = 9;
2385 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002386}
2387
2388/**
Howard Roa46b6582018-09-18 16:45:02 -07002389 * Log battery health snapshot.
2390 *
2391 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2392 * are snapshotted periodically over 24hrs.
2393 */
2394message BatteryHealthSnapshot {
2395 enum BatterySnapshotType {
2396 UNKNOWN = 0;
2397 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2398 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2399 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2400 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2401 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2402 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2403 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2404 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2405 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2406 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2407 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2408 }
2409 optional BatterySnapshotType type = 1;
2410 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002411 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002412 // Voltage Battery Voltage, in microVolts.
2413 optional int32 voltage_micro_volt = 3;
2414 // Current Battery current, in microAmps.
2415 optional int32 current_micro_amps = 4;
2416 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2417 optional int32 open_circuit_micro_volt = 5;
2418 // Resistance Battery Resistance, in microOhms.
2419 optional int32 resistance_micro_ohm = 6;
2420 // Level Battery Level, as % of full.
2421 optional int32 level_percent = 7;
2422}
2423
2424/**
2425 * Log slow I/O operations on the primary storage.
2426 */
2427message SlowIo {
2428 // Classifications of IO Operations.
2429 enum IoOperation {
2430 UNKNOWN = 0;
2431 READ = 1;
2432 WRITE = 2;
2433 UNMAP = 3;
2434 SYNC = 4;
2435 }
2436 optional IoOperation operation = 1;
2437
2438 // The number of slow IO operations of this type over 24 hours.
2439 optional int32 count = 2;
2440}
2441
2442/**
2443 * Log battery caused shutdown with the last recorded voltage.
2444 */
2445message BatteryCausedShutdown {
2446 // The last recorded battery voltage prior to shutdown.
2447 optional int32 last_recorded_micro_volt = 1;
2448}
2449
2450/**
Tej Singha72344992019-04-17 18:55:08 -07002451 * Logs when ThermalService receives throttling events.
2452 *
2453 * Logged from:
2454 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2455 */
2456message ThermalThrottlingSeverityStateChanged {
2457 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2458 optional android.os.TemperatureTypeEnum sensor_type = 1;
2459
2460 // The name of the temperature source. Eg. CPU0
2461 optional string sensor_name = 2;
2462
2463 // Temperature in tenths of a degree C.
2464 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2465 optional int32 temperature_deci_celsius = 3;
2466
2467 // Relative severity of the throttling, see enum definition.
2468 optional android.os.ThrottlingSeverityEnum severity = 4;
2469}
2470
2471/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002472 * Logs the duration of a davey (jank of >=700ms) when it occurs
2473 *
2474 * Logged from:
2475 * frameworks/base/libs/hwui/JankTracker.cpp
2476 */
2477message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002478 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002479 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002480
Tej Singhbb8554a2018-01-26 11:59:14 -08002481 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002482 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002483}
2484
2485/**
Bookatze5885242017-10-24 20:10:31 -07002486 * Logs phone signal strength changes.
2487 *
2488 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002489 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002490 */
2491message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002492 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2493 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002494}
2495
Yangster4ccebea2018-10-09 17:09:02 -07002496
2497/**
2498 * Logs when the phone state, sim state or signal strength changes
2499 *
2500 * Logged from:
2501 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2502 */
2503message PhoneServiceStateChanged {
2504 optional android.telephony.ServiceStateEnum state = 1;
2505 optional android.telephony.SimStateEnum sim_state = 2;
2506 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2507}
2508
2509/**
2510 * Logs when the phone becomes on or off.
2511 *
2512 * Logged from:
2513 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2514 */
2515message PhoneStateChanged {
2516 enum State {
2517 OFF = 0;
2518 ON = 1;
2519 }
2520 optional State state = 1;
2521}
2522
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002523message BackGesture {
2524 enum BackType {
2525 DEFAULT_BACK_TYPE = 0;
2526 COMPLETED = 1;
2527 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2528 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2529 INCOMPLETE = 4;
2530 }
2531 optional BackType type = 1;
2532
2533 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2534 enum WindowHorizontalLocation {
2535 DEFAULT_LOCATION = 0;
2536 LEFT = 1;
2537 RIGHT = 2;
2538 }
2539 optional WindowHorizontalLocation x_location = 3;
2540}
2541
2542message ExclusionRectStateChanged {
2543 optional string component_name = 1; // if not available, simply packageName
2544 optional int32 requested_height = 2; // px
2545 optional int32 rejected_height = 3; // px
2546
2547 enum WindowHorizontalLocation {
2548 DEFAULT_LOCATION = 0;
2549 LEFT = 1;
2550 RIGHT = 2;
2551 }
2552 optional WindowHorizontalLocation x_location = 4;
2553 optional bool landscape = 5;
2554 optional bool splitscreen = 6;
2555 optional int32 duration_millis = 7;
2556}
2557
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002558message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002559 optional android.stats.launcher.LauncherAction action = 1;
2560 optional android.stats.launcher.LauncherState src_state = 2;
2561 optional android.stats.launcher.LauncherState dst_state = 3;
2562 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002563 optional bool is_swipe_up_enabled = 5;
2564}
2565
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002566message StyleUIChanged {
2567 optional android.stats.style.Action action = 1;
2568 optional int32 color_package_hash = 2;
2569 optional int32 font_package_hash = 3;
2570 optional int32 shape_package_hash = 4;
2571 optional int32 clock_package_hash = 5;
2572 optional int32 launcher_grid = 6;
2573 optional int32 wallpaper_category_hash = 7;
2574 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002575 optional int32 color_preference = 9;
2576 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002577}
2578
David Chenc28b2bb2017-10-24 12:52:52 -07002579/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002580 * Logs when Settings UI has changed.
2581 *
2582 * Logged from:
2583 * packages/apps/Settings
2584 */
2585message SettingsUIChanged {
2586 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002587 * Where this SettingsUIChange event comes from. For example, if
2588 * it's a PAGE_VISIBLE event, where the page is opened from.
2589 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002590 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002591
2592 /**
2593 * What the UI action is.
2594 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002595 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002596
2597 /**
2598 * Where the action is happening
2599 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002600 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002601
2602 /**
2603 * What preference changed in this event.
2604 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002605 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002606
2607 /**
2608 * The new value of the changed preference.
2609 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002610 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002611}
2612
2613/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002614 * Logs basic timing information about touch events.
2615 * Reported at most every 5 minutes while device is being interacted with.
2616 *
2617 * Logged from:
2618 * frameworks/native/services/inputflinger
2619 */
2620message TouchEventReported {
2621 /**
2622 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2623 * and the standard deviation of latency between the kernel and framework
2624 * for touchscreen events. The units are microseconds.
2625 *
2626 * The number is measured as the difference between the time at which
2627 * the input event was received in the evdev driver,
2628 * and the time at which the input event was received in EventHub.
2629 */
2630 // Minimum value
2631 optional float latency_min_micros = 1;
2632 // Maximum value
2633 optional float latency_max_micros = 2;
2634 // Average value
2635 optional float latency_mean_micros = 3;
2636 // Standard deviation
2637 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002638 // Number of touch events (input_event) in this report
2639 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002640}
2641
2642/**
Philip Quinn0eded622019-01-29 12:46:28 -08002643 * Logs gesture classification and timing information for touch events.
2644 *
2645 * Logged from:
2646 * frameworks/base/core/java/android/view/GestureDetector.java
2647 * frameworks/base/core/java/android/view/View.java
2648 */
2649message TouchGestureClassified {
2650 // The source of the classification (e.g. Java class name).
2651 optional string source = 1;
2652
2653 enum Classification {
2654 UNKNOWN_CLASSIFICATION = 0;
2655 SINGLE_TAP = 1;
2656 DOUBLE_TAP = 2;
2657 LONG_PRESS = 3;
2658 DEEP_PRESS = 4;
2659 SCROLL = 5;
2660 }
2661 // The classification of the gesture.
2662 optional Classification classification = 2;
2663
2664 // The interval from the start of a touch event stream until the
2665 // classification was made.
2666 optional int32 latency_millis = 3;
2667
2668 // The distance from the location of the first touch event to the
2669 // location of the touch event when the classification was made.
2670 optional float displacement_px = 4;
2671}
2672
2673/**
David Chenc28b2bb2017-10-24 12:52:52 -07002674 * Logs that a setting was updated.
2675 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002676 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002677 * The tag and is_default allow resetting of settings to default values based on the specified
2678 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2679 */
2680message SettingChanged {
2681 // The name of the setting.
2682 optional string setting = 1;
2683
2684 // The change being imposed on this setting. May represent a number, eg "3".
2685 optional string value = 2;
2686
2687 // The new value of this setting. For most settings, this is same as value. For some settings,
2688 // value is +X or -X where X represents an element in a set. For example, if the previous value
2689 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2690 // The +/- feature is currently only used for location_providers_allowed.
2691 optional string new_value = 3;
2692
2693 // The previous value of this setting.
2694 optional string prev_value = 4;
2695
2696 // The tag used with the is_default for resetting sets of settings. This is generally null.
2697 optional string tag = 5;
2698
Bookatz90867622018-01-31 15:05:57 -08002699 // True if this setting with tag should be resettable.
2700 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002701
David Chenbd789912018-03-16 17:19:55 -07002702 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002703 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002704
2705 enum ChangeReason {
2706 UPDATED = 1; // Updated can be an insertion or an update.
2707 DELETED = 2;
2708 }
2709 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002710}
Chenjie Yub3dda412017-10-24 13:41:59 -07002711
Chenjie Yu05013b32017-11-21 10:21:41 -08002712/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002713 * Logs activity going to foreground or background
2714 *
2715 * Logged from:
2716 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2717 */
2718message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002719 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002720 optional string pkg_name = 2;
2721 optional string class_name = 3;
2722
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002723 enum State {
2724 BACKGROUND = 0;
2725 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002726 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002727 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002728}
David Chenc8a43242017-10-17 16:23:28 -07002729
2730/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002731 * Logs when a volume entered low Storage state.
2732 * Logged from:
2733 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2734 */
2735message LowStorageStateChanged {
2736 // Volume that ran out of storage.
2737 optional string volume_description = 1;
2738
2739 enum State {
2740 UNKNOWN = 0;
2741 OFF = 1;
2742 ON = 2;
2743 }
2744 optional State state = 2;
2745}
2746
2747/**
2748 * Logs when an app is downgraded.
2749 * Logged from:
2750 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2751 */
2752message AppDowngraded {
2753 optional string package_name = 1;
2754 // Size of the package (all data) before being downgraded.
2755 optional int64 size_in_bytes_before = 2;
2756 // Size of the package (all data) after being downgraded.
2757 optional int64 size_in_bytes_after = 3;
2758
2759 optional bool aggressive = 4;
2760}
2761
2762/**
2763 * Logs when an app is optimized after being downgraded.
2764 * Logged from:
2765 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2766 */
2767message AppOptimizedAfterDowngraded {
2768 optional string package_name = 1;
2769}
2770
2771/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002772 * Logs whenever an app is installed on external storage.
2773 * Logged from:
2774 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2775 */
2776message AppInstallOnExternalStorageReported {
2777 // The type of external storage.
2778 optional android.stats.storage.ExternalStorageType storage_type = 1;
2779 // The name of the package that is installed on the sd card.
2780 optional string package_name = 2;
2781}
2782
2783/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002784 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002785 * Logged from:
2786 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2787 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002788message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002789 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002790
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002791 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002792
2793 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002794 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002795 optional string process_name = 3;
2796
2797 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002798 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002799
2800 optional string package_name = 5;
2801
2802 enum InstantApp {
2803 UNAVAILABLE = 0;
2804 FALSE = 1;
2805 TRUE = 2;
2806 }
2807 optional InstantApp is_instant_app = 6;
2808
2809 enum ForegroundState {
2810 UNKNOWN = 0;
2811 BACKGROUND = 1;
2812 FOREGROUND = 2;
2813 }
2814 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002815
2816 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002817}
David Chen9e3808c2017-11-20 17:25:34 -08002818
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002819/**
2820 * Logs when a WTF (What a Terrible Failure) happened.
2821 * Logged from:
2822 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2823 */
2824message WTFOccurred {
2825 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002826
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002827 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002828
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002829 // The name of the process.
2830 // system_server if it is not by an app
2831 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002832
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002833 // The pid if available. -1 means not available.
2834 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002835
2836 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002837}
2838
2839/**
2840 * Logs when system server reports low memory.
2841 * Logged from:
2842 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2843 */
2844message LowMemReported {
2845}
2846
2847/**
2848 * Logs when an app ANR (App Not Responding) occurs.
2849 * Logged from:
2850 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2851 */
2852message ANROccurred {
2853 optional int32 uid = 1 [(is_uid) = true];
2854
2855 optional string process_name = 2;
2856
2857 optional string short_component_name = 3;
2858
2859 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002860
2861 enum InstantApp {
2862 UNAVAILABLE = 0;
2863 FALSE = 1;
2864 TRUE = 2;
2865 }
2866 optional InstantApp is_instant_app = 5;
2867
2868 enum ForegroundState {
2869 UNKNOWN = 0;
2870 BACKGROUND = 1;
2871 FOREGROUND = 2;
2872 }
2873 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002874
2875 optional android.server.ErrorSource error_source = 7;
2876
2877 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002878}
2879
Bookatza7020bd2018-08-28 16:29:35 -07002880/**
2881 * Logs when the vibrator state changes.
2882 * Logged from:
2883 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2884 */
2885message VibratorStateChanged {
2886 repeated AttributionNode attribution_node = 1;
2887
2888 enum State {
2889 OFF = 0;
2890 ON = 1;
2891 }
2892 optional State state = 2;
2893
2894 // Duration (in milliseconds) requested to keep the vibrator on.
2895 // Only applicable for State == ON.
2896 optional int64 duration_millis = 3;
2897}
2898
David Chen0a368b22017-12-06 16:28:16 -08002899/*
2900 * Allows other apps to push events into statsd.
2901 * Logged from:
2902 * frameworks/base/core/java/android/util/StatsLog.java
2903 */
David Chen0b5c90c2018-01-25 16:51:49 -08002904message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002905 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002906 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002907
2908 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2909 optional int32 label = 2;
2910
2911 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2912 // predicates for the metrics).
2913 enum State {
2914 UNKNOWN = 0;
2915 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2916 STOP = 2;
2917 START = 3;
2918 }
2919 optional State state = 3;
2920}
2921
David Chen9e3808c2017-11-20 17:25:34 -08002922/**
Bookatz7948c872018-09-04 12:58:33 -07002923 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2924 * For example, this could be due to the user manually changing the time.
2925 *
2926 * Logged from:
2927 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2928 */
2929message WallClockTimeShifted {
2930 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2931 optional int64 wall_clock_timestamp_millis = 1;
2932}
2933
2934/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002935 * Logs when statsd detects an anomaly.
2936 *
2937 * Logged from:
2938 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2939 */
2940message AnomalyDetected {
2941 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002942 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002943
Yangster-mac94e197c2018-01-02 16:03:03 -08002944 // Id of the config whose anomaly detection alert fired.
2945 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002946
Yangster-mac94e197c2018-01-02 16:03:03 -08002947 // Id of the alert (i.e. name of the anomaly that was detected).
2948 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002949}
2950
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002951message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002952 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002953 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002954
2955 // The app package name.
2956 optional string pkg_name = 2;
2957
2958 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002959 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002960 WARM = 1;
2961 HOT = 2;
2962 COLD = 3;
2963 }
2964 // The transition type.
2965 optional TransitionType type = 3;
2966
2967 // The activity name.
2968 optional string activity_name = 4;
2969
2970 // The name of the calling app. Empty if not set.
2971 optional string calling_pkg_name = 5;
2972
2973 // Whether the app is an instant app.
2974 optional bool is_instant_app = 6;
2975
2976 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002977 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002978
Bookatz80d11a02018-01-16 10:46:35 -08002979 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002980
David Chen0b5c90c2018-01-25 16:51:49 -08002981 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002982 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002983 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002984 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002985 optional int32 bind_application_delay_millis = 11;
2986 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002987
2988 // Empty if not set.
2989 optional string launch_token = 13;
2990
Calin Juravle759fbda2018-02-20 19:52:30 +00002991 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002992 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002993
2994 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002995 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002996}
2997
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002998message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002999 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003000 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003001
3002 // The app package name.
3003 optional string pkg_name = 2;
3004
3005 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003006 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003007 WARM = 1;
3008 HOT = 2;
3009 COLD = 3;
3010 }
3011 // The transition type.
3012 optional TransitionType type = 3;
3013
3014 // The activity name.
3015 optional string activity_name = 4;
3016}
3017
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003018message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003019 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003020 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003021
3022 // The app package name.
3023 optional string pkg_name = 2;
3024
3025 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003026 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003027 WITH_BUNDLE = 1;
3028 WITHOUT_BUNDLE = 2;
3029 }
3030 // The transition type.
3031 optional TransitionType type = 3;
3032
3033 // The activity name.
3034 optional string activity_name = 4;
3035
3036 optional bool transition_process_running = 5;
3037
3038 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003039 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003040}
3041
Bookatz8fcd09a2017-12-18 13:01:10 -08003042/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003043 * Logs a picture-in-picture action
3044 * Logged from:
3045 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3046 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3047 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3048 */
3049message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003050 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003051 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003052
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003053 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003054
Chenjie Yu52cacc62017-12-08 18:11:45 -08003055 enum State {
3056 ENTERED = 1;
3057 EXPANDED_TO_FULL_SCREEN = 2;
3058 MINIMIZED = 3;
3059 DISMISSED = 4;
3060 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003061 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003062}
3063
3064/**
Chenjie Yue8904192017-12-08 19:12:57 -08003065 * Logs overlay action
3066 * Logged from:
3067 * services/core/java/com/android/server/wm/Session.java
3068 */
3069message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003070 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003071
tsaichristine10978642019-09-10 14:12:49 -07003072 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003073
3074 optional bool using_alert_window = 3;
3075
3076 enum State {
3077 ENTERED = 1;
3078 EXITED = 2;
3079 }
tsaichristine10978642019-09-10 14:12:49 -07003080 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003081}
3082
Chenjie Yuccfe6452018-01-30 11:33:21 -08003083/*
3084 * Logs foreground service starts and stops.
3085 * Note that this is not when a service starts or stops, but when it is
3086 * considered foreground.
3087 * Logged from
3088 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3089 */
3090message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003091 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003092 // package_name + "/" + class_name
3093 optional string short_name = 2;
3094
3095 enum State {
3096 ENTER = 1;
3097 EXIT = 2;
3098 }
3099 optional State state = 3;
3100}
3101
Chenjie Yue8904192017-12-08 19:12:57 -08003102/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003103 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3104 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3105 * attributed back to the parent (host) uid. One example is Chrome.
3106 *
3107 * Logged from:
3108 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3109 */
3110message IsolatedUidChanged {
3111 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003112 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003113 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003114 optional int32 parent_uid = 1;
3115
3116 optional int32 isolated_uid = 2;
3117
3118 // We expect an isolated uid to be removed before if it's used for another parent uid.
3119 enum Event {
3120 REMOVED = 0;
3121 CREATED = 1;
3122 }
3123 optional Event event = 3;
3124}
3125
3126/*
3127 * Logs the reception of an incoming network packet causing the main system to wake up for
3128 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3129 * and processed by WakeupController.cpp.
3130 */
3131message PacketWakeupOccurred {
3132 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3133 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003134 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003135 // The interface name on which the packet was received.
3136 optional string iface = 2;
3137 // The ethertype value of the packet.
3138 optional int32 ethertype = 3;
3139 // String representation of the destination MAC address of the packet.
3140 optional string destination_hardware_address = 4;
3141 // String representation of the source address of the packet if this was an IP packet.
3142 optional string source_ip = 5;
3143 // String representation of the destination address of the packet if this was an IP packet.
3144 optional string destination_ip = 6;
3145 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3146 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3147 // families.
3148 optional int32 ip_next_header = 7;
3149 // The source port if this was a TCP or UDP packet.
3150 optional int32 source_port = 8;
3151 // The destination port if this was a TCP or UDP packet.
3152 optional int32 destination_port = 9;
3153}
3154
3155/*
3156 * Logs the memory stats for an app on startup.
3157 * Logged from:
3158 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3159 */
3160message AppStartMemoryStateCaptured {
3161 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003162 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003163
3164 // The process name.
3165 optional string process_name = 2;
3166
3167 // The activity name.
3168 optional string activity_name = 3;
3169
3170 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003171 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003172
3173 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003174 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003175
3176 // RSS
3177 optional int64 rss_in_bytes = 6;
3178
3179 // CACHE
3180 optional int64 cache_in_bytes = 7;
3181
3182 // SWAP
3183 optional int64 swap_in_bytes = 8;
3184}
3185
3186/*
3187 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3188 * for LMK event.
3189 * Logged from:
3190 * system/core/lmkd/lmkd.c
3191 */
3192message LmkStateChanged {
3193 enum State {
3194 UNKNOWN = 0;
3195 START = 1;
3196 STOP = 2;
3197 }
3198 optional State state = 1;
3199}
3200
3201/*
3202 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3203 * Logged from:
3204 * system/core/lmkd/lmkd.c
3205 */
3206message LmkKillOccurred {
3207 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003208 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003209
3210 // The process name.
3211 optional string process_name = 2;
3212
3213 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003214 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003215
3216 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003217 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003218
3219 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003220 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003221
3222 // RSS
3223 optional int64 rss_in_bytes = 6;
3224
3225 // CACHE
3226 optional int64 cache_in_bytes = 7;
3227
3228 // SWAP
3229 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003230
3231 // The elapsed real time of start of the process.
3232 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003233
3234 // Min oom adj score considered by lmkd.
3235 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003236}
3237
Rajeev Kumar51b54602018-03-01 12:18:26 -08003238/*
3239 * Logs when the ActivityManagerService detects that an app died.
3240 *
3241 * Logged from:
3242 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3243 */
3244message AppDied {
3245 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003246 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003247}
3248
Howard Ro21a039c2018-08-06 14:55:47 -07003249/**
3250 * An atom for generic metrics logging. Available from Android Q.
3251 */
3252message GenericAtom {
3253 // The uid of the application that sent this custom atom.
3254 optional int32 uid = 1 [(is_uid) = true];
3255
3256 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003257 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003258}
3259
Tej Singhd6d6d772018-09-05 17:41:25 -07003260/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003261 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003262 *
3263 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003264 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003265 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003266message BiometricAcquired {
3267 // Biometric modality that was acquired.
3268 optional android.hardware.biometrics.ModalityEnum modality = 1;
3269 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3270 optional int32 user = 2;
3271 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3272 optional bool is_crypto = 3;
3273 // Action that the device is performing. Acquired messages are only expected for enroll and
3274 // authenticate. Other actions may indicate an error.
3275 optional android.hardware.biometrics.ActionEnum action = 4;
3276 // The client that this acquisition was received for.
3277 optional android.hardware.biometrics.ClientEnum client = 5;
3278 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3279 optional int32 acquire_info = 6;
3280 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3281 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003282 // Dictates if this message should trigger additional debugging.
3283 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003284}
3285
3286/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003287 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003288 *
3289 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003290 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003291 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003292message BiometricAuthenticated {
3293 // Biometric modality that was used.
3294 optional android.hardware.biometrics.ModalityEnum modality = 1;
3295 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3296 optional int32 user = 2;
3297 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3298 // storage.
3299 optional bool is_crypto = 3;
3300 // The client that this acquisition was received for.
3301 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003302 // If authentication requires user confirmation. See BiometricPrompt's
3303 // setRequireConfirmation(bool) method.
3304 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003305
Kevin Chyn1741a072019-01-17 11:54:40 -08003306 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003307 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003308 REJECTED = 1;
3309 PENDING_CONFIRMATION = 2;
3310 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003311 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003312
3313 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003314 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003315 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3316 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3317 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3318 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003319 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003320 // Dictates if this message should trigger additional debugging.
3321 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003322}
3323
3324/**
3325 * Logs when a biometric error occurs.
3326 *
3327 * Logged from:
3328 * frameworks/base/services/core/java/com/android/server/biometrics
3329 */
3330message BiometricErrorOccurred {
3331 // Biometric modality that was used.
3332 optional android.hardware.biometrics.ModalityEnum modality = 1;
3333 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3334 optional int32 user = 2;
3335 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3336 optional bool is_crypto = 3;
3337 // Action that the device is performing.
3338 optional android.hardware.biometrics.ActionEnum action = 4;
3339 // The client that this acquisition was received for.
3340 optional android.hardware.biometrics.ClientEnum client = 5;
3341 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3342 // are unique to modality.
3343 optional int32 error_info = 6;
3344 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3345 // by the vendor and not specified by the HIDL interface.
3346 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003347 // Dictates if this message should trigger additional debugging.
3348 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003349 // Time spent during the authentication attempt.
3350 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003351}
3352
3353/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003354 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003355 * Logged from:
3356 * frameworks/base/services/core/java/com/android/server/biometrics
3357 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003358message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003359 // Biometric modality.
3360 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003361 // Type of issue detected.
3362 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003363 // Dictates if this message should trigger additional debugging.
3364 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003365}
Howard Ro688ae182018-09-25 00:09:36 -07003366
joshmccloskey6f952b22019-03-25 20:59:35 -07003367/**
3368 * Logs when a biometric enrollment occurs.
3369 *
3370 * Logged from:
3371 * frameworks/base/services/core/java/com/android/server/biometrics
3372 */
3373message BiometricEnrolled {
3374 // Biometric modality that was used.
3375 optional android.hardware.biometrics.ModalityEnum modality = 1;
3376 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3377 optional int32 user = 2;
3378 // The amount of time the enrollment took in milliseconds.
3379 optional int64 latency_millis = 3;
3380 // Whether or not the enrollment was successful.
3381 optional bool success = 4;
3382}
3383
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003384/*
Tej Singh0d176952019-01-16 19:10:54 -08003385 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003386 */
Tej Singh0d176952019-01-16 19:10:54 -08003387message FlagFlipUpdateOccurred {
3388 // If the event is from a flag config package, specify the package name.
3389 optional string flag_flip_package_name = 1;
3390
3391 // The order id of the package
3392 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003393}
3394
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003395/**
3396 * Potential experiment ids that goes with a train install.
3397 */
3398message TrainExperimentIds {
3399 repeated int64 experiment_id = 1;
3400}
3401
Yangster-macb89807e2018-11-15 21:10:57 -08003402/*
3403 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003404 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003405 */
3406message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003407 // Name of the train.
3408 optional string train_name = 1;
3409 // Version code for a "train" of packages that need to be installed atomically
3410 optional int64 train_version_code = 2;
3411 // After installation of this package, device requires a restart.
3412 optional bool requires_staging = 3;
3413 // Rollback should be enabled for this install.
3414 optional bool rollback_enabled = 4;
3415 // Requires low latency monitoring if possible.
3416 optional bool requires_low_latency_monitor = 5;
3417
Yangster-macb89807e2018-11-15 21:10:57 -08003418 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003419 UNKNOWN = 0;
3420 INSTALL_REQUESTED = 1;
3421 INSTALL_STARTED = 2;
3422 INSTALL_STAGED_NOT_READY = 3;
3423 INSTALL_STAGED_READY = 4;
3424 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003425 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3426 // and INSTALL_FAILURE_COMMIT.
3427 INSTALL_FAILURE = 6 [deprecated = true];
3428 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003429 INSTALL_CANCELLED = 7;
3430 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003431 INSTALLER_ROLLBACK_INITIATED = 9;
3432 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3433 INSTALLER_ROLLBACK_STAGED = 11;
3434 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3435 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3436 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3437 INSTALLER_ROLLBACK_SUCCESS = 15;
3438 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003439 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3440 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3441 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3442 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3443 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3444 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003445 INSTALL_FAILURE_DOWNLOAD = 23;
3446 INSTALL_FAILURE_STATE_MISMATCH = 24;
3447 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003448 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003449 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003450 // Possible experiment ids for monitoring this push.
3451 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3452 // user id
3453 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003454}
3455
Tej Singhc9203082019-05-03 13:42:23 -07003456/* Test atom, is not logged anywhere */
3457message TestAtomReported {
3458 repeated AttributionNode attribution_node = 1;
3459 optional int32 int_field = 2;
3460 optional int64 long_field = 3;
3461 optional float float_field = 4;
3462 optional string string_field = 5;
3463 optional bool boolean_field = 6;
3464 enum State {
3465 UNKNOWN = 0;
3466 OFF = 1;
3467 ON = 2;
3468 }
3469 optional State state = 7;
3470 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3471}
3472
Maggie Whitefc1aa592018-11-28 21:55:23 -08003473/** Represents USB port overheat event. */
3474message UsbPortOverheatEvent {
3475 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3476 optional int32 plug_temperature_deci_c = 1;
3477
3478 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3479 optional int32 max_temperature_deci_c = 2;
3480
3481 /* Time between USB plug event and overheat threshold trip, in seconds. */
3482 optional int32 time_to_overheat_secs = 3;
3483
3484 /* Time between overheat threshold trip and hysteresis, in seconds. */
3485 optional int32 time_to_hysteresis_secs = 4;
3486
3487 /* Time between hysteresis and active mitigation ending, in seconds. */
3488 optional int32 time_to_inactive_secs = 5;
3489};
3490
Maggie White8735b852019-01-18 11:40:49 -08003491/**
3492 * Logs total effective full charge and discharge cycles on a battery.
3493 * Here are some examples of one effective cycle:
3494 * 1) the battery charges from 0% to 100% and drains back to 0%,
3495 * 2) charging from 50% to 100% and draining back to 50% twice.
3496 * Pulled from:
3497 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3498 */
3499message BatteryCycleCount {
3500 /* Number of total charge and discharge cycles on the system battery. */
3501 optional int32 cycle_count = 1;
3502}
3503
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003504/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003505 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3506 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003507 * Pulled from:
3508 * StatsCompanionService
3509 */
3510
Carmen Agimof12dec122019-03-06 16:14:38 +00003511message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003512
Carmen Agimof12dec122019-03-06 16:14:38 +00003513 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003514 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003515 PUBLIC = 1;
3516 PRIVATE = 2;
3517 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003518 }
3519
Carmen Agimof12dec122019-03-06 16:14:38 +00003520 // The type of external storage.
3521 optional android.stats.storage.ExternalStorageType storage_type = 1;
3522 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3523 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003524 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003525 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003526}
3527
Yangster-macb89807e2018-11-15 21:10:57 -08003528/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003529 * Logs when a connection becomes available and lost.
3530 * Logged in StatsCompanionService.java
3531 */
3532message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003533 // Id of the network.
3534 optional int32 net_id = 1;
3535
3536 enum State {
3537 UNKNOWN = 0;
3538 CONNECTED = 1;
3539 DISCONNECTED = 2;
3540 }
3541 // Connected state of a network.
3542 optional State state = 2;
3543}
3544
3545/**
3546 * Logs when a service starts and stops.
3547 * Logged from:
3548 * services/core/java/com/android/server/am/ActiveServices.java
3549 */
3550message ServiceStateChanged {
3551
3552 optional int32 uid = 1 [(is_uid) = true];
3553
3554 optional string package_name = 2;
3555
3556 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003557
3558 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003559 START = 1;
3560 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003561 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003562
3563 optional State state = 4;
3564}
3565
3566/**
3567 * Logs when a service is launched.
3568 * Logged from:
3569 * services/core/java/com/android/server/am/ActiveServices.java
3570 */
3571message ServiceLaunchReported {
3572
3573 optional int32 uid = 1 [(is_uid) = true];
3574
3575 optional string package_name = 2;
3576
3577 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003578}
Howard Ro688ae182018-09-25 00:09:36 -07003579
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003580/**
3581 * Logs when a hidden API is used.
3582 *
3583 * Logged from:
3584 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3585 */
3586message HiddenApiUsed {
3587 // The uid of the app making the hidden access.
3588 optional int32 uid = 1 [(is_uid) = true];
3589
3590 // Signature of the method or field accessed.
3591 optional string signature = 2;
3592
3593 enum AccessMethod {
3594 NONE = 0;
3595 REFLECTION = 1;
3596 JNI = 2;
3597 LINKING = 3;
3598 }
3599
3600 // Type of access.
3601 optional AccessMethod access_method = 3;
3602
3603 // Whether the access was prevented or not.
3604 optional bool access_denied = 4;
3605}
3606
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003607/**
3608 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3609 * - When user sees privacy chip
3610 * - When user clicks privacy chip
3611 * - How does the user exit the Privacy Dialog
3612 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003613 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3614 */
3615message PrivacyIndicatorsInteracted {
3616
3617 enum Type {
3618 UNKNOWN = 0;
3619 CHIP_VIEWED = 1;
3620 CHIP_CLICKED = 2;
3621 DIALOG_PRIVACY_SETTINGS = 3;
3622 DIALOG_DISMISS = 4;
3623 DIALOG_LINE_ITEM = 5;
3624 }
3625
3626 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3627
3628 // Used if the type is LINE_ITEM
3629 optional string package_name = 2;
3630}
3631
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003632/**
3633 * Logs information about a package that is moved from the internal to external storage and vice
3634 * versa.
3635 * It logs the package name, the type of the external storage where the package is installed
3636 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3637 * and the move type: if it's from internal to external or the other way around.
3638 *
3639 * Logged from:
3640 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3641 */
3642message AppMovedStorageReported {
3643 enum MoveType {
3644 UNKNOWN = 0;
3645 TO_EXTERNAL = 1;
3646 TO_INTERNAL = 2;
3647 }
3648 // The type of the external storage.
3649 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3650 // The type of move.
3651 optional MoveType move_type = 2;
3652 // The name of the package that was moved.
3653 optional string package_name = 3;
3654}
3655
jianjin8f2dee02019-03-29 14:03:08 -07003656/**
3657 * Logs when system server watchdog occurs.
3658 * Logged from:
3659 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3660 */
3661message SystemServerWatchdogOccurred {
3662 optional string subject = 1;
3663}
3664
3665/**
3666 * Logs when new file added to tombstones.
3667 * Logged from:
3668 * frameworks/base/core/java/com/android/server/BootReceiver.java
3669 */
3670message TombStoneOccurred {
3671}
3672
Hai Zhang5d3328d2019-04-13 21:25:06 +08003673/*
3674 * Information about a role request
3675 *
3676 * Logged from:
3677 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3678 */
3679message RoleRequestResultReported {
3680 // UID of application requesting the role
3681 optional int32 requesting_uid = 1;
3682
3683 // Package name of application requesting the role
3684 optional string requesting_package_name = 2;
3685
3686 // The role to be granted
3687 optional string role_name = 3;
3688
3689 // The count of applications qualifying for the role
3690 optional int32 qualifying_count = 4;
3691
3692 // UID of application current granted the role
3693 optional int32 current_uid = 5;
3694
3695 // Package name of application current granted the role
3696 optional string current_package_name = 6;
3697
3698 // UID of another application that user chose to grant the role to, instead of the requesting
3699 // application
3700 optional int32 granted_another_uid = 7;
3701
3702 // Package name of another application that user chose to grant the role to, instead of the
3703 // requesting application
3704 optional string granted_another_package_name = 8;
3705
3706 enum Result {
3707 UNDEFINED = 0;
3708 // role request was ignored
3709 IGNORED = 1;
3710 // role request was ignored because it's already granted
3711 IGNORED_ALREADY_GRANTED = 2;
3712 // role request was ignored because the application isn't qualified
3713 IGNORED_NOT_QUALIFIED = 3;
3714 // role request was ignored because user said it should be always denied
3715 IGNORED_USER_ALWAYS_DENIED = 4;
3716 // role was granted by user action
3717 USER_GRANTED = 5;
3718 // role was denied by user action
3719 USER_DENIED = 6;
3720 // role was denied by user granting another application the role
3721 USER_DENIED_GRANTED_ANOTHER = 7;
3722 // role was denied and set to be always denied by the user
3723 USER_DENIED_WITH_ALWAYS = 8;
3724 }
3725 // The result of the role request
3726 optional Result result = 9;
3727}
3728
Chenjie Yubbcbc602018-02-05 16:51:52 -08003729//////////////////////////////////////////////////////////////////////
3730// Pulled atoms below this line //
3731//////////////////////////////////////////////////////////////////////
3732
3733/**
David Chenc8a43242017-10-17 16:23:28 -07003734 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3735 *
3736 * Pulled from:
3737 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3738 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003739message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003740 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003741
3742 optional int64 rx_bytes = 2;
3743
3744 optional int64 rx_packets = 3;
3745
3746 optional int64 tx_bytes = 4;
3747
3748 optional int64 tx_packets = 5;
3749}
3750
3751/**
3752 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3753 *
3754 * Pulled from:
3755 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3756 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003757message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003758 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003759
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003760 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3761 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003762
3763 optional int64 rx_bytes = 3;
3764
3765 optional int64 rx_packets = 4;
3766
3767 optional int64 tx_bytes = 5;
3768
3769 optional int64 tx_packets = 6;
3770}
3771
3772/**
3773 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3774 *
3775 * Pulled from:
3776 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3777 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003778message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003779 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003780
3781 optional int64 rx_bytes = 2;
3782
3783 optional int64 rx_packets = 3;
3784
3785 optional int64 tx_bytes = 4;
3786
3787 optional int64 tx_packets = 5;
3788}
3789
3790/**
3791 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3792 *
3793 * Pulled from:
3794 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3795 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003796message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003797 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003798
Yao Chenc40a19d2018-03-15 16:48:25 -07003799 // 1 denotes foreground and 0 denotes background. This is called Set in
3800 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003801 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003802
3803 optional int64 rx_bytes = 3;
3804
3805 optional int64 rx_packets = 4;
3806
3807 optional int64 tx_bytes = 5;
3808
3809 optional int64 tx_packets = 6;
3810}
3811
3812/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003813 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3814 *
3815 * Pulled from:
3816 * StatsCompanionService
3817 */
3818message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003819 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003820
3821 optional int64 rx_bytes = 2;
3822
3823 optional int64 tx_bytes = 3;
3824}
3825
3826/**
David Chenc8a43242017-10-17 16:23:28 -07003827 * Pulls the kernel wakelock durations. This atom is adapted from
3828 * android/internal/os/KernelWakelockStats.java
3829 *
3830 * Pulled from:
3831 * StatsCompanionService using KernelWakelockReader.
3832 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003833message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003834 optional string name = 1;
3835
3836 optional int32 count = 2;
3837
3838 optional int32 version = 3;
3839
Yangster-maca8a30442018-10-13 23:46:34 -07003840 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003841}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003842
Chenjie Yu05013b32017-11-21 10:21:41 -08003843/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003844 * Pulls low power state information. If power.stats HAL is not available, this
3845 * includes platform and subsystem sleep state information,
3846 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3847 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003848 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003849 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003850 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3851 * as defined in:
3852 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003853 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003854message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003855 // Subsystem name
3856 optional string subsystem_name = 1;
3857 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3858 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003859 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3860 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003861 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003862 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003863 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003864 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003865 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003866}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003867
Chenjie Yu05013b32017-11-21 10:21:41 -08003868/**
Bookatz92da2832018-11-01 18:10:03 -07003869 * Pulls on-device power measurement information.
3870 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3871 * Pulled from:
3872 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3873 */
3874message OnDevicePowerMeasurement {
3875 // Name of the subsystem (to which the rail belongs).
3876 optional string subsystem_name = 1;
3877
3878 // Rail name. The rail lies within the subsystem.
3879 optional string rail_name = 2;
3880
3881 // Time (in ms since boot) at which the rail energy value was measured.
3882 // This may differ slightly from the time that statsd logs this information.
3883 optional uint64 measurement_timestamp_millis = 3;
3884
3885 // Accumulated energy used via the rail since device boot in uWs.
3886 optional uint64 energy_microwatt_secs = 4;
3887}
3888
3889/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003890 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003891 * Pulls the time the cpu spend on the frequency index. Frequency index
3892 * starts from highest to lowest. The value should be monotonically
3893 * increasing since boot. However, if there is a cpu
3894 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003895 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003896message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003897 optional uint32 cluster = 1;
3898 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003899 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003900}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003901
Chenjie Yu05013b32017-11-21 10:21:41 -08003902/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003903 * Pulls Cpu Time Per Uid.
3904 * Note that isolated process uid time should be attributed to host uids.
3905 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003906message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003907 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003908 optional uint64 user_time_micros = 2;
3909 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003910}
3911
3912/**
3913 * Pulls Cpu Time Per Uid per frequency.
3914 * Note that isolated process uid time should be attributed to host uids.
3915 * For each uid, we order the time by descending frequencies.
3916 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003917message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003918 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003919 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003920 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003921}
Hugo Benichi884970e2017-11-14 22:42:46 +09003922
Chenjie Yu05013b32017-11-21 10:21:41 -08003923/**
3924 * Pulls Wifi Controller Activity Energy Info
3925 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003926message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003927 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003928 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003929 // stack reported state
3930 // TODO: replace this with proto enum
3931 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003932 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003933 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003934 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003935 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003936 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003937 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003938 // product of current(mA), voltage(V) and time(ms)
3939 optional uint64 controller_energy_used = 6;
3940}
3941
3942/**
3943 * Pulls Modem Activity Energy Info
3944 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003945message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003946 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003947 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003948 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003949 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003950 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003951 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003952 /**
3953 * Tx power index
3954 * index 0 = tx_power < 0dBm
3955 * index 1 = 0dBm < tx_power < 5dBm
3956 * index 2 = 5dBm < tx_power < 15dBm
3957 * index 3 = 15dBm < tx_power < 20dBm
3958 * index 4 = tx_power > 20dBm
3959 */
3960 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003961 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003962 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003963 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003964 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003965 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003966 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003967 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003968 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003969 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003970 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003971 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003972 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07003973 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08003974}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003975
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003976/**
3977 * Pulls Bluetooth Activity Energy Info
3978 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3979 */
3980message BluetoothActivityInfo {
3981 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003982 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003983 // bluetooth stack state
3984 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003985 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003986 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003987 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003988 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003989 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003990 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003991 // product of current(mA), voltage(V) and time(ms)
3992 optional uint64 energy_used = 6;
3993}
3994
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003995/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003996 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003997 *
3998 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003999 */
4000message ProcessMemoryState {
4001 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004002 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004003
4004 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004005 // Usually package name, "system" for system server.
4006 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004007 optional string process_name = 2;
4008
Rafal Slawikda51b932018-12-13 16:31:33 +00004009 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004010 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004011
4012 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004013 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004014
4015 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004016 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004017
Rajeev Kumar90235992018-01-29 11:06:48 -08004018 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004019 // Value is read from /proc/PID/status. Or from memory.stat, field
Rafal Slawikda51b932018-12-13 16:31:33 +00004020 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08004021 optional int64 rss_in_bytes = 6;
4022
4023 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004024 // Value is read from memory.stat, field total_cache if per-app memory
4025 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004026 optional int64 cache_in_bytes = 7;
4027
4028 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004029 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01004030 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08004031 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004032
Rafal Slawikd03ae422018-11-20 11:27:45 +00004033 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004034 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004035
4036 // Elapsed real time when the process started.
4037 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
4038 optional int64 start_time_nanos = 10;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004039
4040 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4041 optional int32 anon_rss_and_swap_in_kilobytes = 11;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004042}
4043
4044/*
Rafal Slawik08621582018-10-15 14:53:07 +01004045 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00004046 *
4047 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01004048 */
4049message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01004050 // The uid if available. -1 means not available.
4051 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004052
Rafal Slawikbf67d072018-10-23 11:07:54 +01004053 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004054 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004055 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01004056
Rafal Slawikbf67d072018-10-23 11:07:54 +01004057 // # of page-faults
4058 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01004059
Rafal Slawikbf67d072018-10-23 11:07:54 +01004060 // # of major page-faults
4061 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01004062
Rafal Slawikbf67d072018-10-23 11:07:54 +01004063 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004064 // Value read from /proc/PID/status.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004065 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01004066
Rafal Slawikd03ae422018-11-20 11:27:45 +00004067 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004068 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01004069
4070 // Elapsed real time when the process started.
4071 // Value is read from /proc/PID/stat, field 22.
4072 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004073
4074 // SWAP
4075 // Value read from /proc/PID/status, field VmSwap.
4076 optional int64 swap_in_bytes = 8;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004077
4078 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4079 optional int32 anon_rss_and_swap_in_kilobytes = 9;
Rafal Slawik08621582018-10-15 14:53:07 +01004080}
4081
4082/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004083 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004084 *
4085 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4086 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004087 *
4088 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004089 */
4090message ProcessMemoryHighWaterMark {
4091 // The uid if available. -1 means not available.
4092 optional int32 uid = 1 [(is_uid) = true];
4093
Rafal Slawikda51b932018-12-13 16:31:33 +00004094 // The process name.
4095 // Usually package name or process cmdline.
4096 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004097 optional string process_name = 2;
4098
Rafal Slawik239b6802019-09-09 18:46:01 +01004099 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4100 // computed by converting kilobytes to bytes.
4101 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4102
Rafal Slawik3bea8952018-11-15 12:39:33 +00004103 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4104 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004105 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004106}
4107
4108/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004109 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004110 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004111message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004112 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004113}
4114
4115/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004116 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004117 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004118message SystemUptime {
4119 // Milliseconds since the system was booted.
4120 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4121 // for external input).
4122 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004123 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004124}
4125
4126/*
4127 * Reads from /proc/uid_concurrent_active_time which has the format:
4128 * active: X (X is # cores)
4129 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4130 * [uid1]: [time-0] [time-1] [time-2] ... ...
4131 * ...
4132 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4133 * The file contains a monotonically increasing count of time for a single boot.
4134 */
4135message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004136 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004137 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004138}
4139
4140/**
4141 * Reads from /proc/uid_concurrent_policy_time which has the format:
4142 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4143 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4144 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4145 * ...
4146 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4147 * The file contains a monotonically increasing count of time for a single boot.
4148 */
4149message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004150 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004151 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004152 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004153}
4154
4155/*
4156 * Pulls free disk space, for data, system partition and temporary directory.
4157 */
4158message DiskSpace {
4159 // available bytes in data partition
4160 optional uint64 data_available_bytes = 1;
4161 // available bytes in system partition
4162 optional uint64 system_available_bytes = 2;
4163 // available bytes in download cache or temp directories
4164 optional uint64 temp_available_bytes = 3;
4165}
Tej Singhbf972d92018-01-10 20:51:13 -08004166
4167/**
4168 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004169 *
4170 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004171 */
4172message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004173 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004174}
4175
4176/**
4177 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004178 * Pulled from:
4179 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004180 */
4181message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004182 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004183}
4184
4185/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004186 * Pulls battery voltage.
4187 * Pulled from:
4188 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4189 */
4190message BatteryVoltage {
4191 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004192 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004193}
4194
4195/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004196 * Pulls battery level (percent full, from 0 to 100).
4197 *
4198 * Pulled from:
4199 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4200 */
4201message BatteryLevel {
4202 // Battery level. Should be in [0, 100].
4203 optional int32 battery_level = 1;
4204}
4205
4206/**
Tej Singhd89137e2018-03-26 14:51:40 -07004207 * Pulls the temperature of various parts of the device.
4208 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004209 *
Maggie White442b6312019-04-05 16:26:44 -07004210 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004211 */
4212message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004213 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004214 optional android.os.TemperatureTypeEnum sensor_location = 1;
4215
4216 // The name of the temperature source. Eg. CPU0
4217 optional string sensor_name = 2;
4218
Tej Singhd89137e2018-03-26 14:51:40 -07004219 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004220 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004221 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004222
4223 // Relative severity of the throttling, see enum definition.
4224 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004225}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004226
4227/**
4228 * Pulls the statistics of calls to Binder.
4229 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004230 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4231 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004232 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004233 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004234 */
4235message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004236 // UID of the process responsible for the binder transaction. It will be set if the process
4237 // executing the binder transaction attribute the transaction to another uid using
4238 // Binder.setThreadWorkSource().
4239 //
4240 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004241 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004242 // UID of the process executing the binder transaction.
4243 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004244 // Fully qualified class name of the API call.
4245 //
4246 // This is a system server class name.
4247 //
4248 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4249 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4250 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4251 // commonly used APIs.
4252 optional string service_class_name = 2;
4253 // Method name of the API call. It can also be a transaction code if we cannot
4254 // resolve it to a name. See Binder#getTransactionName.
4255 //
4256 // This is a system server method name.
4257 optional string service_method_name = 3;
4258 // Total number of API calls.
4259 optional int64 call_count = 4;
4260 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4261 optional bool screen_interactive = 13;
4262 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4263 // call_count will be equal to recorded_call_count.
4264 //
4265 // If recorded_call_count is different than call_count, it means data collection has been
4266 // sampled. All the fields below will be sampled in this case.
4267 optional int64 recorded_call_count = 12;
4268 // Number of exceptions thrown by the API.
4269 optional int64 recorded_exception_count = 5;
4270 // Total latency of all API calls.
4271 // Average can be computed using total_latency_micros / recorded_call_count.
4272 optional int64 recorded_total_latency_micros = 6;
4273 // Maximum latency of one API call.
4274 optional int64 recorded_max_latency_micros = 7;
4275 // Total CPU usage of all API calls.
4276 // Average can be computed using total_cpu_micros / recorded_call_count.
4277 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4278 optional int64 recorded_total_cpu_micros = 8;
4279 // Maximum CPU usage of one API call.
4280 optional int64 recorded_max_cpu_micros = 9;
4281 // Maximum parcel reply size of one API call.
4282 optional int64 recorded_max_reply_size_bytes = 10;
4283 // Maximum parcel request size of one API call.
4284 optional int64 recorded_max_request_size_bytes = 11;
4285}
4286
4287/**
4288 * Pulls the statistics of exceptions during calls to Binder.
4289 *
4290 * Binder stats are cumulative from boot unless somebody reset the data using
4291 * > adb shell dumpsys binder_calls_stats --reset
4292 */
4293message BinderCallsExceptions {
4294 // Exception class name, e.g. java.lang.IllegalArgumentException.
4295 //
4296 // This is an exception class name thrown by the system server.
4297 optional string exception_class_name = 1;
4298 // Total number of exceptions.
4299 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004300}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004301
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004302/**
4303 * Pulls the statistics of message dispatching on HandlerThreads.
4304 *
4305 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4306 * config on the device.
4307 *
4308 * Next tag: 11
4309 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004310message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004311 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004312 optional int32 uid = 1 [(is_uid) = true];
4313
4314 // Fully qualified class name of the handler target class.
4315 //
4316 // This field does not contain PII. This is a system server class name.
4317 optional string handler_class_name = 2;
4318
4319 // The name of the thread that runs the Looper.
4320 //
4321 // This field does not contain PII. This is a system server thread name.
4322 optional string looper_thread_name = 3;
4323
4324 // The name of the dispatched message.
4325 //
4326 // This field does not contain PII. This is a system server constant or class
4327 // name.
4328 optional string message_name = 4;
4329
4330 // Total number of successfully dispatched messages.
4331 optional int64 message_count = 5;
4332
4333 // Total number of messages that failed dispatching.
4334 optional int64 exception_count = 6;
4335
4336 // Total number of processed messages we have data recorded for. If we
4337 // collected data for all the messages, message_count will be equal to
4338 // recorded_message_count.
4339 //
4340 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004341 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004342 optional int64 recorded_message_count = 7;
4343
4344 // Total latency of all processed messages.
4345 // Average can be computed using recorded_total_latency_micros /
4346 // recorded_message_count.
4347 optional int64 recorded_total_latency_micros = 8;
4348
4349 // Total CPU usage of all processed message.
4350 // Average can be computed using recorded_total_cpu_micros /
4351 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004352 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004353 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004354
4355 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4356 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004357
4358 // Max recorded CPU usage of all processed messages.
4359 optional int64 recorded_max_cpu_micros = 11;
4360
4361 // Max recorded latency of all processed messages.
4362 optional int64 recorded_max_latency_micros = 12;
4363
4364 // Total number of messages we tracked the dispatching delay for. If we
4365 // collected data for all the messages, message_count will be equal to
4366 // recorded_delay_message_count.
4367 //
4368 // If recorded_delay_message_count is different than message_count, it means data
4369 // collection has been sampled or/and not all messages specified the target dispatch time.
4370 // The fields below will be sampled in this case.
4371 optional int64 recorded_delay_message_count = 13;
4372
4373 // Total dispatching delay of all processed messages.
4374 // Calculated as a difference between the target dispatching time (Message.when)
4375 // and the actual dispatching time.
4376 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4377 optional int64 recorded_total_delay_millis = 14;
4378
4379 // Max dispatching delay of all processed messages.
4380 // Calculated as a difference between the target dispatching time (Message.when)
4381 // and the actual dispatching time.
4382 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004383}
Tej Singh86dc9db2018-09-06 00:39:57 +00004384
4385/**
4386 * Pulls disk information, such as write speed and latency.
4387 */
4388message DiskStats {
4389 // Time taken to open, write 512B to, and close a file.
4390 // -1 if error performing the check.
4391 optional int64 data_write_latency_millis = 1;
4392
4393 optional bool file_based_encryption = 2;
4394
4395 // Recent disk write speed in kB/s.
4396 // -1 if error querying storageed.
4397 // 0 if data is unavailable.
4398 optional int32 recent_disk_write_speed = 3;
4399}
4400
4401
4402/**
4403 * Free and total bytes of the Data, Cache, and System partition.
4404 */
4405message DirectoryUsage {
4406 enum Directory {
4407 UNKNOWN = 0;
4408 DATA = 1;
4409 CACHE = 2;
4410 SYSTEM = 3;
4411 }
4412 optional Directory directory = 1;
4413 optional int64 free_bytes = 2;
4414 optional int64 total_bytes = 3;
4415}
4416
4417
4418/**
4419 * Size of an application: apk size, data size, and cache size.
4420 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4421 * Information is only reported for apps with the primary user (user 0).
4422 * Sizes are aggregated by package name.
4423 */
4424message AppSize {
4425 // Including uids will involve modifying diskstats logic.
4426 optional string package_name = 1;
4427 // App size in bytes. -1 if unavailable.
4428 optional int64 app_size_bytes = 2;
4429 // App data size in bytes. -1 if unavailable.
4430 optional int64 app_data_size_bytes = 3;
4431 // App cache size in bytes. -1 if unavailable.
4432 optional int64 app_cache_size_bytes = 4;
4433 // Time that the cache file was produced.
4434 // Uses System.currentTimeMillis(), which is wall clock time.
4435 optional int64 cache_time_millis = 5;
4436}
4437
4438
4439/**
4440 * Size of a particular category. Eg: photos, videos.
4441 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4442 */
4443message CategorySize {
4444 enum Category {
4445 UNKNOWN = 0;
4446 APP_SIZE = 1;
4447 APP_DATA_SIZE = 2;
4448 APP_CACHE_SIZE = 3;
4449 PHOTOS = 4;
4450 VIDEOS = 5;
4451 AUDIO = 6;
4452 DOWNLOADS = 7;
4453 SYSTEM = 8;
4454 OTHER = 9;
4455 }
4456 optional Category category = 1;
4457 // Category size in bytes.
4458 optional int64 size_bytes = 2;
4459 // Time that the cache file was produced.
4460 // Uses System.currentTimeMillis(), which is wall clock time.
4461 optional int64 cache_time_millis = 3;
4462}
Tej Singhd6d6d772018-09-05 17:41:25 -07004463
4464/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004465 * Pulls per uid I/O stats. The stats are cumulative since boot.
4466 *
4467 * Read/write bytes are I/O events from a storage device
4468 * Read/write chars are data requested by read/write syscalls, and can be
4469 * satisfied by caching.
4470 *
4471 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4472 */
4473message DiskIo {
4474 optional int32 uid = 1 [(is_uid) = true];
4475 optional int64 fg_chars_read = 2;
4476 optional int64 fg_chars_write = 3;
4477 optional int64 fg_bytes_read = 4;
4478 optional int64 fg_bytes_write = 5;
4479 optional int64 bg_chars_read = 6;
4480 optional int64 bg_chars_write = 7;
4481 optional int64 bg_bytes_read = 8;
4482 optional int64 bg_bytes_write = 9;
4483 optional int64 fg_fsync = 10;
4484 optional int64 bg_fsync= 11;
4485}
4486
4487
4488/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004489 * Pulls the number of fingerprints for each user.
4490 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004491 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004492 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004493message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004494 // The associated user. Eg: 0 for owners, 10+ for others.
4495 // Defined in android/os/UserHandle.java
4496 optional int32 user = 1;
4497 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004498 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004499}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004500
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004501/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004502 * Pulls the number of faces for each user.
4503 *
4504 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4505 */
4506message NumFacesEnrolled {
4507 // The associated user. Eg: 0 for owners, 10+ for others.
4508 // Defined in android/os/UserHandle.java
4509 optional int32 user = 1;
4510 // Number of faces registered to that user.
4511 optional int32 num_faces_enrolled = 2;
4512}
4513/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004514 * A mapping of role holder -> role
4515 */
4516message RoleHolder {
4517 // uid of the role holder
4518 optional int32 uid = 1 [(is_uid) = true];
4519
4520 // package name of the role holder
4521 optional string package_name = 2;
4522
4523 // the role held
4524 optional string role = 3;
4525}
4526
Yangsteraf9aee72018-10-12 09:26:16 -07004527message AggStats {
4528 optional int64 min = 1;
4529
4530 optional int64 average = 2;
4531
4532 optional int64 max = 3;
4533}
4534
4535message ProcessStatsStateProto {
4536 optional android.service.procstats.ScreenState screen_state = 1;
4537
4538 optional android.service.procstats.MemoryState memory_state = 2;
4539
4540 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4541 // and not frameworks/base/core/java/android/app/ActivityManager.java
4542 optional android.service.procstats.ProcessState process_state = 3;
4543
4544 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004545 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004546
4547 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004548 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004549
4550 // # of samples taken
4551 optional int32 sample_size = 5;
4552
4553 // PSS is memory reserved for this process
4554 optional AggStats pss = 6;
4555
4556 // USS is memory shared between processes, divided evenly for accounting
4557 optional AggStats uss = 7;
4558
4559 // RSS is memory resident for this process
4560 optional AggStats rss = 8;
4561}
4562
4563// Next Tag: 7
4564message ProcessStatsProto {
4565 // Name of process.
4566 optional string process = 1;
4567
4568 // Uid of the process.
4569 optional int32 uid = 2;
4570
4571 // Information about how often kills occurred
4572 message Kill {
4573 // Count of excessive CPU kills
4574 optional int32 cpu = 1;
4575
4576 // Count of kills when cached
4577 optional int32 cached = 2;
4578
4579 // PSS stats during cached kill
4580 optional AggStats cached_pss = 3;
4581 }
4582 optional Kill kill = 3;
4583
4584 // Time and memory spent in various states.
4585 repeated ProcessStatsStateProto states = 5;
4586
4587 // Total time process has been running... screen_state, memory_state, and process_state
4588 // will not be set.
4589 optional ProcessStatsStateProto total_running_state = 6;
4590}
4591
4592message PackageServiceOperationStatsProto {
4593 // Operate enum: Started, Foreground, Bound, Executing
4594 optional android.service.procstats.ServiceOperationState operation = 1;
4595
4596 // Number of times the service was in this operation.
4597 optional int32 count = 2;
4598
4599 // Information about a state the service can be in.
4600 message StateStats {
4601 // Screen state enum.
4602 optional android.service.procstats.ScreenState screen_state = 1;
4603 // Memory state enum.
4604 optional android.service.procstats.MemoryState memory_state = 2;
4605
4606 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004607 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004608 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004609 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004610 }
4611 repeated StateStats state_stats = 3;
4612}
4613
4614message PackageServiceStatsProto {
4615 // Name of service component.
4616 optional string service_name = 1;
4617
4618 // The operation stats.
4619 // The package_name, package_uid, package_version, service_name will not be set to save space.
4620 repeated PackageServiceOperationStatsProto operation_stats = 2;
4621}
4622
4623message PackageAssociationSourceProcessStatsProto {
4624 // Uid of the process.
4625 optional int32 process_uid = 1;
4626 // Process name.
4627 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004628 // Package name.
4629 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004630 // Total count of the times this association appeared.
4631 optional int32 total_count = 3;
4632
4633 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004634 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004635
4636 // Total count of the times this association became actively impacting its target process.
4637 optional int32 active_count = 5;
4638
4639 // Information on one source in this association.
4640 message StateStats {
4641 // Process state enum.
4642 optional android.service.procstats.ProcessState process_state = 1;
4643 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004644 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004645 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004646 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004647 }
4648 repeated StateStats active_state_stats = 6;
4649}
4650
4651message PackageAssociationProcessStatsProto {
4652 // Name of the target component.
4653 optional string component_name = 1;
4654 // Information on one source in this association.
4655 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4656}
4657
4658
4659message ProcessStatsPackageProto {
4660 // Name of package.
4661 optional string package = 1;
4662
4663 // Uid of the package.
4664 optional int32 uid = 2;
4665
4666 // Version of the package.
4667 optional int64 version = 3;
4668
4669 // Stats for each process running with the package loaded in to it.
4670 repeated ProcessStatsProto process_stats = 4;
4671
4672 // Stats for each of the package's services.
4673 repeated PackageServiceStatsProto service_stats = 5;
4674
4675 // Stats for each association with the package.
4676 repeated PackageAssociationProcessStatsProto association_stats = 6;
4677}
4678
4679message ProcessStatsSectionProto {
4680 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004681 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004682
4683 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004684 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004685
4686 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004687 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004688
4689 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004690 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004691
4692 // System runtime library. e.g. "libdvm.so", "libart.so".
4693 optional string runtime = 5;
4694
4695 // whether kernel reports swapped pss.
4696 optional bool has_swapped_pss = 6;
4697
4698 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4699 enum Status {
4700 STATUS_UNKNOWN = 0;
4701 STATUS_COMPLETE = 1;
4702 STATUS_PARTIAL = 2;
4703 STATUS_SHUTDOWN = 3;
4704 STATUS_SYSPROPS = 4;
4705 }
4706 repeated Status status = 7;
4707
Chenjie Yub2ecc792019-01-17 10:27:26 -08004708 // Number of pages available of various types and sizes, representation fragmentation.
4709 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4710
Yangsteraf9aee72018-10-12 09:26:16 -07004711 // Stats for each process.
4712 repeated ProcessStatsProto process_stats = 8;
4713
4714 // Stats for each package.
4715 repeated ProcessStatsPackageProto package_stats = 9;
4716}
4717
Chenjie Yub2ecc792019-01-17 10:27:26 -08004718message ProcessStatsAvailablePagesProto {
4719 // Node these pages are in (as per /proc/pagetypeinfo)
4720 optional int32 node = 1;
4721
4722 // Zone these pages are in (as per /proc/pagetypeinfo)
4723 optional string zone = 2;
4724
4725 // Label for the type of these pages (as per /proc/pagetypeinfo)
4726 optional string label = 3;
4727
4728 // Distribution of number of pages available by order size. First entry in array is
4729 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4730 repeated int32 pages_per_order = 4;
4731}
4732
Chenjie Yu12e5e672018-09-14 15:54:59 -07004733/**
4734 * Pulled from ProcessStatsService.java
4735 */
4736message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004737 optional ProcessStatsSectionProto proc_stats_section = 1;
4738}
4739
Chenjie Yuf910b7802019-01-11 16:08:20 -08004740/**
4741 * Pulled from ProcessStatsService.java
4742 */
4743message ProcStatsPkgProc {
4744 optional ProcessStatsSectionProto proc_stats_section = 1;
4745}
4746
Yangsteraf9aee72018-10-12 09:26:16 -07004747message PowerProfileProto {
4748 optional double cpu_suspend = 1;
4749
4750 optional double cpu_idle = 2;
4751
4752 optional double cpu_active = 3;
4753
4754 message CpuCluster {
4755 optional int32 id = 1;
4756 optional double cluster_power = 2;
4757 optional int32 cores = 3;
4758 repeated int64 speed = 4;
4759 repeated double core_power = 5;
4760 }
4761
4762 repeated CpuCluster cpu_cluster = 40;
4763
4764 optional double wifi_scan = 4;
4765
4766 optional double wifi_on = 5;
4767
4768 optional double wifi_active = 6;
4769
4770 optional double wifi_controller_idle = 7;
4771
4772 optional double wifi_controller_rx = 8;
4773
4774 optional double wifi_controller_tx = 9;
4775
4776 repeated double wifi_controller_tx_levels = 10;
4777
4778 optional double wifi_controller_operating_voltage = 11;
4779
4780 optional double bluetooth_controller_idle = 12;
4781
4782 optional double bluetooth_controller_rx = 13;
4783
4784 optional double bluetooth_controller_tx = 14;
4785
4786 optional double bluetooth_controller_operating_voltage = 15;
4787
4788 optional double modem_controller_sleep = 16;
4789
4790 optional double modem_controller_idle = 17;
4791
4792 optional double modem_controller_rx = 18;
4793
4794 repeated double modem_controller_tx = 19;
4795
4796 optional double modem_controller_operating_voltage = 20;
4797
4798 optional double gps_on = 21;
4799
4800 repeated double gps_signal_quality_based = 22;
4801
4802 optional double gps_operating_voltage = 23;
4803
4804 optional double bluetooth_on = 24;
4805
4806 optional double bluetooth_active = 25;
4807
4808 optional double bluetooth_at_cmd = 26;
4809
4810 optional double ambient_display = 27;
4811
4812 optional double screen_on = 28;
4813
4814 optional double radio_on = 29;
4815
4816 optional double radio_scanning = 30;
4817
4818 optional double radio_active = 31;
4819
4820 optional double screen_full = 32;
4821
4822 optional double audio = 33;
4823
4824 optional double video = 34;
4825
4826 optional double flashlight = 35;
4827
4828 optional double memory = 36;
4829
4830 optional double camera = 37;
4831
4832 optional double wifi_batched_scan = 38;
4833
4834 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004835}
Chenjie Yuab530202018-09-26 12:39:20 -07004836
4837/**
4838 * power_profile.xml and other constants for power model calculations.
4839 * Pulled from PowerProfile.java
4840 */
4841message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004842 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004843}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004844
4845/**
arangelovd5db50e2018-10-12 20:24:39 +01004846 * Logs when a user restriction was added or removed.
4847 *
4848 * Logged from:
4849 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4850 */
4851message UserRestrictionChanged {
4852 // The raw string of the user restriction as defined in UserManager.
4853 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4854 optional string restriction = 1;
4855 // Whether the restriction is enabled or disabled.
4856 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004857}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004858
4859/**
4860 * Pulls process user time and system time. Puller takes a snapshot of all pids
4861 * in the system and returns cpu stats for those that are working at the time.
4862 * Dead pids will be dropped. Kernel processes are excluded.
4863 * Min cool-down is 5 sec.
4864 */
4865message ProcessCpuTime {
4866 optional int32 uid = 1 [(is_uid) = true];
4867
4868 optional string process_name = 2;
4869 // Process cpu time in user space, cumulative from boot/process start
4870 optional int64 user_time_millis = 3;
4871 // Process cpu time in system space, cumulative from boot/process start
4872 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004873}
Misha Wagner5a51e002018-10-03 15:04:09 +01004874
4875/**
4876 * Pulls the CPU usage for each thread.
4877 *
4878 * Read from /proc/$PID/task/$TID/time_in_state files.
4879 *
4880 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4881 * time_in_state files not being present on some phones, have not been addressed. These should be
4882 * considered before a public release.
4883 */
4884message CpuTimePerThreadFreq {
4885 // UID that owns the process.
4886 optional int32 uid = 1 [(is_uid) = true];
4887 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004888 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004889 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004890 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004891 // Name of the process taken from `/proc/$PID/cmdline`.
4892 optional string process_name = 4;
4893 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4894 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004895
4896 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4897 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4898 // frequencies are given here as the alternative is sending eight separate atoms. This method
4899 // significantly reduces the amount of data created
4900 optional int32 frequency1_khz = 6;
4901 optional int32 time1_millis = 7;
4902 optional int32 frequency2_khz = 8;
4903 optional int32 time2_millis = 9;
4904 optional int32 frequency3_khz = 10;
4905 optional int32 time3_millis = 11;
4906 optional int32 frequency4_khz = 12;
4907 optional int32 time4_millis = 13;
4908 optional int32 frequency5_khz = 14;
4909 optional int32 time5_millis = 15;
4910 optional int32 frequency6_khz = 16;
4911 optional int32 time6_millis = 17;
4912 optional int32 frequency7_khz = 18;
4913 optional int32 time7_millis = 19;
4914 optional int32 frequency8_khz = 20;
4915 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004916}
Bookatz75ee60422018-11-09 12:27:37 -08004917
4918/**
Bookatz366a4432018-11-20 09:42:33 -08004919 * Pulls information about the device's build.
4920 */
4921message BuildInformation {
4922 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4923 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4924 optional string fingerprint = 1;
4925
4926 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4927 optional string brand = 2;
4928
4929 // Build.PRODUCT. The name of the overall product.
4930 optional string product = 3;
4931
4932 // Build.DEVICE. The name of the industrial design.
4933 optional string device = 4;
4934
4935 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4936 optional string version_release = 5;
4937
4938 // Build.ID. E.g. a label like "M4-rc20".
4939 optional string id = 6;
4940
4941 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4942 // represent this build.
4943 optional string version_incremental = 7;
4944
4945 // Build.TYPE. The type of build, like "user" or "eng".
4946 optional string type = 8;
4947
4948 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4949 optional string tags = 9;
4950}
4951
4952/**
Adam He420947c2019-01-23 15:59:09 -08004953 * Logs information about mismatched caller for content capture.
4954 *
4955 * Logged from:
4956 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4957 */
4958message ContentCaptureCallerMismatchReported {
4959 optional string intended_package = 1;
4960 optional string calling_package = 2;
4961}
4962
4963/**
4964 * Logs information about content capture service events.
4965 *
4966 * Logged from:
4967 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4968 */
4969message ContentCaptureServiceEvents {
4970 // The type of event.
4971 enum Event {
4972 UNKNOWN = 0;
4973 ON_CONNECTED = 1;
4974 ON_DISCONNECTED = 2;
4975 SET_WHITELIST = 3;
4976 SET_DISABLED = 4;
4977 ON_USER_DATA_REMOVED = 5;
4978 }
4979 optional Event event = 1;
4980 // component/package of content capture service.
4981 optional string service_info = 2;
4982 // component/package of target.
4983 // it's a concatenated list of component/package for SET_WHITELIST event
4984 // separated by " ".
4985 optional string target_info = 3;
4986}
4987
4988/**
4989 * Logs information about content capture session events.
4990 *
4991 * Logged from:
4992 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4993 */
4994message ContentCaptureSessionEvents {
4995 // The type of event.
4996 enum Event {
4997 UNKNOWN = 0;
4998 ON_SESSION_STARTED = 1;
4999 ON_SESSION_FINISHED = 2;
5000 SESSION_NOT_CREATED = 3;
5001 }
5002 optional int32 session_id = 1;
5003 optional Event event = 2;
5004 // (n/a on session finished)
5005 optional int32 state_flags = 3;
5006 // component/package of content capture service.
5007 optional string service_info = 4;
5008 // component/package of app.
5009 // (n/a on session finished)
5010 optional string app_info = 5;
5011 optional bool is_child_session = 6;
5012}
5013
5014/**
5015 * Logs information about session being flushed.
5016 *
5017 * Logged from:
5018 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5019 */
5020message ContentCaptureFlushed {
5021 optional int32 session_id = 1;
5022 // component/package of content capture service.
5023 optional string service_info = 2;
5024 // component/package of app.
5025 optional string app_info = 3;
5026 // session start/finish events
5027 optional int32 child_session_started = 4;
5028 optional int32 child_session_finished = 5;
5029 // count of view events.
5030 optional int32 view_appeared_count = 6;
5031 optional int32 view_disappeared_count = 7;
5032 optional int32 view_text_changed_count = 8;
5033
5034 // Flush stats.
5035 optional int32 max_events = 9;
5036 optional int32 idle_flush_freq = 10;
5037 optional int32 text_flush_freq = 11;
5038 optional int32 flush_reason = 12;
5039}
5040
5041/**
Bookatz75ee60422018-11-09 12:27:37 -08005042 * Pulls on-device BatteryStats power use calculations for the overall device.
5043 */
5044message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005045 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5046 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5047 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5048 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005049}
5050
5051/**
5052 * Pulls on-device BatteryStats power use calculations broken down by uid.
5053 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5054 * that is attributed to non-uid items. They must all be included to get the total power use.
5055 */
5056message DeviceCalculatedPowerBlameUid {
5057 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5058 optional int32 uid = 1 [(is_uid) = true];
5059
Bookatz3dbc13a2018-12-21 12:16:51 -08005060 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5061 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5062 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005063}
5064
5065/**
5066 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5067 * drain type.
5068 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5069 * is attributed uids. They must all be included to get the total power use.
5070 */
5071message DeviceCalculatedPowerBlameOther {
5072 // The type of item whose power use is being reported.
5073 enum DrainType {
5074 AMBIENT_DISPLAY = 0;
5075 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5076 BLUETOOTH = 2;
5077 CAMERA = 3;
5078 // Cell-standby
5079 CELL = 4;
5080 FLASHLIGHT = 5;
5081 IDLE = 6;
5082 MEMORY = 7;
5083 // Amount that total computed drain exceeded the drain estimated using the
5084 // battery level changes and capacity.
5085 OVERCOUNTED = 8;
5086 PHONE = 9;
5087 SCREEN = 10;
5088 // Amount that total computed drain was below the drain estimated using the
5089 // battery level changes and capacity.
5090 UNACCOUNTED = 11;
5091 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5092 WIFI = 13;
5093 }
5094 optional DrainType drain_type = 1;
5095
Bookatz3dbc13a2018-12-21 12:16:51 -08005096 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5097 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5098 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005099}
arangelov4e994062018-11-13 16:12:38 +00005100
5101/**
5102 * Logs device policy features.
5103 *
5104 * Logged from:
5105 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5106 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5107 */
5108message DevicePolicyEvent {
5109 // The event id - unique for each event.
5110 optional android.stats.devicepolicy.EventId event_id = 1;
5111 // The admin package name.
5112 optional string admin_package_name = 2;
5113 // A generic integer parameter.
5114 optional int32 integer_value = 3;
5115 // A generic boolean parameter.
5116 optional bool boolean_value = 4;
5117 // A parameter specifying a time period in milliseconds.
5118 optional uint64 time_period_millis = 5;
5119 // A parameter specifying a list of package names, bundle extras or string parameters.
5120 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5121}
shawnlinea5b66b2018-11-13 15:05:29 +08005122
5123/**
5124 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5125 *
5126 * Logged from:
5127 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5128 */
5129message DocsUILaunchReported {
5130 optional android.stats.docsui.LaunchAction launch_action = 1;
5131 optional bool has_initial_uri = 2;
5132 optional android.stats.docsui.MimeType mime_type = 3;
5133 optional android.stats.docsui.Root initial_root = 4;
5134}
5135
5136/**
5137 * Logs root/app visited event in file managers/picker. Call this when the user
5138 * taps on root/app in hamburger menu.
5139 *
5140 * Logged from:
5141 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5142 */
5143message DocsUIRootVisitedReported {
5144 optional android.stats.docsui.ContextScope scope = 1;
5145 optional android.stats.docsui.Root root = 2;
5146}
5147
5148/**
5149 * Logs file operation stats. Call this when a file operation has completed.
5150 *
5151 * Logged from:
5152 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5153 */
5154message DocsUIFileOperationReported {
5155 optional android.stats.docsui.Provider provider = 1;
5156 optional android.stats.docsui.FileOperation file_op = 2;
5157}
5158
5159/**
5160 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5161 * mode.
5162 *
5163 * Logged from:
5164 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5165 */
5166message DocsUIFileOperationCopyMoveModeReported {
5167 optional android.stats.docsui.FileOperation file_op = 1;
5168 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5169}
5170
5171
5172/**
5173 * Logs file sub operation stats. Call this when a file operation has failed.
5174 *
5175 * Logged from:
5176 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5177 */
5178message DocsUIFileOperationFailureReported {
5179 optional android.stats.docsui.Authority authority = 1;
5180 optional android.stats.docsui.SubFileOperation sub_op = 2;
5181}
5182
5183/**
5184* Logs the cancellation of a file operation. Call this when a job is canceled
5185*
5186* Logged from:
5187* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5188*/
5189message DocsUIFileOperationCanceledReported {
5190 optional android.stats.docsui.FileOperation file_op = 1;
5191}
5192
5193/**
5194 * Logs startup time in milliseconds.
5195 *
5196 * Logged from:
5197 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5198 */
5199message DocsUIStartupMsReported {
5200 optional int32 startup_millis = 1;
5201}
5202
5203/**
5204 * Logs the action that was started by user.
5205 *
5206 * Logged from:
5207 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5208 */
5209message DocsUIUserActionReported {
5210 optional android.stats.docsui.UserAction action = 1;
5211}
5212
5213/**
5214 * Logs the invalid type when invalid scoped access is requested.
5215 *
5216 * Logged from:
5217 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5218 */
5219message DocsUIInvalidScopedAccessRequestReported {
5220 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005221}
Ben Murdochbab399f2018-12-06 11:01:38 +00005222
5223/**
shawnlina75e82d2019-01-07 10:31:12 +08005224 * Logs the package name that launches docsui picker mode.
5225 *
5226 * Logged from:
5227 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5228 */
5229message DocsUIPickerLaunchedFromReported {
5230 optional string package_name = 1;
5231}
5232
5233/**
5234 * Logs the search type.
5235 *
5236 * Logged from:
5237 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5238 */
5239message DocsUISearchTypeReported {
5240 optional android.stats.docsui.SearchType search_type = 1;
5241}
5242
5243/**
5244 * Logs the search mode.
5245 *
5246 * Logged from:
5247 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5248 */
5249message DocsUISearchModeReported {
5250 optional android.stats.docsui.SearchMode search_mode = 1;
5251}
5252
5253/**
5254 * Logs the pick result information.
5255 *
5256 * Logged from:
5257 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5258 */
5259message DocsUIPickResultReported {
5260 optional int32 total_action_count = 1;
5261 optional int64 duration_millis = 2;
5262 optional int32 file_count= 3;
5263 optional bool is_searching = 4;
5264 optional android.stats.docsui.Root picked_from = 5;
5265 optional android.stats.docsui.MimeType mime_type = 6;
5266 optional int32 repeatedly_pick_times = 7;
5267}
5268
5269/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005270 * Logs when an app's memory is compacted.
5271 *
5272 * Logged from:
5273 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5274 */
5275message AppCompacted {
5276 // The pid of the process being compacted.
5277 optional int32 pid = 1;
5278
5279 // The name of the process being compacted.
5280 optional string process_name = 2;
5281
5282 // The type of compaction.
5283 enum Action {
5284 UNKNOWN = 0;
5285 SOME = 1;
5286 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005287 PERSISTENT = 3;
5288 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005289 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005290 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005291
5292 // Total RSS in kilobytes consumed by the process prior to compaction.
5293 optional int64 before_rss_total_kilobytes = 4;
5294
5295 // File RSS in kilobytes consumed by the process prior to compaction.
5296 optional int64 before_rss_file_kilobytes = 5;
5297
5298 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5299 optional int64 before_rss_anon_kilobytes = 6;
5300
5301 // Swap in kilobytes consumed by the process prior to compaction.
5302 optional int64 before_swap_kilobytes = 7;
5303
5304 // Total RSS in kilobytes consumed by the process after compaction.
5305 optional int64 after_rss_total_kilobytes = 8;
5306
5307 // File RSS in kilobytes consumed by the process after compaction.
5308 optional int64 after_rss_file_kilobytes = 9;
5309
5310 // Anonymous RSS in kilobytes consumed by the process after compaction.
5311 optional int64 after_rss_anon_kilobytes = 10;
5312
5313 // Swap in kilobytes consumed by the process after compaction.
5314 optional int64 after_swap_kilobytes = 11;
5315
5316 // The time taken to perform compaction in milliseconds.
5317 optional int64 time_to_compact_millis = 12;
5318
5319 // The last compaction action performed for this app.
5320 optional Action last_action = 13;
5321
Ben Murdoch01720b82018-12-19 18:03:44 +00005322 // The last time that compaction was attempted on this process in milliseconds
5323 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5324 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005325
Ben Murdoch885c21b2019-03-15 18:02:04 +00005326 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005327 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005328
5329 // The process state at the time of compaction.
5330 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005331
5332 // Free ZRAM in kilobytes before compaction.
5333 optional int64 before_zram_free_kilobytes = 17;
5334
5335 // Free ZRAM in kilobytes after compaction.
5336 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005337}
lifr157fc552018-12-12 16:38:04 +08005338
5339/**
lifrb6b90b62019-03-29 00:40:17 +08005340 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5341 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5342 *
lifr1f74b052019-04-16 22:16:30 +08005343 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5344 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5345 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5346 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005347 */
5348message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005349 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005350
lifr1f74b052019-04-16 22:16:30 +08005351 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005352
5353 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005354 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005355
lifr1f74b052019-04-16 22:16:30 +08005356 // Only valid for event_type = EVENT_GETADDRINFO.
5357 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005358
lifr1f74b052019-04-16 22:16:30 +08005359 // Flags passed to android_res_nsend() defined in multinetwork.h
5360 // Only valid for event_type = EVENT_RESNSEND.
5361 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005362
lifrad9becc2019-05-20 11:04:41 +08005363 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005364
5365 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005366 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005367
5368 // Additional pass-through fields opaque to statsd.
5369 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005370 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005371
5372 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5373 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005374}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005375
5376/**
5377 * Logs when a data stall event occurs.
5378 *
5379 * Log from:
5380 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5381 */
5382message DataStallEvent {
5383 // Data stall evaluation type.
5384 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5385 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5386 optional int32 evaluation_type = 1;
5387 // See definition in data_stall_event.proto.
5388 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5389 // See definition in data_stall_event.proto.
5390 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5391 // See definition in data_stall_event.proto.
5392 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5393 // See definition in data_stall_event.proto.
5394 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5395 // See definition in data_stall_event.proto.
5396 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5397}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005398
5399/*
5400 * Logs when RescueParty resets some set of experiment flags.
5401 *
5402 * Logged from:
5403 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5404 */
5405message RescuePartyResetReported {
5406 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5407 optional int32 rescue_level = 1;
5408}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005409
5410/**
5411 * Logs when signed config is received from an APK, and if that config was applied successfully.
5412 * Logged from:
5413 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5414 */
5415message SignedConfigReported {
5416 enum Type {
5417 UNKNOWN_TYPE = 0;
5418 GLOBAL_SETTINGS = 1;
5419 }
5420 optional Type type = 1;
5421
5422 // The final status of the signed config received.
5423 enum Status {
5424 UNKNOWN_STATUS = 0;
5425 APPLIED = 1;
5426 BASE64_FAILURE_CONFIG = 2;
5427 BASE64_FAILURE_SIGNATURE = 3;
5428 SECURITY_EXCEPTION = 4;
5429 INVALID_CONFIG = 5;
5430 OLD_CONFIG = 6;
5431 SIGNATURE_CHECK_FAILED = 7;
5432 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005433 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005434 }
5435 optional Status status = 2;
5436
5437 // The version of the signed config processed.
5438 optional int32 version = 3;
5439
5440 // The package name that the config was extracted from.
5441 optional string from_package = 4;
5442
5443 enum Key {
5444 NO_KEY = 0;
5445 DEBUG = 1;
5446 PRODUCTION = 2;
5447 }
5448 // Which key was used to verify the config.
5449 optional Key verified_with = 5;
5450}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005451
5452/*
5453 * Logs GNSS Network-Initiated (NI) location events.
5454 *
5455 * Logged from:
5456 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5457 */
5458message GnssNiEventReported {
5459 // The type of GnssNiEvent.
5460 enum EventType {
5461 UNKNOWN = 0;
5462 NI_REQUEST = 1;
5463 NI_RESPONSE = 2;
5464 }
5465 optional EventType event_type = 1;
5466
5467 // An ID generated by HAL to associate NI notifications and UI responses.
5468 optional int32 notification_id = 2;
5469
5470 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005471 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005472
5473 // NI requires notification.
5474 optional bool need_notify = 4;
5475
5476 // NI requires verification.
5477 optional bool need_verify = 5;
5478
5479 // NI requires privacy override, no notification/minimal trace.
5480 optional bool privacy_override = 6;
5481
5482 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5483 // seconds.
5484 optional int32 timeout = 7;
5485
5486 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005487 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005488
5489 // String representing the requester of the network inititated location request.
5490 optional string requestor_id = 9;
5491
5492 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5493 // network initiated location request.
5494 optional string text = 10;
5495
5496 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005497 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005498
5499 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005500 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005501
5502 // True if SUPL ES is enabled.
5503 optional bool is_supl_es_enabled = 13;
5504
5505 // True if GNSS location is enabled.
5506 optional bool is_location_enabled = 14;
5507
5508 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005509 optional android.server.location.GnssUserResponseType user_response = 15;
5510}
5511
5512/**
5513 * Logs GNSS non-framework (NFW) location notification.
5514 *
5515 * Logged from:
5516 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5517 */
5518message GnssNfwNotificationReported {
5519 // Package name of the Android proxy application representing the non-framework entity that
5520 // requested location. Set to empty string if unknown.
5521 optional string proxy_app_package_name = 1;
5522
5523 // Protocol stack that initiated the non-framework location request.
5524 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5525
5526 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5527 // set to empty string. This field is opaque to the framework and used for logging purposes.
5528 optional string other_protocol_stack_name = 3;
5529
5530 // Source initiating/receiving the location information.
5531 optional android.server.location.NfwRequestor requestor = 4;
5532
5533 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5534 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5535 // and used for logging purposes.
5536 optional string requestor_id = 5;
5537
5538 // Indicates whether location information was provided for this request.
5539 optional android.server.location.NfwResponseType response_type = 6;
5540
5541 // True if the device is in user initiated emergency session.
5542 optional bool in_emergency_mode = 7;
5543
5544 // True if cached location is provided.
5545 optional bool is_cached_location = 8;
5546
5547 // True if proxy app permission mismatch between framework and GNSS HAL.
5548 optional bool is_permission_mismatched = 9;
5549}
5550
5551/**
5552 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5553 *
5554 * Logged from:
5555 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5556 */
5557message GnssConfigurationReported {
5558 // SUPL host name.
5559 optional string supl_host = 1;
5560
5561 // SUPL port number.
5562 optional int32 supl_port = 2;
5563
5564 // C2K host name.
5565 optional string c2k_host = 3;
5566
5567 // C2K port number.
5568 optional int32 c2k_port = 4;
5569
5570 // The SUPL version requested by Carrier.
5571 optional int32 supl_ver = 5;
5572
5573 // The SUPL mode.
5574 optional android.server.location.SuplMode supl_mode = 6;
5575
5576 // True if NI emergency SUPL restrictions is enabled.
5577 optional bool supl_es = 7;
5578
5579 // LTE Positioning Profile settings
5580 optional android.server.location.LppProfile lpp_profile = 8;
5581
5582 // Positioning protocol on A-Glonass system.
5583 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5584
5585 // True if emergency PDN is used. Otherwise, regular PDN is used.
5586 optional bool use_emergency_pdn_for_emergency_supl= 10;
5587
5588 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5589 optional android.server.location.GpsLock gps_lock = 11;
5590
5591 // Number of seconds to extend the emergency session duration post emergency call.
5592 optional int32 es_extension_sec = 12;
5593
5594 // The full list of package names of proxy Android applications representing the non-framework
5595 // location access entities (on/off the device) for which the framework user has granted
5596 // non-framework location access permission. The package names are concatenated in one string
5597 // with spaces as separators.
5598 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005599}
Jack Yu95b64f32018-12-13 18:26:11 +08005600
5601/**
5602 * Logs when a NFC device's error occurred.
5603 * Logged from:
5604 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5605 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5606 */
5607message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005608 enum Type {
5609 UNKNOWN = 0;
5610 CMD_TIMEOUT = 1;
5611 ERROR_NOTIFICATION = 2;
5612 AID_OVERFLOW = 3;
5613 }
5614 optional Type type = 1;
5615 // If it's nci cmd timeout, log the timeout command.
5616 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005617
Alex Salod7c3eef2019-01-25 14:43:27 -08005618 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005619}
5620
5621/**
5622 * Logs when a NFC device's state changed event
5623 * Logged from:
5624 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5625 */
5626message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005627 enum State {
5628 UNKNOWN = 0;
5629 OFF = 1;
5630 ON = 2;
5631 ON_LOCKED = 3; // Secure Nfc enabled.
5632 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5633 }
5634 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005635}
5636
5637/**
5638 * Logs when a NFC Beam Transaction occurred.
5639 * Logged from:
5640 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5641 */
5642message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005643 enum Operation {
5644 UNKNOWN = 0;
5645 SEND = 1;
5646 RECEIVE = 2;
5647 }
5648 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005649}
5650
5651/**
5652 * Logs when a NFC Card Emulation Transaction occurred.
5653 * Logged from:
5654 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5655 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5656 */
5657message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005658 enum Category {
5659 UNKNOWN = 0;
5660 HCE_PAYMENT = 1;
5661 HCE_OTHER = 2;
5662 OFFHOST = 3;
5663 }
5664 // Transaction belongs to HCE payment or HCE other category, or offhost.
5665 optional Category category = 1;
5666 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5667 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005668}
5669
5670/**
5671 * Logs when a NFC Tag event occurred.
5672 * Logged from:
5673 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5674 */
5675message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005676 enum Type {
5677 UNKNOWN = 0;
5678 URL = 1;
5679 BT_PAIRING = 2;
5680 PROVISION = 3;
5681 WIFI_CONNECT = 4;
5682 APP_LAUNCH = 5;
5683 OTHERS = 6;
5684 }
5685 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005686}
5687
5688/**
5689 * Logs when Hce transaction triggered
5690 * Logged from:
5691 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5692 */
5693message NfcHceTransactionOccurred {
5694 // The latency period(in microseconds) it took for the first HCE data
5695 // exchange.
5696 optional uint32 latency_micros = 1;
5697}
5698
5699/**
5700 * Logs when SecureElement state event changed
5701 * Logged from:
5702 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5703 */
5704message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005705 enum State {
5706 UNKNOWN = 0;
5707 INITIALIZED = 1;
5708 DISCONNECTED = 2;
5709 CONNECTED = 3;
5710 HALCRASH = 4;
5711 }
5712 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005713
Alex Salod7c3eef2019-01-25 14:43:27 -08005714 optional string state_change_reason = 2;
5715 // SIMx or eSEx.
5716 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005717}
5718
5719/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005720 * Information about a permission grant request
5721 */
5722message PermissionGrantRequestResultReported {
5723 // unique value identifying an API call. A API call might result in multiple of these atoms
5724 optional int64 request_id = 1;
5725
5726 // UID of package requesting the permission grant
5727 optional int32 requesting_uid = 2 [(is_uid) = true];
5728
5729 // Name of package requesting the permission grant
5730 optional string requesting_package_name = 3;
5731
5732 // The permission to be granted
5733 optional string permission_name = 4;
5734
5735 // If the permission was explicitly requested via the API or added by the system
5736 optional bool is_implicit = 5;
5737
5738 enum Result {
5739 UNDEFINED = 0;
5740 // permission request was ignored
5741 IGNORED = 1;
5742 // permission request was ignored because it was user fixed
5743 IGNORED_USER_FIXED = 2;
5744 // permission request was ignored because it was policy fixed
5745 IGNORED_POLICY_FIXED = 3;
5746 // permission was granted by user action
5747 USER_GRANTED = 4;
5748 // permission was automatically granted
5749 AUTO_GRANTED = 5;
5750 // permission was denied by user action
5751 USER_DENIED = 6;
5752 // permission was denied with prejudice by the user
5753 USER_DENIED_WITH_PREJUDICE = 7;
5754 // permission was automatically denied
5755 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005756 // permission request was ignored because permission is restricted
5757 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005758 }
5759 // The result of the permission grant
5760 optional Result result = 6;
5761}
5762
5763/**
Jack Yu95b64f32018-12-13 18:26:11 +08005764 * Logs when Omapi API used
5765 * Logged from:
5766 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5767 */
5768message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005769 enum Operation {
5770 UNKNOWN = 0;
5771 OPEN_CHANNEL = 1;
5772 }
5773 optional Operation operation = 1;
5774 // SIMx or eSEx.
5775 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005776
Alex Salod7c3eef2019-01-25 14:43:27 -08005777 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005778}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005779
5780/**
Alex Saloa060aee2019-01-21 14:36:41 -08005781 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5782 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005783 * Logged from:
5784 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5785 */
5786message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005787 optional int64 dispatch_latency_millis = 1;
5788}
5789
5790/**
5791 * Logs AttentionManagerService attention check result.
5792 *
5793 * Logged from:
5794 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5795 */
5796message AttentionManagerServiceResultReported {
5797 // See core/java/android/service/attention/AttentionService.java
5798 enum AttentionCheckResult {
5799 UNKNOWN = 20;
5800 ATTENTION_SUCCESS_ABSENT = 0;
5801 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005802 ATTENTION_FAILURE_UNKNOWN = 2;
5803 ATTENTION_FAILURE_CANCELLED = 3;
5804 ATTENTION_FAILURE_PREEMPTED = 4;
5805 ATTENTION_FAILURE_TIMED_OUT = 5;
5806 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005807 }
5808 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005809}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005810
5811/**
5812 * Logs when an adb connection changes state.
5813 *
5814 * Logged from:
5815 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5816 */
5817message AdbConnectionChanged {
5818 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5819 // previously selected for this system.
5820 optional int64 last_connection_time_millis = 1;
5821
5822 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5823 // to reconnect via adb without user interaction.
5824 optional int64 auth_window_millis = 2;
5825
5826 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5827 optional android.debug.AdbConnectionStateEnum state = 3;
5828
5829 // True if the 'always allow' option was selected for this system.
5830 optional bool always_allow = 4;
5831}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005832
5833/*
5834 * Logs the reported speech DSP status.
5835 *
5836 * Logged from:
5837 * Vendor audio implementation.
5838 */
5839message SpeechDspStatReported {
5840 // The total Speech DSP uptime in milliseconds.
5841 optional int32 total_uptime_millis = 1;
5842 // The total Speech DSP downtime in milliseconds.
5843 optional int32 total_downtime_millis = 2;
5844 optional int32 total_crash_count = 3;
5845 optional int32 total_recover_count = 4;
5846}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005847
5848/**
5849 * Logs USB connector contaminant status.
5850 *
5851 * Logged from: USB Service.
5852 */
5853message UsbContaminantReported {
5854 optional string id = 1;
5855 optional android.service.usb.ContaminantPresenceStatus status = 2;
5856}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005857
5858/**
5859 * This atom is for debugging purpose.
5860 */
5861message DebugElapsedClock {
5862 // Monotically increasing value for each pull.
5863 optional int64 pull_count = 1;
5864 // Time from System.elapsedRealtime.
5865 optional int64 elapsed_clock_millis = 2;
5866 // Time from System.elapsedRealtime.
5867 optional int64 same_elapsed_clock_millis = 3;
5868 // Diff between current elapsed time and elapsed time from previous pull.
5869 optional int64 elapsed_clock_diff_millis = 4;
5870
5871 enum Type {
5872 TYPE_UNKNOWN = 0;
5873 ALWAYS_PRESENT = 1;
5874 PRESENT_ON_ODD_PULLS = 2;
5875 }
5876 // Type of behavior for the pulled data.
5877 optional Type type = 5;
5878}
5879
5880/**
5881 * This atom is for debugging purpose.
5882 */
5883message DebugFailingElapsedClock {
5884 // Monotically increasing value for each pull.
5885 optional int64 pull_count = 1;
5886 // Time from System.elapsedRealtime.
5887 optional int64 elapsed_clock_millis = 2;
5888 // Time from System.elapsedRealtime.
5889 optional int64 same_elapsed_clock_millis = 3;
5890 // Diff between current elapsed time and elapsed time from previous pull.
5891 optional int64 elapsed_clock_diff_millis = 4;
5892}
Steven Wuacef6bb2019-01-23 14:21:17 -05005893
5894/** Logs System UI bubbles event changed.
5895 *
5896 * Logged from:
5897 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5898 */
5899message BubbleUIChanged {
5900
5901 // The app package that is posting the bubble.
5902 optional string package_name = 1;
5903
5904 // The notification channel that is posting the bubble.
5905 optional string notification_channel = 2;
5906
5907 // The notification id associated with the posted bubble.
5908 optional int32 notification_id = 3;
5909
5910 // The position of the bubble within the bubble stack.
5911 optional int32 position = 4;
5912
5913 // The total number of bubbles within the bubble stack.
5914 optional int32 total_number = 5;
5915
5916 // User interactions with the bubble.
5917 enum Action {
5918 UNKNOWN = 0;
5919 POSTED = 1;
5920 UPDATED = 2;
5921 EXPANDED = 3;
5922 COLLAPSED = 4;
5923 DISMISSED = 5;
5924 STACK_DISMISSED = 6;
5925 STACK_MOVED = 7;
5926 HEADER_GO_TO_APP = 8;
5927 HEADER_GO_TO_SETTINGS = 9;
5928 PERMISSION_OPT_IN = 10;
5929 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005930 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005931 SWIPE_LEFT = 13;
5932 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005933 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04005934 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005935 }
5936 optional Action action = 6;
5937
5938 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5939 optional float normalized_x_position = 7;
5940 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005941
5942 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5943 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005944
5945 // Whether the bubble is an on-going one.
5946 optional bool is_ongoing = 10;
5947
5948 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07005949 // This is deprecated and the value should be ignored.
5950 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05005951}
Kweku Adams8845d012018-12-11 20:06:45 -08005952
5953/**
Steven Wu552f63f2019-02-05 13:41:36 -05005954 * Logs System UI bubbles developer errors.
5955 *
5956 * Logged from:
5957 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5958 */
5959message BubbleDeveloperErrorReported {
5960
5961 // The app package that is posting the bubble.
5962 optional string package_name = 1;
5963
5964 // Bubble developer error type enums.
5965 enum Error {
5966 UNKNOWN = 0;
5967 ACTIVITY_INFO_MISSING = 1;
5968 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5969 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5970 }
5971 optional Error error = 2 [default = UNKNOWN];
5972}
5973
5974/**
Kweku Adams8845d012018-12-11 20:06:45 -08005975 * Logs that a constraint for a scheduled job has changed.
5976 *
5977 * Logged from:
5978 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5979 */
5980message ScheduledJobConstraintChanged {
5981 repeated AttributionNode attribution_node = 1;
5982
5983 // Name of the job.
5984 optional string job_name = 2;
5985
5986 optional com.android.server.job.ConstraintEnum constraint = 3;
5987
5988 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005989 UNKNOWN = 0;
5990 UNSATISFIED = 1;
5991 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005992 }
5993 optional State state = 4;
5994}
Alex Salod7c3eef2019-01-25 14:43:27 -08005995
5996/**
5997 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5998 * returns true.
5999 *
6000 * Logged from:
6001 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6002 */
6003message ScreenTimeoutExtensionReported {
6004 // Describes how many times in a row did the power manager reset the screen off timeout.
6005 optional uint32 consecutive_timeout_extended_count = 1;
6006}
Hui Yu885aca12019-01-10 17:11:34 -08006007
6008/*
6009* Logs number of milliseconds it takes to start a process.
6010* The definition of app process start time is from the app launch time to
6011* the time that Zygote finished forking the app process and loaded the
6012* application package's java classes.
6013
6014* This metric is different from AppStartOccurred which is for foreground
6015* activity only.
6016
6017* ProcessStartTime can report all processes (both foreground and background)
6018* start time.
6019*
6020* Logged from:
6021* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6022*/
6023message ProcessStartTime {
6024 // The uid of the ProcessRecord.
6025 optional int32 uid = 1 [(is_uid) = true];
6026
6027 // The process pid.
6028 optional int32 pid = 2;
6029
6030 // The process name.
6031 // Usually package name, "system" for system server.
6032 // Provided by ActivityManagerService.
6033 optional string process_name = 3;
6034
6035 enum StartType {
6036 UNKNOWN = 0;
6037 WARM = 1;
6038 HOT = 2;
6039 COLD = 3;
6040 }
6041
6042 // The start type.
6043 optional StartType type = 4;
6044
6045 // The elapsed realtime at the start of the process.
6046 optional int64 process_start_time_millis = 5;
6047
6048 // Number of milliseconds it takes to reach bind application.
6049 optional int32 bind_application_delay_millis = 6;
6050
6051 // Number of milliseconds it takes to finish start of the process.
6052 optional int32 process_start_delay_millis = 7;
6053
6054 // hostingType field in ProcessRecord, the component type such as "activity",
6055 // "service", "content provider", "broadcast" or other strings.
6056 optional string hosting_type = 8;
6057
6058 // hostingNameStr field in ProcessRecord. The component class name that runs
6059 // in this process.
6060 optional string hosting_name = 9;
6061}
6062
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006063/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006064 * Track Media Codec usage
6065 * Logged from:
6066 * frameworks/av/media/libstagefright/MediaCodec.cpp
6067 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6068 */
6069message MediametricsCodecReported {
6070 optional int64 timestamp_nanos = 1;
6071 optional string package_name = 2;
6072 optional int64 package_version_code = 3;
6073 optional int64 media_apex_version = 4;
6074
6075 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6076}
6077
6078/**
6079 * Track Media Extractor (pulling video/audio streams out of containers) usage
6080 * Logged from:
6081 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6082 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6083 */
6084message MediametricsExtractorReported {
6085 optional int64 timestamp_nanos = 1;
6086 optional string package_name = 2;
6087 optional int64 package_version_code = 3;
6088 optional int64 media_apex_version = 4;
6089
6090 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6091}
6092
6093/**
6094 * Track how we arbitrate between microphone/input requests.
6095 * Logged from
6096 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6097 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6098 */
6099message MediametricsAudiopolicyReported {
6100 optional int64 timestamp_nanos = 1;
6101 optional string package_name = 2;
6102 optional int64 package_version_code = 3;
6103 optional int64 media_apex_version = 4;
6104
6105 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6106}
6107
6108/**
6109 * Track how we arbitrate between microphone requests.
6110 * Logged from
6111 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6112 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6113 */
6114message MediametricsAudiorecordReported {
6115 optional int64 timestamp_nanos = 1;
6116 optional string package_name = 2;
6117 optional int64 package_version_code = 3;
6118 optional int64 media_apex_version = 4;
6119
6120 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6121}
6122
6123/**
6124 * Track how we arbitrate between microphone/input requests.
6125 * Logged from
6126 * frameworks/av/media/libnblog/ReportPerformance.cpp
6127 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6128 */
6129message MediametricsAudiothreadReported {
6130 optional int64 timestamp_nanos = 1;
6131 optional string package_name = 2;
6132 optional int64 package_version_code = 3;
6133 optional int64 media_apex_version = 4;
6134
6135 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6136}
6137
6138/**
6139 * Track how we arbitrate between microphone/input requests.
6140 * Logged from
6141 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6142 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6143 */
6144message MediametricsAudiotrackReported {
6145 optional int64 timestamp_nanos = 1;
6146 optional string package_name = 2;
6147 optional int64 package_version_code = 3;
6148 optional int64 media_apex_version = 4;
6149
6150 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6151}
6152
6153/**
6154 * Track information about DRM framework performance
6155 * Logged from
6156 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6157 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6158 */
6159message MediametricsMediadrmReported {
6160 optional int64 timestamp_nanos = 1;
6161 optional string package_name = 2;
6162 optional int64 package_version_code = 3;
6163 optional int64 media_apex_version = 4;
6164
6165 // vendor+description tell about which DRM plugin is in use on this device
6166 optional string vendor = 5;
6167 optional string description = 6;
6168 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6169 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6170}
6171
6172/**
6173 * Track information about the widevine DRM plugin performance
6174 * Logged from
6175 * vendor/widevine/libwvdrmengine/cdm/metrics
6176 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6177 */
6178message MediametricsDrmWidevineReported {
6179 optional int64 timestamp_nanos = 1;
6180 optional string package_name = 2;
6181 optional int64 package_version_code = 3;
6182 optional int64 media_apex_version = 4;
6183
6184 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6185}
6186
6187/**
6188 * Track information about recordings (e.g. camcorder)
6189 * Logged from
6190 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6191 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6192 */
6193message MediametricsRecorderReported {
6194 optional int64 timestamp_nanos = 1;
6195 optional string package_name = 2;
6196 optional int64 package_version_code = 3;
6197 optional int64 media_apex_version = 4;
6198
6199 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6200}
6201
6202/**
6203 * Track Media Player usage
6204 * Logged from:
6205 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6206 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6207 */
6208message MediametricsNuPlayerReported {
6209 optional int64 timestamp_nanos = 1;
6210 optional string package_name = 2;
6211 optional int64 package_version_code = 3;
6212 optional int64 media_apex_version = 4;
6213
6214 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6215}
6216
6217/**
Robert Shiha4beed32019-08-19 14:15:23 -07006218 * Track Legacy DRM usage
6219 * Logged from
6220 * frameworks/av/drm/drmserver/DrmManager.cpp
6221 */
6222message MediametricsDrmManagerReported {
6223 optional int64 timestamp_nanos = 1;
6224 optional string package_name = 2;
6225 optional int64 package_version_code = 3;
6226 optional int64 media_apex_version = 4;
6227
6228 enum Method {
6229 METHOD_NOT_FOUND = -1;
6230 GET_CONSTRAINTS = 0;
6231 GET_METADATA = 1;
6232 CAN_HANDLE = 2;
6233 PROCESS_DRM_INFO = 3;
6234 ACQUIRE_DRM_INFO = 4;
6235 SAVE_RIGHTS = 5;
6236 GET_ORIGINAL_MIME_TYPE = 6;
6237 GET_DRM_OBJECT_TYPE = 7;
6238 CHECK_RIGHTS_STATUS = 8;
6239 REMOVE_RIGHTS = 9;
6240 REMOVE_ALL_RIGHTS = 10;
6241 OPEN_CONVERT_SESSION = 11;
6242 OPEN_DECRYPT_SESSION = 12;
6243 }
6244
6245 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6246 optional string plugin_id = 5;
6247 optional string description = 6;
6248 optional Method method = 7;
6249 optional string mime_types = 8;
6250}
6251
6252/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006253 * State of a dangerous permission requested by a package
6254 */
6255message DangerousPermissionState {
6256 // Name of the permission
6257 optional string permission_name = 1;
6258
6259 // Uid of the package
6260 optional int32 uid = 2 [(is_uid) = true];
6261
6262 // Package requesting the permission
6263 optional string package_name = 3;
6264
6265 // If the permission is granted to the uid
6266 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006267
6268 // Permission flags as per android.content.pm.PermissionFlags
6269 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006270}
6271
Michael Groover4a0ca942019-01-24 17:41:25 -08006272/**
6273 * Logs when a package is denied access to a device identifier based on the new access requirements.
6274 *
6275 * Logged from:
6276 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6277 */
6278message DeviceIdentifierAccessDenied {
6279 // The name of the package denied access to the requested device identifier.
6280 optional string package_name = 1;
6281
6282 // The name of the device identifier method the package attempted to invoke.
6283 optional string method_name = 2;
6284
6285 // True if the package is preinstalled.
6286 optional bool is_preinstalled = 3;
6287
6288 // True if the package is privileged.
6289 optional bool is_priv_app = 4;
6290}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006291
6292/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006293 * Pulls the ongoing mainline install train version code.
6294 * Pulled from StatsCompanionService
6295 */
6296message TrainInfo {
6297 optional int64 train_version_code = 1;
6298
6299 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006300
6301 optional string train_name = 3;
6302
6303 enum Status {
6304 UNKNOWN = 0;
6305 INSTALL_REQUESTED = 1;
6306 INSTALL_STARTED = 2;
6307 INSTALL_STAGED_NOT_READY = 3;
6308 INSTALL_STAGED_READY = 4;
6309 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006310 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6311 // and INSTALL_FAILURE_COMMIT.
6312 INSTALL_FAILURE = 6 [deprecated = true];
6313 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006314 INSTALL_CANCELLED = 7;
6315 INSTALLER_ROLLBACK_REQUESTED = 8;
6316 INSTALLER_ROLLBACK_INITIATED = 9;
6317 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6318 INSTALLER_ROLLBACK_STAGED = 11;
6319 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6320 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6321 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6322 INSTALLER_ROLLBACK_SUCCESS = 15;
6323 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006324 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6325 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6326 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6327 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6328 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6329 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006330 INSTALL_FAILURE_DOWNLOAD = 23;
6331 INSTALL_FAILURE_STATE_MISMATCH = 24;
6332 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006333 }
6334 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006335}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006336
6337/**
6338 * Logs the gesture stage changed event.
6339 *
6340 * Logged from:
6341 * frameworks/base/packages/SystemUI/
6342 */
6343message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006344 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006345}
6346
6347/**
6348 * Logs the feedback type.
6349 *
6350 * Logged from:
6351 * frameworks/base/packages/SystemUI/
6352 */
6353message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006354 // Whether or not the gesture was used.
6355 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006356}
6357
6358/**
6359 * Logs the progress.
6360 *
6361 * Logged from:
6362 * frameworks/base/packages/SystemUI/
6363 */
6364message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006365 // [0,100] progress for the assist gesture.
6366 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006367}
Neil Fullerdb14b482019-02-05 19:44:44 +00006368
6369/*
6370 * Information about the time zone data on a device.
6371 */
6372message TimeZoneDataInfo {
6373 // A version identifier for the data set on device. e.g. "2018i"
6374 optional string tzdb_version = 1;
6375}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006376
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006377/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006378 * Logs the GPU stats global health information.
6379 *
6380 * Logged from:
6381 * frameworks/native/services/gpuservice/gpustats/
6382 */
6383message GpuStatsGlobalInfo {
6384 // Package name of the gpu driver.
6385 optional string driver_package_name = 1;
6386
6387 // Version name of the gpu driver.
6388 optional string driver_version_name = 2;
6389
6390 // Version code of the gpu driver.
6391 optional int64 driver_version_code = 3;
6392
6393 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6394 optional int64 driver_build_time = 4;
6395
6396 // Total count of the gl driver gets loaded.
6397 optional int64 gl_loading_count = 5;
6398
6399 // Total count of the gl driver fails to be loaded.
6400 optional int64 gl_loading_failure_count = 6;
6401
6402 // Total count of the Vulkan driver gets loaded.
6403 optional int64 vk_loading_count = 7;
6404
6405 // Total count of the Vulkan driver fails to be loaded.
6406 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006407
6408 // Api version of the system Vulkan driver.
6409 optional int32 vulkan_version = 9;
6410
6411 // Api version of the system CPU Vulkan driver.
6412 optional int32 cpu_vulkan_version = 10;
6413
6414 // Api version of the system GLES driver.
6415 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006416
6417 // Total count of the angle driver gets loaded.
6418 optional int64 angle_loading_count = 12;
6419
6420 // Total count of the angle driver fails to be loaded.
6421 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006422}
6423
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006424/**
6425 * GPU driver loading time info.
6426 */
6427message GpuDriverLoadingTime {
6428 // List of all the driver loading times for this app. The list size is
6429 // capped at 50.
6430 repeated int64 driver_loading_time = 1;
6431}
6432
6433/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006434 * Logs the GPU stats per app health information.
6435 *
6436 * Logged from:
6437 * frameworks/native/services/gpuservice/gpustats/
6438 */
6439message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006440 // Package name of the application that loads the gpu driver. Total number
6441 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006442 optional string app_package_name = 1;
6443
6444 // Version code of the gpu driver this app loads.
6445 optional int64 driver_version_code = 2;
6446
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006447 // gl driver loading time info.
6448 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6449 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006450
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006451 // Vulkan driver loading time info.
6452 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6453 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006454
6455 // Angle driver loading time info.
6456 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6457 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006458
6459 // CPU Vulkan implementation is in use.
6460 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006461
6462 // App is not doing pre-rotation correctly.
6463 optional bool false_prerotation = 7;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006464}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006465
6466/*
6467 * Logs the size of the system ion heap.
6468 *
6469 * Pulled from StatsCompanionService.
6470 */
6471message SystemIonHeapSize {
6472 // Size of the system ion heap in bytes.
6473 optional int64 size_in_bytes = 1;
6474}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006475
Rafal Slawik77987ed2019-06-17 12:28:23 +01006476/*
6477 * Logs the per-process size of the system ion heap.
6478 *
6479 * Pulled from StatsCompanionService.
6480 */
6481message ProcessSystemIonHeapSize {
6482 // The uid if available. -1 means not available.
6483 optional int32 uid = 1 [(is_uid) = true];
6484
6485 // The process name (from /proc/PID/cmdline).
6486 optional string process_name = 2;
6487
6488 // Sum of sizes of all allocations.
6489 optional int32 total_size_in_kilobytes = 3;
6490
6491 // Number of allocations.
6492 optional int32 allocation_count = 4;
6493
6494 // Size of the largest allocation.
6495 optional int32 max_size_in_kilobytes = 5;
6496}
6497
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006498/**
6499 * Push network stack events.
6500 *
6501 * Log from:
6502 * frameworks/base/packages/NetworkStack/
6503 */
6504message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006505 // The id that indicates the event reported from NetworkStack.
6506 optional int32 event_id = 1;
6507 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006508 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6509}
Carmen Agimofa769c152019-03-04 14:39:14 +00006510
6511/**
6512 * Logs the apps that are installed on the external storage.
6513 * Pulled from:
6514 * StatsCompanionService
6515 */
6516message AppsOnExternalStorageInfo {
6517 // The type of the external storage.
6518 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6519 // The name of the package that is installed on the external storage.
6520 optional string package_name = 2;
6521}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006522
6523/**
6524 * Logs the settings related to Face.
6525 * Logged from:
6526 * frameworks/base/services/core/java/com/android/server/stats
6527 */
6528message FaceSettings {
6529 // Whether or not face unlock is allowed on Keyguard.
6530 optional bool unlock_keyguard_enabled = 1;
6531 // Whether or not face unlock dismisses the Keyguard.
6532 optional bool unlock_dismisses_keyguard = 2;
6533 // Whether or not face unlock requires attention.
6534 optional bool unlock_attention_required = 3;
6535 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6536 optional bool unlock_app_enabled = 4;
6537 // Whether or not face unlock always requires user confirmation.
6538 optional bool unlock_always_require_confirmation = 5;
6539 // Whether or not a diverse set of poses are required during enrollment.
6540 optional bool unlock_diversity_required = 6;
6541}
Maggie White442b6312019-04-05 16:26:44 -07006542
6543/**
6544 * Logs cooling devices maintained by the kernel.
6545 *
6546 * Pulled from StatsCompanionService.java
6547 */
6548message CoolingDevice {
6549 // The type of cooling device being reported. Eg. CPU, GPU...
6550 optional android.os.CoolingTypeEnum device_location = 1;
6551 // The name of the cooling device source. Eg. CPU0
6552 optional string device_name = 2;
6553 // Current throttle state of the cooling device. The value can any unsigned
6554 // integer between 0 and max_state defined in its driver. 0 means device is
6555 // not in throttling, higher value means deeper throttling.
6556 optional int32 state = 3;
6557}
Ben Blount763a5d52019-04-10 11:48:58 -07006558
6559/**
6560 * Intelligence has several counter-type events that don't warrant a
6561 * full separate atom. These are primarily API call counters but also include
6562 * counters for feature usage and specific failure modes.
6563 *
6564 * Logged from the Intelligence mainline module.
6565 */
6566message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07006567 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07006568 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07006569 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07006570 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07006571 // How many times the event occured (to report a batch of high frequency events).
6572 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07006573 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07006574 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07006575}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006576
6577/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006578 * Logs when Car Power state changed.
6579 *
6580 * Logged from:
6581 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6582 */
6583message CarPowerStateChanged {
6584 // States come from CpmsState in CarPowerManagementService.java.
6585 enum State {
6586 WAIT_FOR_VHAL = 0;
6587 ON = 1;
6588 SHUTDOWN_PREPARE = 2;
6589 WAIT_FOR_FINISH = 3;
6590 SUSPEND = 4;
6591 SIMULATE_SLEEP = 5;
6592 }
6593 optional State state = 1;
6594}
6595
6596/**
6597 * Logs whether GarageMode is entered.
6598 *
6599 * Logged from:
6600 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6601 */
6602message GarageModeInfo {
6603 // Whether GarageMode is entered.
6604 optional bool is_garage_mode = 1;
6605}
Martijn Coenencd95d462019-04-25 17:09:45 +02006606
6607/**
6608 * Historical app ops data per package.
6609 */
6610message AppOps {
6611 // Uid of the package requesting the op
6612 optional int32 uid = 1 [(is_uid) = true];
6613
6614 // Nmae of the package performing the op
6615 optional string package_name = 2;
6616
6617 // operation id; maps to the OP_* constants in AppOpsManager.java
6618 optional int32 op_id = 3;
6619
6620 // The number of times the op was granted while the app was in the
6621 // foreground (only for trusted requests)
6622 optional int64 trusted_foreground_granted_count = 4;
6623
6624 // The number of times the op was granted while the app was in the
6625 // background (only for trusted requests)
6626 optional int64 trusted_background_granted_count = 5;
6627
6628 // The number of times the op was rejected while the app was in the
6629 // foreground (only for trusted requests)
6630 optional int64 trusted_foreground_rejected_count = 6;
6631
6632 // The number of times the op was rejected while the app was in the
6633 // background (only for trusted requests)
6634 optional int64 trusted_background_rejected_count = 7;
6635
6636 // For long-running operations, total duration of the operation
6637 // while the app was in the foreground (only for trusted requests)
6638 optional int64 trusted_foreground_duration_millis = 8;
6639
6640 // For long-running operations, total duration of the operation
6641 // while the app was in the background (only for trusted requests)
6642 optional int64 trusted_background_duration_millis = 9;
6643}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006644
6645/**
6646 * Location Manager API Usage information(e.g. API under usage,
6647 * API call's parameters).
6648 * Logged from:
6649 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6650 */
6651message LocationManagerApiUsageReported {
6652
6653 // Indicating if usage starts or usage ends.
6654 optional android.stats.location.UsageState state = 1;
6655
6656 // LocationManagerService's API in use.
6657 // We can identify which API from LocationManager is
6658 // invoking current LMS API by the combination of
6659 // API parameter(e.g. is_listener_null, is_intent_null,
6660 // is_location_request_null)
6661 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6662
6663 // Name of the package calling the API.
6664 optional string calling_package_name = 3;
6665
6666 // Type of the location provider.
6667 optional android.stats.location.ProviderType provider = 4;
6668
6669 // Quality of the location request
6670 optional android.stats.location.LocationRequestQuality quality = 5;
6671
6672 // The desired interval for active location updates, in milliseconds.
6673 // Bucketized to reduce cardinality.
6674 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6675
6676 // Minimum distance between location updates, in meters.
6677 // Bucketized to reduce cardinality.
6678 optional android.stats.location.SmallestDisplacementBucket
6679 bucketized_smallest_displacement = 7;
6680
6681 // The number of location updates.
6682 optional int64 num_updates = 8;
6683
6684 // The request expiration time, in millisecond since boot.
6685 // Bucketized to reduce cardinality.
6686 optional android.stats.location.ExpirationBucket
6687 bucketized_expire_in = 9;
6688
6689 // Type of Callback passed in for this API.
6690 optional android.stats.location.CallbackType callback_type = 10;
6691
6692 // The radius of the central point of the alert
6693 // region, in meters. Only for API REQUEST_GEOFENCE.
6694 // Bucketized to reduce cardinality.
6695 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6696
6697 // Activity Importance of API caller.
6698 // Categorized to 3 types that are interesting from location's perspective.
6699 optional android.stats.location.ActivityImportance activiy_importance = 12;
6700}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006701
6702/**
6703 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6704 */
6705message ReviewPermissionsFragmentResultReported {
6706 // unique value identifying a permission group change. A permission group change might result
6707 // in multiple of these atoms
6708 optional int64 change_id = 1;
6709
6710 // UID of package the permission belongs to
6711 optional int32 uid = 2 [(is_uid) = true];
6712
6713 // Name of package the permission belongs to
6714 optional string package_name = 3;
6715
6716 // The permission to be granted
6717 optional string permission_name = 4;
6718
6719 // The result of the permission grant
6720 optional bool permission_granted = 5;
6721}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006722
6723/**
6724* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6725* Logged from: RuntimePermissionUpdgradeController
6726*/
6727message RuntimePermissionsUpgradeResult {
6728 // Permission granted as result of upgrade
6729 optional string permission_name = 1;
6730
6731 // UID of package granted permission
6732 optional int32 uid = 2 [(is_uid) = true];
6733
6734 // Name of package granted permission
6735 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006736}
6737
6738/**
6739* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6740*/
6741message GrantPermissionsActivityButtonActions {
6742 // Permission granted as result of upgrade
6743 optional string permission_group_name = 1;
6744
6745 // UID of package granted permission
6746 optional int32 uid = 2 [(is_uid) = true];
6747
6748 // Name of package requesting permission
6749 optional string package_name = 3;
6750
6751 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6752 // LABEL_ constants in GrantPermissionActivity.java
6753 optional int32 buttons_presented = 4;
6754
6755 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6756 optional int32 button_clicked = 5;
6757}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006758
6759/**
6760 * Information about LocationAccessCheck notification presented to user
6761 */
6762message LocationAccessCheckNotificationAction {
6763
6764 // id which identifies single session of user interacting with permission controller
6765 optional int64 session_id = 1;
6766
6767 // Uid of package for which location access check is presented
6768 optional int32 package_uid = 2;
6769
6770 // Name of package for which location access check is presented
6771 optional string package_name = 3;
6772
6773 enum Result {
6774 UNDEFINED = 0;
6775 // notification was presented to the user
6776 NOTIFICATION_PRESENTED = 1;
6777 // notification was declined by the user
6778 NOTIFICATION_DECLINED = 2;
6779 // notification was clicked by the user
6780 NOTIFICATION_CLICKED = 3;
6781 }
6782
6783 // View / interaction recorded
6784 optional Result result = 4;
6785}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006786
6787/**
6788 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6789 */
6790message AppPermissionFragmentActionReported {
6791 // id which identifies single session of user interacting with permission controller
6792 optional int64 session_id = 1;
6793
6794 // unique value identifying a permission group change. A permission group change might result
6795 // in multiple of these atoms
6796 optional int64 change_id = 2;
6797
6798 // UID of package the permission belongs to
6799 optional int32 uid = 3 [(is_uid) = true];
6800
6801 // Name of package the permission belongs to
6802 optional string package_name = 4;
6803
6804 // The permission to be granted
6805 optional string permission_name = 5;
6806
6807 // The result of the permission grant
6808 optional bool permission_granted = 6;
6809}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01006810
6811/**
6812* Information about a AppPermissionFragment viewed by user
6813*/
6814message AppPermissionFragmentViewed {
6815 // id which identifies single session of user interacting with permission controller
6816 optional int64 session_id = 1;
6817
6818 // UID of package for which permissions are viewed
6819 optional int32 uid = 2 [(is_uid) = true];
6820
6821 // Name of package for which permissions are viewed
6822 optional string package_name = 3;
6823
6824 // Permission group viewed
6825 optional string permission_group_name = 4;
6826}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01006827
6828/**
6829* Information about a AppPermissionsFragment viewed by user
6830*/
6831message AppPermissionsFragmentViewed {
6832 // id which identifies single session of user interacting with permission controller
6833 optional int64 session_id = 1;
6834
6835 // id which identifies single view as every view might have several logging records
6836 // with different package information attached
6837 optional int64 view_id = 2;
6838
6839 // Permission group viewed
6840 optional string permission_group_name = 3;
6841
6842 // UID of package for which permissions are viewed
6843 optional int32 uid = 4 [(is_uid) = true];
6844
6845 // Name of package for which permissions are viewed
6846 optional string package_name = 5;
6847
6848 // Category in which permission is included
6849 enum Category {
6850 UNDEFINED = 0;
6851 ALLOWED = 1;
6852 ALLOWED_FOREGROUND = 2;
6853 DENIED = 3;
6854 }
6855 optional Category category = 6;
6856}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01006857
6858/**
6859* Information about a PermissionAppsFragment viewed by user.
6860* Logged from ui/handheld/PermissionAppsFragment.java
6861*/
6862message PermissionAppsFragmentViewed {
6863 // id which identifies single session of user interacting with permission controller
6864 optional int64 session_id = 1;
6865
6866 // id which identifies single view as every view might have several logging records
6867 // with different package information attached
6868 optional int64 view_id = 2;
6869
6870 // Permission group viewed
6871 optional string permission_group_name = 3;
6872
6873 // UID of package for which permissions are viewed
6874 optional int32 uid = 4 [(is_uid) = true];
6875
6876 // Name of package for which permissions are viewed
6877 optional string package_name = 5;
6878
6879 // Category in which app is included
6880 enum Category {
6881 UNDEFINED = 0;
6882 ALLOWED = 1;
6883 ALLOWED_FOREGROUND = 2;
6884 DENIED = 3;
6885 }
6886 optional Category category = 6;
6887}
Tony Make2b1b672019-07-29 16:59:47 +01006888
6889/**
6890 * Logs when there is a smart selection related event.
6891 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6892 * Logged from: TextClassifierEventLogger.java
6893 */
6894message TextSelectionEvent {
6895 // A session ID.
6896 optional string session_id = 1;
6897
6898 // Event type of this event.
6899 optional android.stats.textclassifier.EventType event_type = 2;
6900
6901 // Name of the model that is involved in this event.
6902 optional string model_name = 3;
6903
6904 // Type of widget that was involved in triggering this event.
6905 optional android.stats.textclassifier.WidgetType widget_type = 4;
6906
6907 // Index of this event in a session.
6908 optional int32 event_index = 5;
6909
6910 // Entity type that is involved.
6911 optional string entity_type = 6;
6912
6913 // Relative word index of the start of the selection.
6914 optional int32 relative_word_start_index = 7;
6915
6916 // Relative word (exclusive) index of the end of the selection.
6917 optional int32 relative_word_end_index = 8;
6918
6919 // Relative word index of the start of the smart selection.
6920 optional int32 relative_suggested_word_start_index = 9;
6921
6922 // Relative word (exclusive) index of the end of the smart selection.
6923 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01006924
6925 // Name of source package.
6926 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01006927}
6928
6929/**
6930 * Logs when there is a smart linkify related event.
6931 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6932 * Logged from: TextClassifierEventLogger.java
6933 */
6934message TextLinkifyEvent {
6935 // A session ID.
6936 optional string session_id = 1;
6937
6938 // Event type of this event.
6939 optional android.stats.textclassifier.EventType event_type = 2;
6940
6941 // Name of the model that is involved in this event.
6942 optional string model_name = 3;
6943
6944 // Type of widget that was involved in triggering this event.
6945 optional android.stats.textclassifier.WidgetType widget_type = 4;
6946
6947 // Index of this event in a session.
6948 optional int32 event_index = 5;
6949
6950 // Entity type that is involved.
6951 optional string entity_type = 6;
6952
6953 // Number of links detected.
6954 optional int32 num_links = 7;
6955
6956 // The total length of all links.
6957 optional int32 linked_text_length = 8;
6958
6959 // Length of input text.
6960 optional int32 text_length = 9;
6961
6962 // Time spent on generating links in ms.
6963 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01006964
6965 // Name of source package.
6966 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01006967}
6968
6969/**
6970 * Logs when there is a conversation actions related event.
6971 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6972 * Logged from: TextClassifierEventLogger.java
6973 */
6974message ConversationActionsEvent {
6975 // A session ID.
6976 optional string session_id = 1;
6977
6978 // Event type of this event.
6979 optional android.stats.textclassifier.EventType event_type = 2;
6980
6981 // Name of the model that is involved in this event.
6982 optional string model_name = 3;
6983
6984 // Type of widget that was involved in triggering this event.
6985 optional android.stats.textclassifier.WidgetType widget_type = 4;
6986
6987 // The first entity type that is involved.
6988 optional string first_entity_type = 5;
6989
6990 // The second entity type that is involved.
6991 optional string second_entity_type = 6;
6992
6993 // The third entity type that is involved.
6994 optional string third_entity_type = 7;
6995
6996 // The score of the first entity type.
6997 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01006998
6999 // Name of source package.
7000 optional string package_name = 9;
Tony Make2b1b672019-07-29 16:59:47 +01007001}
7002
7003/**
7004 * Logs when there is a language detection related event.
7005 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7006 * Logged from: TextClassifierEventLogger.java
7007 */
7008message LanguageDetectionEvent {
7009 // A session ID.
7010 optional string session_id = 1;
7011
7012 // Event type of this event.
7013 optional android.stats.textclassifier.EventType event_type = 2;
7014
7015 // Name of the model that is involved in this event.
7016 optional string model_name = 3;
7017
7018 // Type of widget that was involved in triggering this event.
7019 optional android.stats.textclassifier.WidgetType widget_type = 4;
7020
7021 // Detected language.
7022 optional string language_tag = 5;
7023
7024 // Score of the detected language.
7025 optional float score = 6;
7026
7027 // Position of this action.
7028 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007029
7030 // Name of source package.
7031 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007032}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007033
7034/**
7035 * Information about an OTA update attempt by update_engine.
7036 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7037 */
7038message UpdateEngineUpdateAttemptReported {
7039 // The number of attempts for the update engine to apply a given payload.
7040 optional int32 attempt_number = 1;
7041
7042 optional android.stats.otaupdate.PayloadType payload_type = 2;
7043
7044 // The total time in minutes for the update engine to apply a given payload.
7045 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7046 // it's increased when the system is sleeping.
7047 optional int32 duration_boottime_in_minutes = 3;
7048
7049 // The total time in minutes for the update engine to apply a given payload.
7050 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7051 // and it's not increased when the system is sleeping.
7052 optional int32 duration_monotonic_in_minutes = 4;
7053
7054 // The size of the payload in MiBs.
7055 optional int32 payload_size_mib = 5;
7056
7057 // The attempt result reported by the update engine for an OTA update.
7058 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7059
7060 // The error code reported by the update engine after an OTA update attempt
7061 // on A/B devices.
7062 optional android.stats.otaupdate.ErrorCode error_code = 7;
7063
7064 // The build fingerprint of the source system. The value is read from a
7065 // system property when the device takes the update. e.g.
7066 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7067 optional string source_fingerprint = 8;
7068}
7069
7070/**
7071 * Information about all the attempts the device make before finishing the
7072 * successful update.
7073 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7074 */
7075message UpdateEngineSuccessfulUpdateReported {
7076 // The number of attempts for the update engine to apply the payload for a
7077 // successful update.
7078 optional int32 attempt_count = 1;
7079
7080 optional android.stats.otaupdate.PayloadType payload_type = 2;
7081
7082 optional int32 payload_size_mib = 3;
7083
7084 // The total number of bytes downloaded by update_engine since the last
7085 // successful update.
7086 optional int32 total_bytes_downloaded_mib = 4;
7087
7088 // The ratio in percentage of the over-downloaded bytes compared to the
7089 // total bytes needed to successfully install the update. e.g. 200 if we
7090 // download 200MiB in total for a 100MiB package.
7091 optional int32 download_overhead_percentage = 5;
7092
7093 // The total time in minutes for the update engine to apply the payload for a
7094 // successful update.
7095 optional int32 total_duration_minutes = 6;
7096
7097 // The number of reboot of the device during a successful update.
7098 optional int32 reboot_count = 7;
7099}
Alec Mourie088e762019-07-02 13:10:55 -07007100
7101/**
7102 * Global display pipeline metrics reported by SurfaceFlinger.
7103 * Pulled from:
7104 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7105 */
7106message SurfaceflingerStatsGlobalInfo {
7107 // Total number of frames presented during the tracing period
7108 optional int64 total_frames = 1;
7109 // Total number of frames missed
7110 optional int64 missed_frames = 2;
7111 // Total number of frames that fell back to client composition
7112 optional int64 client_composition_frames = 3;
7113 // Total time the display was turned on
7114 optional int64 display_on_millis = 4;
7115 // Total time that was spent performing animations.
7116 // This is derived from the present-to-present layer histogram
7117 optional int64 animation_millis = 5;
7118}
7119
7120/**
7121 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7122 * The number of layers uploaded will be restricted due to size limitations.
7123 * Pulled from:
7124 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7125 */
7126message SurfaceflingerStatsLayerInfo {
7127 // The layer for this set of metrics
7128 // For now we can infer that the package name is included in the layer
7129 // name.
7130 optional string layer_name = 1;
7131 // Total number of frames presented
7132 optional int64 total_frames = 2;
7133 // Total number of dropped frames while latching a buffer for this layer.
7134 optional int64 dropped_frames = 3;
7135 // Set of timings measured between successive presentation timestamps.
7136 optional FrameTimingHistogram present_to_present = 4
7137 [(android.os.statsd.log_mode) = MODE_BYTES];
7138 // Set of timings measured from when an app queued a buffer for
7139 // presentation, until the buffer was actually presented to the
7140 // display.
7141 optional FrameTimingHistogram post_to_present = 5
7142 [(android.os.statsd.log_mode) = MODE_BYTES];
7143 // Set of timings measured from when a buffer is ready to be presented,
7144 // until the buffer was actually presented to the display.
7145 optional FrameTimingHistogram acquire_to_present = 6
7146 [(android.os.statsd.log_mode) = MODE_BYTES];
7147 // Set of timings measured from when a buffer was latched by
7148 // SurfaceFlinger, until the buffer was presented to the display
7149 optional FrameTimingHistogram latch_to_present = 7
7150 [(android.os.statsd.log_mode) = MODE_BYTES];
7151 // Set of timings measured from the desired presentation to the actual
7152 // presentation time
7153 optional FrameTimingHistogram desired_to_present = 8
7154 [(android.os.statsd.log_mode) = MODE_BYTES];
7155 // Set of timings measured from when an app queued a buffer for
7156 // presentation, until the buffer was ready to be presented.
7157 optional FrameTimingHistogram post_to_acquire = 9
7158 [(android.os.statsd.log_mode) = MODE_BYTES];
7159}
7160
7161/**
7162 * Histogram of frame counts bucketed by time in milliseconds.
7163 * Because of size limitations, we hard-cap the number of buckets, with
7164 * buckets for corresponding to larger milliseconds being less precise.
7165 */
7166message FrameTimingHistogram {
7167 // Timings in milliseconds that describes a set of histogram buckets
7168 repeated int32 time_millis_buckets = 1;
7169 // Number of frames that match to each time_millis, i.e. the bucket
7170 // contents
7171 // It's required that len(time_millis) == len(frame_count)
7172 repeated int64 frame_counts = 2;
7173}
Emilian Peev6729f372019-08-29 09:14:09 -07007174
Emilian Peev6729f372019-08-29 09:14:09 -07007175/**
7176 * Information about camera facing and API level usage.
7177 * Logged from:
7178 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7179 */
7180message CameraActionEvent {
7181 // Camera session duration
7182 optional int64 duration = 1;
7183
7184 // Camera API level used
7185 optional int32 api_level = 2;
7186
7187 // Name of client package
7188 optional string package_name = 3;
7189
7190 // Camera facing
7191 enum Facing {
7192 UNKNOWN = 0;
7193 BACK = 1;
7194 FRONT = 2;
7195 EXTERNAL = 3;
7196 }
7197 optional Facing facing = 4;
7198}
atrost01a20932019-08-28 15:40:37 +01007199
7200/**
7201 * Logs when a compatibility change is affecting an app.
7202 *
7203 * Logged from:
7204 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7205 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7206 */
7207message AppCompatibilityChangeReported {
7208 // The UID of the app being affected by the compatibilty change.
7209 optional int32 uid = 1 [(is_uid) = true];
7210
7211 // The ID of the change affecting the app.
7212 optional int64 change_id = 2;
7213
7214 enum State {
7215 UNKNOWN_STATE = 0;
7216 ENABLED = 1;
7217 DISABLED = 2;
7218 LOGGED = 3;
7219 }
7220
7221 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7222 // logged otherwise.
7223 optional State state = 3;
7224
7225 enum Source {
7226 UNKNOWN_SOURCE = 0;
7227 APP_PROCESS = 1;
7228 SYSTEM_SERVER = 2;
7229 }
7230
7231 // Where it was logged from.
7232 optional Source source = 4;
7233
7234}