blob: 93f700cc6490b87acf33b1ea2fa05edb7686b6d2 [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";
Fan Zhangf837b8e2018-10-23 12:38:30 -070025import "frameworks/base/core/proto/android/app/settings_enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070026import "frameworks/base/core/proto/android/app/job/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080027import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080028import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080029import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080030import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080031import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080032import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080033import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080034import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080035import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080036import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080037import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070038import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080039import "frameworks/base/core/proto/android/service/usb.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070040import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080041import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070042import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080043import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080044import "frameworks/base/core/proto/android/telephony/enums.proto";
45import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000046import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
47import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080048
Yao Chend54f9dd2017-10-17 17:37:48 +000049/**
Stefan Lafonae2df012017-11-14 09:17:21 -080050 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000051 * raw stats log events from the Android system, also known as "atoms."
52 *
53 * This field contains a single oneof with all of the available messages.
54 * The stats-log-api-gen tool runs as part of the Android build and
55 * generates the android.util.StatsLog class, which contains the constants
56 * and methods that Android uses to log.
57 *
Stefan Lafonae2df012017-11-14 09:17:21 -080058 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000059 * Instead, statsd on Android constructs these messages synthetically,
60 * in the format defined here and in stats_log.proto.
61 */
Stefan Lafonae2df012017-11-14 09:17:21 -080062message Atom {
63 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070064 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070065 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
66 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070067 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070068 BleScanResultReceived ble_scan_result_received = 4;
69 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080070 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070071 SyncStateChanged sync_state_changed = 7;
72 ScheduledJobStateChanged scheduled_job_state_changed = 8;
73 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070074 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080075 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
76 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
77 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070078 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
79 MemoryFactorStateChanged memory_factor_state_changed = 15;
80 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
81 CachedKillReported cached_kill_reported = 17;
82 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070083 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080084 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
85 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
86 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070087 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080088 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070089 CameraStateChanged camera_state_changed = 25;
90 FlashlightStateChanged flashlight_state_changed = 26;
91 UidProcessStateChanged uid_process_state_changed = 27;
92 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
93 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070094 BatteryLevelChanged battery_level_changed = 30;
95 ChargingStateChanged charging_state_changed = 31;
96 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070097 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -080098 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -070099 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
100 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700101 WifiLockStateChanged wifi_lock_state_changed = 37;
102 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
103 WifiScanStateChanged wifi_scan_state_changed = 39;
104 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700105 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700106 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700107 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900108 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700109 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800110 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800111 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800112 AppStartOccurred app_start_occurred = 48;
113 AppStartCanceled app_start_canceled = 49;
114 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800115 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800116 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800117 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800118 LmkStateChanged lmk_state_changed = 54;
119 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800120 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800121 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800122 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800123 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800124 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800125 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800126 KeyguardStateChanged keyguard_state_changed = 62;
127 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
128 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800129 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800130 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800131 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
132 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800133 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700134 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800135 SpeakerImpedanceReported speaker_impedance_reported = 71;
136 HardwareFailed hardware_failed = 72;
137 PhysicalDropDetected physical_drop_detected = 73;
138 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800139 MobileConnectionStateChanged mobile_connection_state_changed = 75;
140 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700141 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800142 AppCrashOccurred app_crash_occurred = 78;
143 ANROccurred anr_occurred = 79;
144 WTFOccurred wtf_occurred = 80;
145 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700146 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700147 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700148 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700149 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700150 ThermalThrottlingStateChanged thermal_throttling = 86;
Kevin Chyn1741a072019-01-17 11:54:40 -0800151 BiometricAcquired biometric_acquired = 87;
152 BiometricAuthenticated biometric_authenticated = 88;
153 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700154 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700155 BatteryHealthSnapshot battery_health_snapshot = 91;
156 SlowIo slow_io = 92;
157 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700158 PhoneServiceStateChanged phone_service_state_changed = 94;
159 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100160 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700161 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700162 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700163 // TODO: service state change is very noisy shortly after boot, as well
164 // as at other transitions - coming out of doze, device plugged in, etc.
165 // Consider removing this if it becomes a problem
166 ServiceStateChanged service_state_changed = 99;
167 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800168 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800169 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000170 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800171 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
172 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
173 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
174 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
175 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
176 DocsUILaunchReported docs_ui_launch_reported = 109;
177 DocsUIRootVisitedReported docs_ui_root_visited = 110;
178 DocsUIStartupMsReported docs_ui_startup_ms = 111;
179 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800180 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
181 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000182 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800183 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800184 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
185 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
186 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
187 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800188 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000189 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000190 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800191 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800192 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800193 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
194 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000195 AppDowngraded app_downgraded = 128;
196 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
197 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800198 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
199 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800200 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800201 NfcErrorOccurred nfc_error_occurred = 134;
202 NfcStateChanged nfc_state_changed = 135;
203 NfcBeamOccurred nfc_beam_occurred = 136;
204 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
205 NfcTagOccurred nfc_tag_occurred = 138;
206 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
207 SeStateChanged se_state_changed = 140;
208 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800209 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800210 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800211 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800212 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800213 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800214 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyn1741a072019-01-17 11:54:40 -0800215 BiometricHalDeathReported biometric_hal_death_reported = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500216 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800217 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Yao Chend54f9dd2017-10-17 17:37:48 +0000218 }
David Chenc8a43242017-10-17 16:23:28 -0700219
David Chen6e3e6cb2018-01-03 16:14:06 -0800220 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000221 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700222 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800223 WifiBytesTransfer wifi_bytes_transfer = 10000;
224 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
225 MobileBytesTransfer mobile_bytes_transfer = 10002;
226 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800227 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800228 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800229 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800230 CpuTimePerFreq cpu_time_per_freq = 10008;
231 CpuTimePerUid cpu_time_per_uid = 10009;
232 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800233 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800234 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800235 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800236 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800237 SystemElapsedRealtime system_elapsed_realtime = 10014;
238 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800239 CpuActiveTime cpu_active_time = 10016;
240 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000241 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800242 RemainingBatteryCapacity remaining_battery_capacity = 10019;
243 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800244 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100245 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100246 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100247 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000248 DiskStats disk_stats = 10025;
249 DirectoryUsage directory_usage = 10026;
250 AppSize app_size = 10027;
251 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700252 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700253 BatteryVoltage battery_voltage = 10030;
Kevin Chyn1741a072019-01-17 11:54:40 -0800254 NumBiometricsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700255 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700256 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800257 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700258 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100259 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100260 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700261 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800262 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
263 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
264 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000265 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800266 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800267 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800268 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000269 DebugElapsedClock debug_elapsed_clock = 10046;
270 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
Kevin Chyn1741a072019-01-17 11:54:40 -0800271 NumBiometricsEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800272 RoleHolder role_holder = 10049;
David Chenc8a43242017-10-17 16:23:28 -0700273 }
yroa1fe77c2018-02-26 14:22:54 -0800274
Bookatz76aafcf2018-09-17 16:17:10 -0700275 // DO NOT USE field numbers above 100,000 in AOSP.
276 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
277 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700278}
279
Yao Chend54f9dd2017-10-17 17:37:48 +0000280/**
Yangster-mac20877162017-12-22 17:19:39 -0800281 * This proto represents a node of an attribution chain.
282 * Note: All attribution chains are represented as a repeated field of type
283 * AttributionNode. It is understood that in such arrays, the order is that
284 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000285 */
Yangster-mac20877162017-12-22 17:19:39 -0800286message AttributionNode {
287 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800288 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800289
Yangster-mac20877162017-12-22 17:19:39 -0800290 // The (optional) string tag for an element in the attribution chain. If the
291 // element has no tag, it is encoded as an empty string.
292 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700293}
294
Yangster-mac48b3d622018-08-18 12:38:11 -0700295message KeyValuePair {
296 optional int32 key = 1;
297 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700298 int32 value_int = 2;
299 int64 value_long = 3;
300 string value_str = 4;
301 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700302 }
303}
304
305message KeyValuePairsAtom {
306 optional int32 uid = 1;
307 repeated KeyValuePair pairs = 2;
308}
309
Yao Chend54f9dd2017-10-17 17:37:48 +0000310/*
311 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800312 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000313 *
314 * RULES:
315 * - The field ids for each atom must start at 1, and count upwards by 1.
316 * Skipping field ids is not allowed.
317 * - These form an API, so renaming, renumbering or removing fields is
318 * not allowed between android releases. (This is not currently enforced,
319 * but there will be a tool to enforce this restriction).
320 * - The types must be built-in protocol buffer types, namely, no sub-messages
321 * are allowed (yet). The bytes type is also not allowed.
322 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800323 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000324 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800325 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000326 * - A field that is a uid should be a string field, tagged with the [xxx]
327 * annotation. The generated code on android will be represented by UIDs,
328 * and those UIDs will be translated in xxx to those strings.
329 *
330 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700331 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000332 * - If there is a UID, it goes first. Think in an object-oriented fashion.
333 * *****************************************************************************
334 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700335
Yao Chend54f9dd2017-10-17 17:37:48 +0000336/**
Yangster-mace16189a2018-08-26 12:20:16 -0700337 * Logs when the Thermal service HAL notifies the throttling start/stop events.
338 *
339 * Logged from:
340 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
341 */
342message ThermalThrottlingStateChanged {
343 optional android.os.TemperatureTypeEnum sensor_type = 1;
344
345 enum State {
346 UNKNOWN = 0;
347 START = 1;
348 STOP = 2;
349 }
350
351 optional State state = 2;
352
353 optional float temperature = 3;
354}
355
356/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000357 * Logs when the screen state changes.
358 *
359 * Logged from:
360 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
361 */
362message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800363 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700364 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700365}
Yao Chend54f9dd2017-10-17 17:37:48 +0000366
367/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700368 * Logs that the process state of the uid, as determined by ActivityManager
369 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000370 *
371 * Logged from:
372 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
373 */
Bookatzc1a050a2017-10-10 15:49:28 -0700374message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700375 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000376
Bookatzdb026a22018-01-10 19:01:56 -0800377 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700378 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000379}
380
381/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700382 * Logs process state change of a process, as per the activity manager.
383 *
384 * Logged from:
385 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
386 */
387message ProcessStateChanged {
388 optional int32 uid = 1;
389 optional string process_name = 2;
390 optional string package_name = 3;
391 // TODO: remove this when validation is done
392 optional int64 version = 5;
393 // The state, from frameworks/base/core/proto/android/app/enums.proto.
394 optional android.app.ProcessStateEnum state = 4;
395}
396
397/**
398 * Logs when ActivityManagerService sleep state is changed.
399 *
400 * Logged from:
401 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
402 */
403message ActivityManagerSleepStateChanged {
404 // TODO: import frameworks proto
405 enum State {
406 UNKNOWN = 0;
407 ASLEEP = 1;
408 AWAKE = 2;
409 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700410 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700411}
412
413/**
414 * Logs when system memory state changes.
415 *
416 * Logged from:
417 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
418 */
419message MemoryFactorStateChanged {
420 // TODO: import frameworks proto
421 enum State {
422 MEMORY_UNKNOWN = 0;
423 NORMAL = 1; // normal.
424 MODERATE = 2; // moderate memory pressure.
425 LOW = 3; // low memory.
426 CRITICAL = 4; // critical memory.
427
428 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700429 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700430}
431
432/**
433 * Logs when app is using too much cpu, according to ActivityManagerService.
434 *
435 * Logged from:
436 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
437 */
438message ExcessiveCpuUsageReported {
439 optional int32 uid = 1;
440 optional string process_name = 2;
441 optional string package_name = 3;
442 // package version. TODO: remove this when validation is done
443 optional int64 version = 4;
444}
445
446/**
447 * Logs when a cached process is killed, along with its pss.
448 *
449 * Logged from:
450 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
451 */
452message CachedKillReported {
453 optional int32 uid = 1;
454 optional string process_name = 2;
455 optional string package_name = 3;
456 // TODO: remove this when validation is done
457 optional int64 version = 5;
458 optional int64 pss = 4;
459}
460
461/**
462 * Logs when memory stats of a process is reported.
463 *
464 * Logged from:
465 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
466 */
467message ProcessMemoryStatReported {
468 optional int32 uid = 1;
469 optional string process_name = 2;
470 optional string package_name = 3;
471 //TODO: remove this when validation is done
472 optional int64 version = 9;
473 optional int64 pss = 4;
474 optional int64 uss = 5;
475 optional int64 rss = 6;
476 enum Type {
477 ADD_PSS_INTERNAL_SINGLE = 0;
478 ADD_PSS_INTERNAL_ALL_MEM = 1;
479 ADD_PSS_INTERNAL_ALL_POLL = 2;
480 ADD_PSS_EXTERNAL = 3;
481 ADD_PSS_EXTERNAL_SLOW = 4;
482 }
483 optional Type type = 7;
484 optional int64 duration = 8;
485}
486
487/**
Bookatzc1a050a2017-10-10 15:49:28 -0700488 * Logs that a process started, finished, crashed, or ANRed.
489 *
490 * Logged from:
491 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
492 */
493message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700494 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700495
David Chen0b5c90c2018-01-25 16:51:49 -0800496 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800497 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700498
Bookatzddccf0a2017-11-28 16:48:14 -0800499 // What lifecycle state the process changed to.
500 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800501 enum State {
502 FINISHED = 0;
503 STARTED = 1;
504 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800505 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800506 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700507}
508
Bookatzc1a050a2017-10-10 15:49:28 -0700509/**
510 * Logs when the ble scan state changes.
511 *
512 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700513 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700514 */
515message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800516 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700517
518 enum State {
519 OFF = 0;
520 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700521 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
522 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700523 }
524 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700525
Bookatze5ec0b42018-03-26 13:34:56 -0700526 // Does the scan have a filter.
527 optional bool is_filtered = 3;
528 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
529 optional bool is_first_match = 4;
530 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
531 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700532}
533
534/**
535 * Logs reporting of a ble scan finding results.
536 *
537 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700538 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700539 */
Bookatzae6738e2018-09-13 11:38:56 -0700540// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700541message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800542 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700543
544 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800545 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700546}
547
548/**
549 * Logs when a sensor state changes.
550 *
551 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700552 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700553 */
554message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800555 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700556
Bookatzc1a050a2017-10-10 15:49:28 -0700557 // The id (int) of the sensor.
558 optional int32 sensor_id = 2;
559
560 enum State {
561 OFF = 0;
562 ON = 1;
563 }
564 optional State state = 3;
565}
566
Bookatzc1a050a2017-10-10 15:49:28 -0700567/**
568 * Logs when GPS state changes.
569 *
570 * Logged from:
571 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
572 */
573message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800574 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700575
576 enum State {
577 OFF = 0;
578 ON = 1;
579 }
580 optional State state = 2;
581}
582
Bookatz48d362e2018-11-06 15:49:08 -0800583/**
584 * Logs when GPS signal quality.
585 *
586 * Logged from:
587 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
588 */
589message GpsSignalQualityChanged {
590 optional android.server.location.GpsSignalQualityEnum level = 1;
591}
592
Bookatzc1a050a2017-10-10 15:49:28 -0700593
594/**
595 * Logs when a sync manager sync state changes.
596 *
597 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700598 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700599 */
600message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800601 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700602
David Chen0b5c90c2018-01-25 16:51:49 -0800603 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800604 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700605
606 enum State {
607 OFF = 0;
608 ON = 1;
609 }
610 optional State state = 3;
611}
612
Yangster-mac96353002018-09-05 11:18:55 -0700613/*
614 * Deferred job stats.
615 *
616 * Logged from:
617 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
618*/
619message DeferredJobStatsReported {
620 repeated AttributionNode attribution_node = 1;
621
622 // Number of jobs deferred.
623 optional int32 num_jobs_deferred = 2;
624
625 // Time since the last job runs.
626 optional int64 time_since_last_job_millis = 3;
627}
628
Bookatzc1a050a2017-10-10 15:49:28 -0700629/**
630 * Logs when a job scheduler job state changes.
631 *
632 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700633 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700634 */
635message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800636 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700637
638 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800639 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700640
641 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800642 FINISHED = 0;
643 STARTED = 1;
644 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700645 }
646 optional State state = 3;
647
Tej Singh33a412b2018-03-16 18:43:59 -0700648 // The reason a job has stopped.
649 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700650 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700651 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700652}
653
654/**
655 * Logs when the audio state changes.
656 *
657 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700658 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700659 */
660message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800661 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700662
663 enum State {
664 OFF = 0;
665 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700666 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
667 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700668 }
669 optional State state = 2;
670}
671
672/**
673 * Logs when the video codec state changes.
674 *
675 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700676 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700677 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800678message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800679 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700680
681 enum State {
682 OFF = 0;
683 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700684 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
685 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700686 }
687 optional State state = 2;
688}
689
690/**
691 * Logs when the flashlight state changes.
692 *
693 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700694 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700695 */
696message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800697 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700698
699 enum State {
700 OFF = 0;
701 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700702 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
703 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700704 }
705 optional State state = 2;
706}
707
708/**
709 * Logs when the camera state changes.
710 *
711 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700712 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700713 */
714message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800715 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700716
717 enum State {
718 OFF = 0;
719 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700720 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
721 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700722 }
723 optional State state = 2;
724}
725
726/**
727 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000728 *
729 * Logged from:
730 * TODO
731 */
Bookatzd6746242017-10-24 18:39:35 -0700732message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800733 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000734
Bookatz1a1b0462018-01-12 11:47:03 -0800735 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
736 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700737 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700738
739 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
740 optional string tag = 3;
741
742 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800743 RELEASE = 0;
744 ACQUIRE = 1;
745 CHANGE_RELEASE = 2;
746 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700747 }
748 optional State state = 4;
749}
750
751/**
Bookatzc1a050a2017-10-10 15:49:28 -0700752 * Logs when a partial wakelock is considered 'long' (over 1 min).
753 *
754 * Logged from:
755 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
756 */
757message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800758 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700759
Yao Chend54f9dd2017-10-17 17:37:48 +0000760 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
761 optional string tag = 2;
762
Bookatzc1a050a2017-10-10 15:49:28 -0700763 // TODO: I have no idea what this is.
764 optional string history_tag = 3;
765
766 enum State {
767 OFF = 0;
768 ON = 1;
769 }
770 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000771}
772
Bookatzc1a050a2017-10-10 15:49:28 -0700773/**
Bookatza66083f2018-09-20 17:24:00 -0700774 * Logs when the device is interactive, according to the PowerManager Notifier.
775 *
776 * Logged from:
777 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
778 */
779message InteractiveStateChanged {
780 enum State {
781 OFF = 0;
782 ON = 1;
783 }
784 optional State state = 1;
785}
786
787/**
Bookatzc1a050a2017-10-10 15:49:28 -0700788 * Logs Battery Saver state change.
789 *
790 * Logged from:
791 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
792 */
793message BatterySaverModeStateChanged {
794 enum State {
795 OFF = 0;
796 ON = 1;
797 }
798 optional State state = 1;
799}
800
801/**
802 * Logs Doze mode state change.
803 *
804 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800805 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700806 */
807message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800808 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800809}
810
811
812/**
813 * Logs state change of Doze mode including maintenance windows.
814 *
815 * Logged from:
816 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
817 */
818message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800819 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700820}
821
822/**
823 * Logs screen brightness level.
824 *
825 * Logged from:
826 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
827 */
828message ScreenBrightnessChanged {
829 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
830 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700831}
832
833/**
834 * Logs battery level (percent full, from 0 to 100).
835 *
836 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700837 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700838 */
839message BatteryLevelChanged {
840 // Battery level. Should be in [0, 100].
841 optional int32 battery_level = 1;
842}
843
844/**
845 * Logs change in charging status of the device.
846 *
847 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700848 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700849 */
850message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800851 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
852 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700853}
854
855/**
856 * Logs whether the device is plugged in, and what power source it is using.
857 *
858 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700859 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700860 */
861message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800862 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
863 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700864}
865
Bookatz8c6571b2017-10-24 15:04:41 -0700866/**
867 * Logs when an app's wakeup alarm fires.
868 *
869 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700870 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700871 */
872message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800873 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800874
875 // Name of the wakeup alarm.
876 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700877
878 // Name of source package (for historical reasons, since BatteryStats tracked it).
879 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800880}
881
882/**
883 * Logs when an an app causes the mobile radio to change state.
884 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
885 *
886 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700887 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800888 */
889message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800890 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800891
Bookatz1a1b0462018-01-12 11:47:03 -0800892 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
893 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800894}
895
896/**
897 * Logs when an an app causes the wifi radio to change state.
898 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
899 *
900 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700901 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800902 */
903message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800904 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800905
Bookatz1a1b0462018-01-12 11:47:03 -0800906 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
907 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700908}
909
910/**
911 * Logs kernel wakeup reasons and aborts.
912 *
913 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700914 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700915 */
916message KernelWakeupReported {
917 // Name of the kernel wakeup reason (or abort).
918 optional string wakeup_reason_name = 1;
919
920 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800921 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700922}
923
924/**
Bookatzda1798c2018-12-13 14:16:00 -0800925 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800926 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800927 *
928 * Logged from:
929 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
930 */
931message WifiEnabledStateChanged {
932 enum State {
933 OFF = 0;
934 ON = 1;
935 }
936 optional State state = 1;
937}
938
939/**
940 * 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 -0800941 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
942 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800943 *
944 * Logged from:
945 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
946 */
947message WifiRunningStateChanged {
948 repeated AttributionNode attribution_node = 1;
949
950 enum State {
951 OFF = 0;
952 ON = 1;
953 }
954 optional State state = 2;
955}
956
957/**
Bookatze5885242017-10-24 20:10:31 -0700958 * Logs wifi locks held by an app.
959 *
960 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700961 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700962 */
963message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800964 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700965
966 enum State {
967 OFF = 0;
968 ON = 1;
969 }
970 optional State state = 2;
971}
972
973/**
974 * Logs wifi signal strength changes.
975 *
976 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800977 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700978 */
979message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800980 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
981 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700982}
983
984/**
985 * Logs wifi scans performed by an app.
986 *
987 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800988 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700989 */
990message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800991 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700992
993 enum State {
994 OFF = 0;
995 ON = 1;
996 }
997 optional State state = 2;
998}
999
1000/**
Tej Singh4503e102018-01-04 14:35:01 -08001001 * Logs wifi multicast locks held by an app
1002 *
1003 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001004 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001005 */
1006message WifiMulticastLockStateChanged {
1007 repeated AttributionNode attribution_node = 1;
1008
1009 enum State {
1010 OFF = 0;
1011 ON = 1;
1012 }
1013 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001014
1015 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001016}
1017
1018/**
Tej Singh1ea42892018-01-19 09:27:00 -08001019 * Logs shutdown reason and duration on next boot.
1020 *
1021 * Logged from:
1022 * frameworks/base/core/java/com/android/server/BootReceiver.java
1023 */
1024message ShutdownSequenceReported {
1025 // True if shutdown is for a reboot. Default: false if we do not know.
1026 optional bool reboot = 1;
1027
1028 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1029 optional string reason = 2;
1030
1031 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1032 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001033 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001034
1035 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001036 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001037}
1038
Tej Singh6483ea42018-01-25 17:45:49 -08001039
1040/**
1041 * Logs boot reason and duration.
1042 *
1043 * Logged from:
1044 * system/core/bootstat/bootstat.cpp
1045 */
1046message BootSequenceReported {
1047 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1048 // Default: "<EMPTY>" if not available.
1049 optional string bootloader_reason = 1;
1050
1051 // Reason for system boot. Eg. bootloader, reboot,userrequested
1052 // Default: "<EMPTY>" if not available.
1053 optional string system_reason = 2;
1054
1055 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001056 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001057
1058 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001059 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001060
1061 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001062 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001063
1064 // Time since last boot in ms. Default: 0 if not available.
1065 optional int64 time_since_last_boot = 6;
1066}
1067
Tej Singhc477d9c2018-02-05 18:31:39 -08001068
1069/**
1070 * Logs call state and disconnect cause (if applicable).
1071 *
1072 * Logged from:
1073 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1074 */
1075message CallStateChanged {
1076 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1077 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1078 optional android.telecom.CallStateEnum call_state = 1;
1079
1080 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1081 // This value is only applicable when the call_state is DISCONNECTED, and
1082 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1083 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1084 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1085
1086 // True if the call is self-managed, which are apps that use the
1087 // telecom infrastructure to make their own calls.
1088 optional bool self_managed = 3;
1089
1090 // True if call is external. External calls are calls on connected Wear
1091 // devices but show up in Telecom so the user can pull them onto the device.
1092 optional bool external_call = 4;
1093}
1094
Tej Singh1ea42892018-01-19 09:27:00 -08001095/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001096 * Logs keyguard state. The keyguard is the lock screen.
1097 *
1098 * Logged from:
1099 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1100 */
1101message KeyguardStateChanged {
1102 enum State {
1103 UNKNOWN = 0;
1104 // The keyguard is hidden when the phone is unlocked.
1105 HIDDEN = 1;
1106 // The keyguard is shown when the phone is locked (screen turns off).
1107 SHOWN= 2;
1108 // The keyguard is occluded when something is overlaying the keyguard.
1109 // Eg. Opening the camera while on the lock screen.
1110 OCCLUDED = 3;
1111 }
1112 optional State state = 1;
1113}
1114
1115/**
1116 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1117 * prompts the user to enter a password (pattern, pin, etc).
1118 *
1119 * Logged from:
1120 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1121 */
1122
1123message KeyguardBouncerStateChanged {
1124 enum State {
1125 UNKNOWN = 0;
1126 // Bouncer is hidden, either as a result of successfully entering the
1127 // password, screen timing out, or user going back to lock screen.
1128 HIDDEN = 1;
1129 // This is when the user is being prompted to enter the password.
1130 SHOWN = 2;
1131 }
1132 optional State state = 1;
1133}
1134
1135/**
1136 * Logs the result of entering a password into the keyguard bouncer.
1137 *
1138 * Logged from:
1139 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1140 */
1141message KeyguardBouncerPasswordEntered {
1142 enum BouncerResult {
1143 UNKNOWN = 0;
1144 // The password entered was incorrect.
1145 FAILURE = 1;
1146 // The password entered was correct.
1147 SUCCESS = 2;
1148 }
1149 optional BouncerResult result = 1;
1150}
1151
Tej Singha883b372018-02-15 11:30:01 -08001152/*
1153 * Logs changes to the configuration of the device. The configuration is defined
1154 * in frameworks/base/core/java/android/content/res/Configuration.java
1155 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1156 * Please go there to interpret the possible values each field can be.
1157 *
1158 * Logged from:
1159 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1160 */
1161message ResourceConfigurationChanged {
1162 // Bit mask of color capabilities of the screen.
1163 // Contains information about the color gamut and hdr mode of the screen.
1164 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001165 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001166
1167 // The target screen density being rendered to.
1168 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001169 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001170
1171 // Current user preference for the scaling factor for fonts,
1172 // relative to the base density scaling.
1173 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001174 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001175
1176 // Flag indicating whether the hard keyboard is hidden.
1177 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001178 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001179
1180 // The type of keyboard attached to the device.
1181 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1182 optional int32 keyboard = 5;
1183
1184 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1185 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001186 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001187
1188 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1189 // 0 if undefined.
1190 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1191 optional int32 mcc = 7;
1192
1193 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1194 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1195 // MNC_ZERO symbol defined in Configuration.java.
1196 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1197 optional int32 mnc = 8;
1198
1199 // The kind of navigation available on the device.
1200 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1201 optional int32 navigation = 9;
1202
1203 // Flag indicating whether the navigation is available.
1204 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001205 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001206
1207 // Overall orientation of the screen.
1208 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1209 optional int32 orientation = 11;
1210
1211 // The current height of the available screen space, in dp units.
1212 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001213 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001214
1215 // Bit mask of overall layout of the screen.
1216 // Contains information about screen size, whether the screen is wider/taller
1217 // than normal, whether the screen layout is right-tl-left or left-to-right,
1218 // and whether the screen has a rounded shape.
1219 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001220 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001221
1222 // Current width of the available screen space, in dp units.
1223 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001224 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001225
1226 // The smallest screen size an application will see in normal operation.
1227 // This is the smallest value of both screenWidthDp and screenHeightDp
1228 // in portrait and landscape.
1229 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001230 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001231
1232 // The type of touch screen attached to the device.
1233 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1234 optional int32 touchscreen = 16;
1235
1236 // Bit mask of the ui mode.
1237 // Contains information about the overall ui mode of the device.
1238 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1239 // Also contains information about whether the device is in night mode.
1240 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001241 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001242}
1243
Tej Singheee317b2018-03-07 19:28:05 -08001244
1245/**
1246 * Logs changes in the connection state of the mobile radio.
1247 *
1248 * Logged from:
1249 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1250 */
1251message MobileConnectionStateChanged {
1252 // States are from the state machine DataConnection.java.
1253 enum State {
1254 UNKNOWN = 0;
1255 // The connection is inactive, or disconnected.
1256 INACTIVE = 1;
1257 // The connection is being activated, or connecting.
1258 ACTIVATING = 2;
1259 // The connection is active, or connected.
1260 ACTIVE = 3;
1261 // The connection is disconnecting.
1262 DISCONNECTING = 4;
1263 // The connection is disconnecting after creating a connection.
1264 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1265 }
1266 optional State state = 1;
1267 // For multi-sim phones, this distinguishes between the sim cards.
1268 optional int32 sim_slot_index = 2;
1269 // Used to identify the connection. Starts at 0 and increments by 1 for
1270 // every new network created. Resets whenever the device reboots.
1271 optional int32 data_connection_id = 3;
1272 // A bitmask for the capabilities of this connection.
1273 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1274 // Default value (if we have no information): 0
1275 optional int64 capabilities = 4;
1276 // If this connection has internet.
1277 // This just checks if the DEFAULT bit of capabilities is set.
1278 optional bool has_internet = 5;
1279}
1280
1281/**
1282 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1283 *
1284 * Logged from:
1285 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1286 */
1287message MobileRadioTechnologyChanged {
1288 optional android.telephony.NetworkTypeEnum state = 1;
1289 // For multi-sim phones, this distinguishes between the sim cards.
1290 optional int32 sim_slot_index = 2;
1291}
1292
Andrew Chantb56388b2018-03-22 21:07:33 -07001293/**
1294 * Logs the VID and PID of any connected USB devices.
1295 *
1296 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1297 *
1298 * Logged by Vendor.
1299 */
1300message UsbDeviceAttached {
1301 optional int32 vid = 1;
1302 optional int32 pid = 2;
1303 optional bool has_audio = 3;
1304 optional bool has_hid = 4;
1305 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001306 enum State {
1307 STATE_DISCONNECTED = 0;
1308 STATE_CONNECTED = 1;
1309 }
1310 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001311 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001312}
1313
Tej Singheee317b2018-03-07 19:28:05 -08001314
Tej Singhdd7bd352018-02-09 19:33:15 -08001315/**
Tej Singh5d991e12018-03-09 19:48:11 -08001316 * Logs when Bluetooth is enabled and disabled.
1317 *
1318 * Logged from:
1319 * services/core/java/com/android/server/BluetoothManagerService.java
1320 */
1321message BluetoothEnabledStateChanged {
1322 repeated AttributionNode attribution_node = 1;
1323 // Whether or not bluetooth is enabled on the device.
1324 enum State {
1325 UNKNOWN = 0;
1326 ENABLED = 1;
1327 DISABLED = 2;
1328 }
1329 optional State state = 2;
1330 // The reason for being enabled/disabled.
1331 // Eg. Airplane mode, crash, application request.
1332 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1333 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001334 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001335}
1336
1337/**
Jack Hed9837c82019-01-09 01:19:13 -08001338 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001339 *
1340 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001341 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1342 *
1343 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001344 */
1345message BluetoothConnectionStateChanged {
1346 // The state of the connection.
1347 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1348 optional android.bluetooth.ConnectionStateEnum state = 1;
1349 // An identifier that can be used to match connect and disconnect events.
1350 // Currently is last two bytes of a hash of a device level ID and
1351 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001352 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1353 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001354 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1355 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001356 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001357 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001358 // An identifier that can be used to match events for this device.
1359 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1360 // Salt: Randomly generated 256 bit value
1361 // Hash algorithm: HMAC-SHA256
1362 // Size: 32 byte
1363 // Default: null or empty if the device identifier is not known
1364 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1365}
1366
1367/**
1368 * Logs when a Bluetooth device connects and disconnects over ACL
1369 *
1370 * Logged from:
1371 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1372 *
1373 * Next Tag: 3
1374 */
1375message BluetoothAclConnectionStateChanged {
1376 // An identifier that can be used to match events for this device.
1377 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1378 // Salt: Randomly generated 256 bit value
1379 // Hash algorithm: HMAC-SHA256
1380 // Size: 32 byte
1381 // Default: null or empty if the device identifier is not known
1382 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1383 // The state of the connection.
1384 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1385 optional android.bluetooth.ConnectionStateEnum state = 2;
1386}
1387
1388/**
1389 * Logs when a Bluetooth device connects and disconnects over SCO
1390 *
1391 * Logged from:
1392 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1393 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1394 *
1395 * Next Tag: 4
1396 */
1397message BluetoothScoConnectionStateChanged {
1398 // An identifier that can be used to match events for this device.
1399 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1400 // Salt: Randomly generated 256 bit value
1401 // Hash algorithm: HMAC-SHA256
1402 // Size: 32 byte
1403 // Default: null or empty if the device identifier is not known
1404 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1405 // The state of the connection.
1406 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1407 optional android.bluetooth.ConnectionStateEnum state = 2;
1408 // Codec used for this SCO connection
1409 // Default: UNKNOWN
1410 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001411}
1412
Jack Heab86dbd22018-12-18 15:43:27 -08001413// Logs when there is an event affecting Bluetooth device's link layer connection.
1414// - This event is triggered when there is a related HCI command or event
1415// - Users of this metrics can deduce Bluetooth device's connection state from these events
1416// - HCI commands are logged before the command is sent, after receiving command status, and after
1417// receiving command complete
1418// - HCI events are logged when they arrive
1419//
1420// Low level log from system/bt
1421//
1422// Bluetooth classic commands:
1423// - CMD_CREATE_CONNECTION
1424// - CMD_DISCONNECT
1425// - CMD_CREATE_CONNECTION_CANCEL
1426// - CMD_ACCEPT_CONNECTION_REQUEST
1427// - CMD_REJECT_CONNECTION_REQUEST
1428// - CMD_SETUP_ESCO_CONNECTION
1429// - CMD_ACCEPT_ESCO_CONNECTION
1430// - CMD_REJECT_ESCO_CONNECTION
1431// - CMD_ENH_SETUP_ESCO_CONNECTION
1432// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1433//
1434// Bluetooth low energy commands:
1435// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1436// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1437// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1438// - CMD_BLE_CLEAR_WHITE_LIST
1439// - CMD_BLE_ADD_WHITE_LIST
1440// - CMD_BLE_REMOVE_WHITE_LIST
1441//
1442// Bluetooth classic events:
1443// - EVT_CONNECTION_COMP
1444// - EVT_CONNECTION_REQUEST
1445// - EVT_DISCONNECTION_COMP
1446// - EVT_ESCO_CONNECTION_COMP
1447// - EVT_ESCO_CONNECTION_CHANGED
1448//
1449// Bluetooth low energy meta events:
1450// - BLE_EVT_CONN_COMPLETE_EVT
1451// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1452//
1453// Next tag: 10
1454message BluetoothLinkLayerConnectionEvent {
1455 // An identifier that can be used to match events for this device.
1456 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1457 // Salt: Randomly generated 256 bit value
1458 // Hash algorithm: HMAC-SHA256
1459 // Size: 32 byte
1460 // Default: null or empty if the device identifier is not known
1461 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1462 // Connection handle of this connection if available
1463 // Range: 0x0000 - 0x0EFF (12 bits)
1464 // Default: 0xFFFF if the handle is unknown
1465 optional int32 connection_handle = 2;
1466 // Direction of the link
1467 // Default: DIRECTION_UNKNOWN
1468 optional android.bluetooth.DirectionEnum direction = 3;
1469 // Type of this link
1470 // Default: LINK_TYPE_UNKNOWN
1471 optional android.bluetooth.LinkTypeEnum type = 4;
1472
1473 // Reason metadata for this link layer connection event, rules for interpretation:
1474 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1475 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1476 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1477 // set and valid, ignore hci_ble_event
1478
1479 // HCI command associated with this event
1480 // Default: CMD_UNKNOWN
1481 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1482 // HCI event associated with this event
1483 // Default: EVT_UNKNOWN
1484 optional android.bluetooth.hci.EventEnum hci_event = 6;
1485 // HCI BLE meta event associated with this event
1486 // Default: BLE_EVT_UNKNOWN
1487 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1488 // HCI command status code if this is triggerred by hci_cmd
1489 // Default: STATUS_UNKNOWN
1490 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1491 // HCI reason code associated with this event
1492 // Default: STATUS_UNKNOWN
1493 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1494}
1495
Howard Roe103fe22019-01-17 16:52:16 -08001496/**
1497 * Logs when a module is rolled back by Watchdog.
1498 *
1499 * Logged from: Rollback Manager
1500 */
1501message WatchdogRollbackOccurred {
1502 enum RollbackType {
1503 UNKNOWN = 0;
1504 ROLLBACK_INITIATE = 1;
1505 ROLLBACK_SUCCESS = 2;
1506 ROLLBACK_FAILURE = 3;
1507 }
1508 optional RollbackType rollback_type = 1;
1509
1510 optional string package_name = 2;
1511
1512 optional int32 package_version_code = 3;
1513}
1514
Jack Heab86dbd22018-12-18 15:43:27 -08001515
Tej Singh5d991e12018-03-09 19:48:11 -08001516/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001517 * Logs when something is plugged into or removed from the USB-C connector.
1518 *
1519 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001520 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001521 */
1522message UsbConnectorStateChanged {
1523 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001524 STATE_DISCONNECTED = 0;
1525 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001526 }
1527 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001528 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001529 // Last active session in ms.
1530 // 0 when the port is in connected state.
1531 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001532}
1533
1534/**
1535 * Logs the reported speaker impedance.
1536 *
1537 * Logged from:
1538 * Vendor audio implementation.
1539 */
1540message SpeakerImpedanceReported {
1541 optional int32 speaker_location = 1;
1542 optional int32 impedance = 2;
1543}
1544
1545/**
1546 * Logs the report of a failed hardware.
1547 *
1548 * Logged from:
1549 * Vendor HALs.
1550 *
1551 */
1552message HardwareFailed {
1553 enum HardwareType {
1554 HARDWARE_FAILED_UNKNOWN = 0;
1555 HARDWARE_FAILED_MICROPHONE = 1;
1556 HARDWARE_FAILED_CODEC = 2;
1557 HARDWARE_FAILED_SPEAKER = 3;
1558 HARDWARE_FAILED_FINGERPRINT = 4;
1559 }
1560 optional HardwareType hardware_type = 1;
1561
1562 /* hardware_location allows vendors to differentiate between multiple instances of
1563 * the same hardware_type. The specific locations are vendor defined integers,
1564 * referring to board-specific numbering schemes.
1565 */
1566 optional int32 hardware_location = 2;
1567
1568 /* failure_code is specific to the HardwareType of the failed hardware.
1569 * It should use the enum values defined below.
1570 */
1571 enum MicrophoneFailureCode {
1572 MICROPHONE_FAILURE_COMPLETE = 0;
1573 }
1574 enum CodecFailureCode {
1575 CODEC_FAILURE_COMPLETE = 0;
1576 }
1577 enum SpeakerFailureCode {
1578 SPEAKER_FAILURE_COMPLETE = 0;
1579 SPEAKER_FAILURE_HIGH_Z = 1;
1580 SPEAKER_FAILURE_SHORT = 2;
1581 }
1582 enum FingerprintFailureCode {
1583 FINGERPRINT_FAILURE_COMPLETE = 0;
1584 FINGERPRINT_SENSOR_BROKEN = 1;
1585 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1586 }
1587 optional int32 failure_code = 3;
1588}
1589
1590/**
1591 * Log an event when the device has been physically dropped.
1592 * Reported from the /vendor partition.
1593 */
1594message PhysicalDropDetected {
1595 // Confidence that the event was actually a drop, 0 -> 100
1596 optional int32 confidence_pctg = 1;
1597 // Peak acceleration of the drop, in 1/1000s of a g.
1598 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001599 // Duration of freefall in ms
1600 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001601}
1602
1603/**
1604 * Log bucketed battery charge cycles.
1605 *
1606 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001607 * a given charge point. For example, if 10 cycle buckets are
1608 * initialized, bucket 1 is the lowest 1/10th of the battery,
1609 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001610 *
1611 * Logged from:
1612 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1613 */
1614message ChargeCyclesReported {
1615 optional int32 cycle_bucket_1 = 1;
1616 optional int32 cycle_bucket_2 = 2;
1617 optional int32 cycle_bucket_3 = 3;
1618 optional int32 cycle_bucket_4 = 4;
1619 optional int32 cycle_bucket_5 = 5;
1620 optional int32 cycle_bucket_6 = 6;
1621 optional int32 cycle_bucket_7 = 7;
1622 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001623 optional int32 cycle_bucket_9 = 9;
1624 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001625}
1626
1627/**
Howard Roa46b6582018-09-18 16:45:02 -07001628 * Log battery health snapshot.
1629 *
1630 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1631 * are snapshotted periodically over 24hrs.
1632 */
1633message BatteryHealthSnapshot {
1634 enum BatterySnapshotType {
1635 UNKNOWN = 0;
1636 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1637 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1638 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1639 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1640 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1641 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1642 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1643 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1644 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1645 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1646 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1647 }
1648 optional BatterySnapshotType type = 1;
1649 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001650 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001651 // Voltage Battery Voltage, in microVolts.
1652 optional int32 voltage_micro_volt = 3;
1653 // Current Battery current, in microAmps.
1654 optional int32 current_micro_amps = 4;
1655 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1656 optional int32 open_circuit_micro_volt = 5;
1657 // Resistance Battery Resistance, in microOhms.
1658 optional int32 resistance_micro_ohm = 6;
1659 // Level Battery Level, as % of full.
1660 optional int32 level_percent = 7;
1661}
1662
1663/**
1664 * Log slow I/O operations on the primary storage.
1665 */
1666message SlowIo {
1667 // Classifications of IO Operations.
1668 enum IoOperation {
1669 UNKNOWN = 0;
1670 READ = 1;
1671 WRITE = 2;
1672 UNMAP = 3;
1673 SYNC = 4;
1674 }
1675 optional IoOperation operation = 1;
1676
1677 // The number of slow IO operations of this type over 24 hours.
1678 optional int32 count = 2;
1679}
1680
1681/**
1682 * Log battery caused shutdown with the last recorded voltage.
1683 */
1684message BatteryCausedShutdown {
1685 // The last recorded battery voltage prior to shutdown.
1686 optional int32 last_recorded_micro_volt = 1;
1687}
1688
1689/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001690 * Logs the duration of a davey (jank of >=700ms) when it occurs
1691 *
1692 * Logged from:
1693 * frameworks/base/libs/hwui/JankTracker.cpp
1694 */
1695message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001696 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001697 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001698
Tej Singhbb8554a2018-01-26 11:59:14 -08001699 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001700 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001701}
1702
1703/**
Bookatze5885242017-10-24 20:10:31 -07001704 * Logs phone signal strength changes.
1705 *
1706 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001707 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001708 */
1709message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001710 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1711 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001712}
1713
Yangster4ccebea2018-10-09 17:09:02 -07001714
1715/**
1716 * Logs when the phone state, sim state or signal strength changes
1717 *
1718 * Logged from:
1719 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1720 */
1721message PhoneServiceStateChanged {
1722 optional android.telephony.ServiceStateEnum state = 1;
1723 optional android.telephony.SimStateEnum sim_state = 2;
1724 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1725}
1726
1727/**
1728 * Logs when the phone becomes on or off.
1729 *
1730 * Logged from:
1731 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1732 */
1733message PhoneStateChanged {
1734 enum State {
1735 OFF = 0;
1736 ON = 1;
1737 }
1738 optional State state = 1;
1739}
1740
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001741message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001742 optional android.stats.launcher.LauncherAction action = 1;
1743 optional android.stats.launcher.LauncherState src_state = 2;
1744 optional android.stats.launcher.LauncherState dst_state = 3;
1745 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001746 optional bool is_swipe_up_enabled = 5;
1747}
1748
David Chenc28b2bb2017-10-24 12:52:52 -07001749/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001750 * Logs when Settings UI has changed.
1751 *
1752 * Logged from:
1753 * packages/apps/Settings
1754 */
1755message SettingsUIChanged {
1756 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001757 * Where this SettingsUIChange event comes from. For example, if
1758 * it's a PAGE_VISIBLE event, where the page is opened from.
1759 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001760 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001761
1762 /**
1763 * What the UI action is.
1764 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001765 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001766
1767 /**
1768 * Where the action is happening
1769 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001770 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001771
1772 /**
1773 * What preference changed in this event.
1774 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001775 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001776
1777 /**
1778 * The new value of the changed preference.
1779 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001780 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001781}
1782
1783/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08001784 * Logs basic timing information about touch events.
1785 * Reported at most every 5 minutes while device is being interacted with.
1786 *
1787 * Logged from:
1788 * frameworks/native/services/inputflinger
1789 */
1790message TouchEventReported {
1791 /**
1792 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
1793 * and the standard deviation of latency between the kernel and framework
1794 * for touchscreen events. The units are microseconds.
1795 *
1796 * The number is measured as the difference between the time at which
1797 * the input event was received in the evdev driver,
1798 * and the time at which the input event was received in EventHub.
1799 */
1800 // Minimum value
1801 optional float latency_min_micros = 1;
1802 // Maximum value
1803 optional float latency_max_micros = 2;
1804 // Average value
1805 optional float latency_mean_micros = 3;
1806 // Standard deviation
1807 optional float latency_stdev_micros = 4;
1808}
1809
1810/**
David Chenc28b2bb2017-10-24 12:52:52 -07001811 * Logs that a setting was updated.
1812 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001813 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001814 * The tag and is_default allow resetting of settings to default values based on the specified
1815 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1816 */
1817message SettingChanged {
1818 // The name of the setting.
1819 optional string setting = 1;
1820
1821 // The change being imposed on this setting. May represent a number, eg "3".
1822 optional string value = 2;
1823
1824 // The new value of this setting. For most settings, this is same as value. For some settings,
1825 // value is +X or -X where X represents an element in a set. For example, if the previous value
1826 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1827 // The +/- feature is currently only used for location_providers_allowed.
1828 optional string new_value = 3;
1829
1830 // The previous value of this setting.
1831 optional string prev_value = 4;
1832
1833 // The tag used with the is_default for resetting sets of settings. This is generally null.
1834 optional string tag = 5;
1835
Bookatz90867622018-01-31 15:05:57 -08001836 // True if this setting with tag should be resettable.
1837 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001838
David Chenbd789912018-03-16 17:19:55 -07001839 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001840 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001841
1842 enum ChangeReason {
1843 UPDATED = 1; // Updated can be an insertion or an update.
1844 DELETED = 2;
1845 }
1846 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001847}
Chenjie Yub3dda412017-10-24 13:41:59 -07001848
Chenjie Yu05013b32017-11-21 10:21:41 -08001849/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001850 * Logs activity going to foreground or background
1851 *
1852 * Logged from:
1853 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1854 */
1855message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001856 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001857 optional string pkg_name = 2;
1858 optional string class_name = 3;
1859
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001860 enum State {
1861 BACKGROUND = 0;
1862 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001863 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001864 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001865}
David Chenc8a43242017-10-17 16:23:28 -07001866
1867/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00001868 * Logs when a volume entered low Storage state.
1869 * Logged from:
1870 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
1871 */
1872message LowStorageStateChanged {
1873 // Volume that ran out of storage.
1874 optional string volume_description = 1;
1875
1876 enum State {
1877 UNKNOWN = 0;
1878 OFF = 1;
1879 ON = 2;
1880 }
1881 optional State state = 2;
1882}
1883
1884/**
1885 * Logs when an app is downgraded.
1886 * Logged from:
1887 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1888 */
1889message AppDowngraded {
1890 optional string package_name = 1;
1891 // Size of the package (all data) before being downgraded.
1892 optional int64 size_in_bytes_before = 2;
1893 // Size of the package (all data) after being downgraded.
1894 optional int64 size_in_bytes_after = 3;
1895
1896 optional bool aggressive = 4;
1897}
1898
1899/**
1900 * Logs when an app is optimized after being downgraded.
1901 * Logged from:
1902 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1903 */
1904message AppOptimizedAfterDowngraded {
1905 optional string package_name = 1;
1906}
1907
1908/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001909 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001910 * Logged from:
1911 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1912 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001913message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001914 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001915
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001916 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001917
1918 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001919 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001920 optional string process_name = 3;
1921
1922 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001923 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001924
1925 optional string package_name = 5;
1926
1927 enum InstantApp {
1928 UNAVAILABLE = 0;
1929 FALSE = 1;
1930 TRUE = 2;
1931 }
1932 optional InstantApp is_instant_app = 6;
1933
1934 enum ForegroundState {
1935 UNKNOWN = 0;
1936 BACKGROUND = 1;
1937 FOREGROUND = 2;
1938 }
1939 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001940
1941 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001942}
David Chen9e3808c2017-11-20 17:25:34 -08001943
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001944/**
1945 * Logs when a WTF (What a Terrible Failure) happened.
1946 * Logged from:
1947 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1948 */
1949message WTFOccurred {
1950 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001951
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001952 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001953
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001954 // The name of the process.
1955 // system_server if it is not by an app
1956 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001957
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001958 // The pid if available. -1 means not available.
1959 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001960
1961 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001962}
1963
1964/**
1965 * Logs when system server reports low memory.
1966 * Logged from:
1967 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1968 */
1969message LowMemReported {
1970}
1971
1972/**
1973 * Logs when an app ANR (App Not Responding) occurs.
1974 * Logged from:
1975 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1976 */
1977message ANROccurred {
1978 optional int32 uid = 1 [(is_uid) = true];
1979
1980 optional string process_name = 2;
1981
1982 optional string short_component_name = 3;
1983
1984 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001985
1986 enum InstantApp {
1987 UNAVAILABLE = 0;
1988 FALSE = 1;
1989 TRUE = 2;
1990 }
1991 optional InstantApp is_instant_app = 5;
1992
1993 enum ForegroundState {
1994 UNKNOWN = 0;
1995 BACKGROUND = 1;
1996 FOREGROUND = 2;
1997 }
1998 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001999
2000 optional android.server.ErrorSource error_source = 7;
2001
2002 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002003}
2004
Bookatza7020bd2018-08-28 16:29:35 -07002005/**
2006 * Logs when the vibrator state changes.
2007 * Logged from:
2008 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2009 */
2010message VibratorStateChanged {
2011 repeated AttributionNode attribution_node = 1;
2012
2013 enum State {
2014 OFF = 0;
2015 ON = 1;
2016 }
2017 optional State state = 2;
2018
2019 // Duration (in milliseconds) requested to keep the vibrator on.
2020 // Only applicable for State == ON.
2021 optional int64 duration_millis = 3;
2022}
2023
David Chen0a368b22017-12-06 16:28:16 -08002024/*
2025 * Allows other apps to push events into statsd.
2026 * Logged from:
2027 * frameworks/base/core/java/android/util/StatsLog.java
2028 */
David Chen0b5c90c2018-01-25 16:51:49 -08002029message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002030 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002031 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002032
2033 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2034 optional int32 label = 2;
2035
2036 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2037 // predicates for the metrics).
2038 enum State {
2039 UNKNOWN = 0;
2040 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2041 STOP = 2;
2042 START = 3;
2043 }
2044 optional State state = 3;
2045}
2046
David Chen9e3808c2017-11-20 17:25:34 -08002047/**
Bookatz7948c872018-09-04 12:58:33 -07002048 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2049 * For example, this could be due to the user manually changing the time.
2050 *
2051 * Logged from:
2052 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2053 */
2054message WallClockTimeShifted {
2055 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2056 optional int64 wall_clock_timestamp_millis = 1;
2057}
2058
2059/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002060 * Logs when statsd detects an anomaly.
2061 *
2062 * Logged from:
2063 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2064 */
2065message AnomalyDetected {
2066 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002067 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002068
Yangster-mac94e197c2018-01-02 16:03:03 -08002069 // Id of the config whose anomaly detection alert fired.
2070 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002071
Yangster-mac94e197c2018-01-02 16:03:03 -08002072 // Id of the alert (i.e. name of the anomaly that was detected).
2073 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002074}
2075
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002076message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002077 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002078 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002079
2080 // The app package name.
2081 optional string pkg_name = 2;
2082
2083 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002084 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002085 WARM = 1;
2086 HOT = 2;
2087 COLD = 3;
2088 }
2089 // The transition type.
2090 optional TransitionType type = 3;
2091
2092 // The activity name.
2093 optional string activity_name = 4;
2094
2095 // The name of the calling app. Empty if not set.
2096 optional string calling_pkg_name = 5;
2097
2098 // Whether the app is an instant app.
2099 optional bool is_instant_app = 6;
2100
2101 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002102 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002103
Bookatz80d11a02018-01-16 10:46:35 -08002104 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002105
David Chen0b5c90c2018-01-25 16:51:49 -08002106 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002107 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002108 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002109 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002110 optional int32 bind_application_delay_millis = 11;
2111 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002112
2113 // Empty if not set.
2114 optional string launch_token = 13;
2115
Calin Juravle759fbda2018-02-20 19:52:30 +00002116 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002117 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002118
2119 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002120 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002121}
2122
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002123message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002124 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002125 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002126
2127 // The app package name.
2128 optional string pkg_name = 2;
2129
2130 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002131 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002132 WARM = 1;
2133 HOT = 2;
2134 COLD = 3;
2135 }
2136 // The transition type.
2137 optional TransitionType type = 3;
2138
2139 // The activity name.
2140 optional string activity_name = 4;
2141}
2142
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002143message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002144 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002145 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002146
2147 // The app package name.
2148 optional string pkg_name = 2;
2149
2150 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002151 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002152 WITH_BUNDLE = 1;
2153 WITHOUT_BUNDLE = 2;
2154 }
2155 // The transition type.
2156 optional TransitionType type = 3;
2157
2158 // The activity name.
2159 optional string activity_name = 4;
2160
2161 optional bool transition_process_running = 5;
2162
2163 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002164 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002165}
2166
Bookatz8fcd09a2017-12-18 13:01:10 -08002167/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002168 * Logs a picture-in-picture action
2169 * Logged from:
2170 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2171 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2172 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2173 */
2174message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002175 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002176 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002177
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002178 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002179
Chenjie Yu52cacc62017-12-08 18:11:45 -08002180 enum State {
2181 ENTERED = 1;
2182 EXPANDED_TO_FULL_SCREEN = 2;
2183 MINIMIZED = 3;
2184 DISMISSED = 4;
2185 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002186 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002187}
2188
2189/**
Chenjie Yue8904192017-12-08 19:12:57 -08002190 * Logs overlay action
2191 * Logged from:
2192 * services/core/java/com/android/server/wm/Session.java
2193 */
2194message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002195 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002196
2197 optional string package_name = 2;
2198
2199 optional bool using_alert_window = 3;
2200
2201 enum State {
2202 ENTERED = 1;
2203 EXITED = 2;
2204 }
2205 optional State state = 4;
2206}
2207
Chenjie Yuccfe6452018-01-30 11:33:21 -08002208/*
2209 * Logs foreground service starts and stops.
2210 * Note that this is not when a service starts or stops, but when it is
2211 * considered foreground.
2212 * Logged from
2213 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2214 */
2215message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002216 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002217 // package_name + "/" + class_name
2218 optional string short_name = 2;
2219
2220 enum State {
2221 ENTER = 1;
2222 EXIT = 2;
2223 }
2224 optional State state = 3;
2225}
2226
Chenjie Yue8904192017-12-08 19:12:57 -08002227/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002228 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2229 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2230 * attributed back to the parent (host) uid. One example is Chrome.
2231 *
2232 * Logged from:
2233 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2234 */
2235message IsolatedUidChanged {
2236 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002237 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002238 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002239 optional int32 parent_uid = 1;
2240
2241 optional int32 isolated_uid = 2;
2242
2243 // We expect an isolated uid to be removed before if it's used for another parent uid.
2244 enum Event {
2245 REMOVED = 0;
2246 CREATED = 1;
2247 }
2248 optional Event event = 3;
2249}
2250
2251/*
2252 * Logs the reception of an incoming network packet causing the main system to wake up for
2253 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2254 * and processed by WakeupController.cpp.
2255 */
2256message PacketWakeupOccurred {
2257 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2258 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002259 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002260 // The interface name on which the packet was received.
2261 optional string iface = 2;
2262 // The ethertype value of the packet.
2263 optional int32 ethertype = 3;
2264 // String representation of the destination MAC address of the packet.
2265 optional string destination_hardware_address = 4;
2266 // String representation of the source address of the packet if this was an IP packet.
2267 optional string source_ip = 5;
2268 // String representation of the destination address of the packet if this was an IP packet.
2269 optional string destination_ip = 6;
2270 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2271 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2272 // families.
2273 optional int32 ip_next_header = 7;
2274 // The source port if this was a TCP or UDP packet.
2275 optional int32 source_port = 8;
2276 // The destination port if this was a TCP or UDP packet.
2277 optional int32 destination_port = 9;
2278}
2279
2280/*
2281 * Logs the memory stats for an app on startup.
2282 * Logged from:
2283 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2284 */
2285message AppStartMemoryStateCaptured {
2286 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002287 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002288
2289 // The process name.
2290 optional string process_name = 2;
2291
2292 // The activity name.
2293 optional string activity_name = 3;
2294
2295 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002296 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002297
2298 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002299 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002300
2301 // RSS
2302 optional int64 rss_in_bytes = 6;
2303
2304 // CACHE
2305 optional int64 cache_in_bytes = 7;
2306
2307 // SWAP
2308 optional int64 swap_in_bytes = 8;
2309}
2310
2311/*
2312 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2313 * for LMK event.
2314 * Logged from:
2315 * system/core/lmkd/lmkd.c
2316 */
2317message LmkStateChanged {
2318 enum State {
2319 UNKNOWN = 0;
2320 START = 1;
2321 STOP = 2;
2322 }
2323 optional State state = 1;
2324}
2325
2326/*
2327 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2328 * Logged from:
2329 * system/core/lmkd/lmkd.c
2330 */
2331message LmkKillOccurred {
2332 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002333 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002334
2335 // The process name.
2336 optional string process_name = 2;
2337
2338 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002339 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002340
2341 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002342 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002343
2344 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002345 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002346
2347 // RSS
2348 optional int64 rss_in_bytes = 6;
2349
2350 // CACHE
2351 optional int64 cache_in_bytes = 7;
2352
2353 // SWAP
2354 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002355
2356 // The elapsed real time of start of the process.
2357 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002358}
2359
Rajeev Kumar51b54602018-03-01 12:18:26 -08002360/*
2361 * Logs when the ActivityManagerService detects that an app died.
2362 *
2363 * Logged from:
2364 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2365 */
2366message AppDied {
2367 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002368 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002369}
2370
Howard Ro21a039c2018-08-06 14:55:47 -07002371/**
2372 * An atom for generic metrics logging. Available from Android Q.
2373 */
2374message GenericAtom {
2375 // The uid of the application that sent this custom atom.
2376 optional int32 uid = 1 [(is_uid) = true];
2377
2378 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002379 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002380}
2381
Tej Singhd6d6d772018-09-05 17:41:25 -07002382/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002383 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002384 *
2385 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002386 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002387 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002388message BiometricAcquired {
2389 // Biometric modality that was acquired.
2390 optional android.hardware.biometrics.ModalityEnum modality = 1;
2391 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2392 optional int32 user = 2;
2393 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2394 optional bool is_crypto = 3;
2395 // Action that the device is performing. Acquired messages are only expected for enroll and
2396 // authenticate. Other actions may indicate an error.
2397 optional android.hardware.biometrics.ActionEnum action = 4;
2398 // The client that this acquisition was received for.
2399 optional android.hardware.biometrics.ClientEnum client = 5;
2400 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
2401 optional int32 acquire_info = 6;
2402 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
2403 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07002404}
2405
2406/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002407 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002408 *
2409 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002410 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002411 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002412message BiometricAuthenticated {
2413 // Biometric modality that was used.
2414 optional android.hardware.biometrics.ModalityEnum modality = 1;
2415 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2416 optional int32 user = 2;
2417 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
2418 // storage.
2419 optional bool is_crypto = 3;
2420 // The client that this acquisition was received for.
2421 optional android.hardware.biometrics.ClientEnum client = 4;
Tej Singhd6d6d772018-09-05 17:41:25 -07002422
Kevin Chyn1741a072019-01-17 11:54:40 -08002423 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07002424 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08002425 REJECTED = 1;
2426 PENDING_CONFIRMATION = 2;
2427 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07002428 }
Kevin Chyn1741a072019-01-17 11:54:40 -08002429
2430 // State of the current auth attempt.
2431 optional State state = 5;
2432 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
2433 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
2434 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
2435 // CONFIRMED.
Kevin Chyn1d19c692019-01-27 12:23:47 -08002436 optional int64 latency_millis = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08002437}
2438
2439/**
2440 * Logs when a biometric error occurs.
2441 *
2442 * Logged from:
2443 * frameworks/base/services/core/java/com/android/server/biometrics
2444 */
2445message BiometricErrorOccurred {
2446 // Biometric modality that was used.
2447 optional android.hardware.biometrics.ModalityEnum modality = 1;
2448 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2449 optional int32 user = 2;
2450 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
2451 optional bool is_crypto = 3;
2452 // Action that the device is performing.
2453 optional android.hardware.biometrics.ActionEnum action = 4;
2454 // The client that this acquisition was received for.
2455 optional android.hardware.biometrics.ClientEnum client = 5;
2456 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
2457 // are unique to modality.
2458 optional int32 error_info = 6;
2459 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
2460 // by the vendor and not specified by the HIDL interface.
2461 optional int32 error_info_vendor = 7;
2462}
2463
2464/**
2465 * Logs when a biometric HAL has crashed.
2466 * Logged from:
2467 * frameworks/base/services/core/java/com/android/server/biometrics
2468 */
2469message BiometricHalDeathReported {
2470 // Biometric modality.
2471 optional android.hardware.biometrics.ModalityEnum modality = 1;
Tej Singhd6d6d772018-09-05 17:41:25 -07002472}
Howard Ro688ae182018-09-25 00:09:36 -07002473
2474message Notification {
2475
2476 // Type of notification event.
2477 enum Type {
2478 TYPE_UNKNOWN = 0;
2479 // Notification became visible to the user.
2480 TYPE_OPEN = 1;
2481 // Notification became hidden.
2482 TYPE_CLOSE = 2;
2483 // Notification switched to detail mode.
2484 TYPE_DETAIL = 3;
2485 // Notification was clicked.
2486 TYPE_ACTION = 4;
2487 // Notification was dismissed.
2488 TYPE_DISMISS = 5;
2489 // Notification switched to summary mode. The enum value of 14 is to
2490 // match that of metrics_constants.
2491 TYPE_COLLAPSE = 14;
2492 }
2493 optional Type type = 1;
2494
2495 // Package name associated with the notification.
2496 optional string package_name = 2;
2497
2498 // Tag associated with notification.
2499 optional string tag = 3;
2500
2501 // Application-supplied ID associated with the notification.
2502 optional int32 id = 4;
2503
2504 // Index of notification in the notification panel.
2505 optional int32 shade_index = 5;
2506
2507 // The number of notifications in the notification panel.
2508 optional int32 shade_count = 6;
2509
2510 // Importance for the notification.
2511 optional int32 importance = 7;
2512
2513 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002514 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002515
2516 // Importance for the notification channel.
2517 optional int32 channel_importance = 9;
2518
Howard Ro183c2bd2018-10-18 13:52:10 -07002519 // Application-supplied ID associated with the notifications group.
2520 optional string group_id = 10;
2521
Howard Ro688ae182018-09-25 00:09:36 -07002522 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002523 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002524
Howard Ro183c2bd2018-10-18 13:52:10 -07002525 // Reason for dismissal of a notification. This field is only meaningful for
2526 // TYPE_DISMISS events.
2527 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002528
Howard Ro183c2bd2018-10-18 13:52:10 -07002529 // The first post time of notification, stable across updates.
2530 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002531
Howard Ro183c2bd2018-10-18 13:52:10 -07002532 // The most recent interruption time, or the creation time if no updates.
2533 // Differs from update_millis because updates are filtered based on whether
2534 // they actually interrupted the user.
2535 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002536
Howard Ro183c2bd2018-10-18 13:52:10 -07002537 // The most recent update time, or the creation time if no updates.
2538 optional int64 update_millis = 15;
2539
2540 // The most recent visibility event.
2541 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002542}
2543
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002544/*
Tej Singh0d176952019-01-16 19:10:54 -08002545 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08002546 */
Tej Singh0d176952019-01-16 19:10:54 -08002547message FlagFlipUpdateOccurred {
2548 // If the event is from a flag config package, specify the package name.
2549 optional string flag_flip_package_name = 1;
2550
2551 // The order id of the package
2552 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08002553}
2554
2555/*
2556 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08002557 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08002558 */
2559message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08002560 // Name of the train.
2561 optional string train_name = 1;
2562 // Version code for a "train" of packages that need to be installed atomically
2563 optional int64 train_version_code = 2;
2564 // After installation of this package, device requires a restart.
2565 optional bool requires_staging = 3;
2566 // Rollback should be enabled for this install.
2567 optional bool rollback_enabled = 4;
2568 // Requires low latency monitoring if possible.
2569 optional bool requires_low_latency_monitor = 5;
2570
Yangster-macb89807e2018-11-15 21:10:57 -08002571 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08002572 UNKNOWN = 0;
2573 INSTALL_REQUESTED = 1;
2574 INSTALL_STARTED = 2;
2575 INSTALL_STAGED_NOT_READY = 3;
2576 INSTALL_STAGED_READY = 4;
2577 INSTALL_SUCCESS = 5;
2578 INSTALL_FAILURE = 6;
2579 INSTALL_CANCELLED = 7;
2580 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08002581 }
Chenjie Yu8366c712019-01-16 20:48:30 -08002582 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08002583}
2584
Maggie Whitefc1aa592018-11-28 21:55:23 -08002585/** Represents USB port overheat event. */
2586message UsbPortOverheatEvent {
2587 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
2588 optional int32 plug_temperature_deci_c = 1;
2589
2590 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
2591 optional int32 max_temperature_deci_c = 2;
2592
2593 /* Time between USB plug event and overheat threshold trip, in seconds. */
2594 optional int32 time_to_overheat_secs = 3;
2595
2596 /* Time between overheat threshold trip and hysteresis, in seconds. */
2597 optional int32 time_to_hysteresis_secs = 4;
2598
2599 /* Time between hysteresis and active mitigation ending, in seconds. */
2600 optional int32 time_to_inactive_secs = 5;
2601};
2602
Maggie White8735b852019-01-18 11:40:49 -08002603/**
2604 * Logs total effective full charge and discharge cycles on a battery.
2605 * Here are some examples of one effective cycle:
2606 * 1) the battery charges from 0% to 100% and drains back to 0%,
2607 * 2) charging from 50% to 100% and draining back to 50% twice.
2608 * Pulled from:
2609 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2610 */
2611message BatteryCycleCount {
2612 /* Number of total charge and discharge cycles on the system battery. */
2613 optional int32 cycle_count = 1;
2614}
2615
Yangster-macb89807e2018-11-15 21:10:57 -08002616/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002617 * Logs when a connection becomes available and lost.
2618 * Logged in StatsCompanionService.java
2619 */
2620message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002621 // Id of the network.
2622 optional int32 net_id = 1;
2623
2624 enum State {
2625 UNKNOWN = 0;
2626 CONNECTED = 1;
2627 DISCONNECTED = 2;
2628 }
2629 // Connected state of a network.
2630 optional State state = 2;
2631}
2632
2633/**
2634 * Logs when a service starts and stops.
2635 * Logged from:
2636 * services/core/java/com/android/server/am/ActiveServices.java
2637 */
2638message ServiceStateChanged {
2639
2640 optional int32 uid = 1 [(is_uid) = true];
2641
2642 optional string package_name = 2;
2643
2644 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002645
2646 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002647 START = 1;
2648 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002649 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002650
2651 optional State state = 4;
2652}
2653
2654/**
2655 * Logs when a service is launched.
2656 * Logged from:
2657 * services/core/java/com/android/server/am/ActiveServices.java
2658 */
2659message ServiceLaunchReported {
2660
2661 optional int32 uid = 1 [(is_uid) = true];
2662
2663 optional string package_name = 2;
2664
2665 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002666}
Howard Ro688ae182018-09-25 00:09:36 -07002667
Chenjie Yubbcbc602018-02-05 16:51:52 -08002668//////////////////////////////////////////////////////////////////////
2669// Pulled atoms below this line //
2670//////////////////////////////////////////////////////////////////////
2671
2672/**
David Chenc8a43242017-10-17 16:23:28 -07002673 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2674 *
2675 * Pulled from:
2676 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2677 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002678message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002679 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002680
2681 optional int64 rx_bytes = 2;
2682
2683 optional int64 rx_packets = 3;
2684
2685 optional int64 tx_bytes = 4;
2686
2687 optional int64 tx_packets = 5;
2688}
2689
2690/**
2691 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2692 *
2693 * Pulled from:
2694 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2695 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002696message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002697 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002698
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002699 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2700 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002701
2702 optional int64 rx_bytes = 3;
2703
2704 optional int64 rx_packets = 4;
2705
2706 optional int64 tx_bytes = 5;
2707
2708 optional int64 tx_packets = 6;
2709}
2710
2711/**
2712 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2713 *
2714 * Pulled from:
2715 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2716 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002717message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002718 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002719
2720 optional int64 rx_bytes = 2;
2721
2722 optional int64 rx_packets = 3;
2723
2724 optional int64 tx_bytes = 4;
2725
2726 optional int64 tx_packets = 5;
2727}
2728
2729/**
2730 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2731 *
2732 * Pulled from:
2733 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2734 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002735message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002736 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002737
Yao Chenc40a19d2018-03-15 16:48:25 -07002738 // 1 denotes foreground and 0 denotes background. This is called Set in
2739 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002740 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002741
2742 optional int64 rx_bytes = 3;
2743
2744 optional int64 rx_packets = 4;
2745
2746 optional int64 tx_bytes = 5;
2747
2748 optional int64 tx_packets = 6;
2749}
2750
2751/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002752 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2753 *
2754 * Pulled from:
2755 * StatsCompanionService
2756 */
2757message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002758 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002759
2760 optional int64 rx_bytes = 2;
2761
2762 optional int64 tx_bytes = 3;
2763}
2764
2765/**
David Chenc8a43242017-10-17 16:23:28 -07002766 * Pulls the kernel wakelock durations. This atom is adapted from
2767 * android/internal/os/KernelWakelockStats.java
2768 *
2769 * Pulled from:
2770 * StatsCompanionService using KernelWakelockReader.
2771 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002772message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002773 optional string name = 1;
2774
2775 optional int32 count = 2;
2776
2777 optional int32 version = 3;
2778
Yangster-maca8a30442018-10-13 23:46:34 -07002779 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002780}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002781
Chenjie Yu05013b32017-11-21 10:21:41 -08002782/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002783 * Pulls low power state information. If power.stats HAL is not available, this
2784 * includes platform and subsystem sleep state information,
2785 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2786 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002787 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002788 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002789 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2790 * as defined in:
2791 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002792 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002793message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002794 // Subsystem name
2795 optional string subsystem_name = 1;
2796 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2797 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002798 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2799 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002800 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002801 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002802 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002803 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002804 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002805}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002806
Chenjie Yu05013b32017-11-21 10:21:41 -08002807/**
Bookatz92da2832018-11-01 18:10:03 -07002808 * Pulls on-device power measurement information.
2809 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2810 * Pulled from:
2811 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2812 */
2813message OnDevicePowerMeasurement {
2814 // Name of the subsystem (to which the rail belongs).
2815 optional string subsystem_name = 1;
2816
2817 // Rail name. The rail lies within the subsystem.
2818 optional string rail_name = 2;
2819
2820 // Time (in ms since boot) at which the rail energy value was measured.
2821 // This may differ slightly from the time that statsd logs this information.
2822 optional uint64 measurement_timestamp_millis = 3;
2823
2824 // Accumulated energy used via the rail since device boot in uWs.
2825 optional uint64 energy_microwatt_secs = 4;
2826}
2827
2828/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002829 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002830 * Pulls the time the cpu spend on the frequency index. Frequency index
2831 * starts from highest to lowest. The value should be monotonically
2832 * increasing since boot. However, if there is a cpu
2833 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002834 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002835message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002836 optional uint32 cluster = 1;
2837 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002838 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002839}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002840
Chenjie Yu05013b32017-11-21 10:21:41 -08002841/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002842 * Pulls Cpu Time Per Uid.
2843 * Note that isolated process uid time should be attributed to host uids.
2844 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002845message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002846 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002847 optional uint64 user_time_micros = 2;
2848 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002849}
2850
2851/**
2852 * Pulls Cpu Time Per Uid per frequency.
2853 * Note that isolated process uid time should be attributed to host uids.
2854 * For each uid, we order the time by descending frequencies.
2855 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002856message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002857 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002858 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002859 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002860}
Hugo Benichi884970e2017-11-14 22:42:46 +09002861
Chenjie Yu05013b32017-11-21 10:21:41 -08002862/**
2863 * Pulls Wifi Controller Activity Energy Info
2864 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002865message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002866 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002867 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002868 // stack reported state
2869 // TODO: replace this with proto enum
2870 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002871 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002872 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002873 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002874 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002875 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002876 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002877 // product of current(mA), voltage(V) and time(ms)
2878 optional uint64 controller_energy_used = 6;
2879}
2880
2881/**
2882 * Pulls Modem Activity Energy Info
2883 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002884message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002885 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002886 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002887 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002888 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002889 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002890 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002891 /**
2892 * Tx power index
2893 * index 0 = tx_power < 0dBm
2894 * index 1 = 0dBm < tx_power < 5dBm
2895 * index 2 = 5dBm < tx_power < 15dBm
2896 * index 3 = 15dBm < tx_power < 20dBm
2897 * index 4 = tx_power > 20dBm
2898 */
2899 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002900 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002901 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002902 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002903 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002904 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002905 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002906 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002907 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002908 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002909 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002910 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002911 // product of current(mA), voltage(V) and time(ms)
2912 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002913}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002914
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002915/**
2916 * Pulls Bluetooth Activity Energy Info
2917 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2918 */
2919message BluetoothActivityInfo {
2920 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002921 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002922 // bluetooth stack state
2923 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002924 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002925 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002926 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002927 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002928 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002929 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002930 // product of current(mA), voltage(V) and time(ms)
2931 optional uint64 energy_used = 6;
2932}
2933
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002934/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002935 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002936 *
2937 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002938 */
2939message ProcessMemoryState {
2940 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002941 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002942
2943 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002944 // Usually package name, "system" for system server.
2945 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002946 optional string process_name = 2;
2947
Rafal Slawikda51b932018-12-13 16:31:33 +00002948 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002949 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002950
2951 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002952 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002953
2954 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002955 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002956
Rajeev Kumar90235992018-01-29 11:06:48 -08002957 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002958 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2959 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002960 optional int64 rss_in_bytes = 6;
2961
2962 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002963 // Value is read from memory.stat, field total_cache if per-app memory
2964 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002965 optional int64 cache_in_bytes = 7;
2966
2967 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002968 // Value is read from memory.stat, field total_swap if per-app memory
2969 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002970 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002971
Rafal Slawikd03ae422018-11-20 11:27:45 +00002972 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002973 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002974
2975 // Elapsed real time when the process started.
2976 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2977 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002978}
2979
2980/*
Rafal Slawik08621582018-10-15 14:53:07 +01002981 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002982 *
2983 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002984 */
2985message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002986 // The uid if available. -1 means not available.
2987 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002988
Rafal Slawikbf67d072018-10-23 11:07:54 +01002989 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002990 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002991 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002992
Rafal Slawikbf67d072018-10-23 11:07:54 +01002993 // # of page-faults
2994 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002995
Rafal Slawikbf67d072018-10-23 11:07:54 +01002996 // # of major page-faults
2997 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002998
Rafal Slawikbf67d072018-10-23 11:07:54 +01002999 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003000 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003001 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003002
Rafal Slawikd03ae422018-11-20 11:27:45 +00003003 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003004 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003005
3006 // Elapsed real time when the process started.
3007 // Value is read from /proc/PID/stat, field 22.
3008 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003009}
3010
3011/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003012 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003013 *
3014 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3015 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003016 *
3017 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003018 */
3019message ProcessMemoryHighWaterMark {
3020 // The uid if available. -1 means not available.
3021 optional int32 uid = 1 [(is_uid) = true];
3022
Rafal Slawikda51b932018-12-13 16:31:33 +00003023 // The process name.
3024 // Usually package name or process cmdline.
3025 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003026 optional string process_name = 2;
3027
3028 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3029 // /proc/PID/status.
3030 optional int64 rss_high_water_mark_in_bytes = 3;
3031}
3032
3033/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003034 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003035 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003036message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003037 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003038}
3039
3040/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003041 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003042 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003043message SystemUptime {
3044 // Milliseconds since the system was booted.
3045 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3046 // for external input).
3047 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003048 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003049}
3050
3051/*
3052 * Reads from /proc/uid_concurrent_active_time which has the format:
3053 * active: X (X is # cores)
3054 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3055 * [uid1]: [time-0] [time-1] [time-2] ... ...
3056 * ...
3057 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3058 * The file contains a monotonically increasing count of time for a single boot.
3059 */
3060message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003061 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003062 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003063}
3064
3065/**
3066 * Reads from /proc/uid_concurrent_policy_time which has the format:
3067 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3068 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3069 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3070 * ...
3071 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3072 * The file contains a monotonically increasing count of time for a single boot.
3073 */
3074message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003075 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003076 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003077 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003078}
3079
3080/*
3081 * Pulls free disk space, for data, system partition and temporary directory.
3082 */
3083message DiskSpace {
3084 // available bytes in data partition
3085 optional uint64 data_available_bytes = 1;
3086 // available bytes in system partition
3087 optional uint64 system_available_bytes = 2;
3088 // available bytes in download cache or temp directories
3089 optional uint64 temp_available_bytes = 3;
3090}
Tej Singhbf972d92018-01-10 20:51:13 -08003091
3092/**
3093 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003094 *
3095 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003096 */
3097message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003098 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003099}
3100
3101/**
3102 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003103 * Pulled from:
3104 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003105 */
3106message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003107 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003108}
3109
3110/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003111 * Pulls battery voltage.
3112 * Pulled from:
3113 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3114 */
3115message BatteryVoltage {
3116 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003117 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003118}
3119
3120/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003121 * Pulls battery level (percent full, from 0 to 100).
3122 *
3123 * Pulled from:
3124 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3125 */
3126message BatteryLevel {
3127 // Battery level. Should be in [0, 100].
3128 optional int32 battery_level = 1;
3129}
3130
3131/**
Tej Singhd89137e2018-03-26 14:51:40 -07003132 * Pulls the temperature of various parts of the device.
3133 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003134 *
3135 * Pulled from:
3136 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3137 */
3138message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003139 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003140 optional android.os.TemperatureTypeEnum sensor_location = 1;
3141
3142 // The name of the temperature source. Eg. CPU0
3143 optional string sensor_name = 2;
3144
Tej Singhd89137e2018-03-26 14:51:40 -07003145 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003146 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003147 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003148}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003149
3150/**
3151 * Pulls the statistics of calls to Binder.
3152 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003153 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3154 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003155 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003156 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003157 */
3158message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003159 // UID of the process responsible for the binder transaction. It will be set if the process
3160 // executing the binder transaction attribute the transaction to another uid using
3161 // Binder.setThreadWorkSource().
3162 //
3163 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003164 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003165 // UID of the process executing the binder transaction.
3166 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003167 // Fully qualified class name of the API call.
3168 //
3169 // This is a system server class name.
3170 //
3171 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3172 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3173 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3174 // commonly used APIs.
3175 optional string service_class_name = 2;
3176 // Method name of the API call. It can also be a transaction code if we cannot
3177 // resolve it to a name. See Binder#getTransactionName.
3178 //
3179 // This is a system server method name.
3180 optional string service_method_name = 3;
3181 // Total number of API calls.
3182 optional int64 call_count = 4;
3183 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3184 optional bool screen_interactive = 13;
3185 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3186 // call_count will be equal to recorded_call_count.
3187 //
3188 // If recorded_call_count is different than call_count, it means data collection has been
3189 // sampled. All the fields below will be sampled in this case.
3190 optional int64 recorded_call_count = 12;
3191 // Number of exceptions thrown by the API.
3192 optional int64 recorded_exception_count = 5;
3193 // Total latency of all API calls.
3194 // Average can be computed using total_latency_micros / recorded_call_count.
3195 optional int64 recorded_total_latency_micros = 6;
3196 // Maximum latency of one API call.
3197 optional int64 recorded_max_latency_micros = 7;
3198 // Total CPU usage of all API calls.
3199 // Average can be computed using total_cpu_micros / recorded_call_count.
3200 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3201 optional int64 recorded_total_cpu_micros = 8;
3202 // Maximum CPU usage of one API call.
3203 optional int64 recorded_max_cpu_micros = 9;
3204 // Maximum parcel reply size of one API call.
3205 optional int64 recorded_max_reply_size_bytes = 10;
3206 // Maximum parcel request size of one API call.
3207 optional int64 recorded_max_request_size_bytes = 11;
3208}
3209
3210/**
3211 * Pulls the statistics of exceptions during calls to Binder.
3212 *
3213 * Binder stats are cumulative from boot unless somebody reset the data using
3214 * > adb shell dumpsys binder_calls_stats --reset
3215 */
3216message BinderCallsExceptions {
3217 // Exception class name, e.g. java.lang.IllegalArgumentException.
3218 //
3219 // This is an exception class name thrown by the system server.
3220 optional string exception_class_name = 1;
3221 // Total number of exceptions.
3222 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003223}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003224
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003225/**
3226 * Pulls the statistics of message dispatching on HandlerThreads.
3227 *
3228 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3229 * config on the device.
3230 *
3231 * Next tag: 11
3232 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003233message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003234 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003235 optional int32 uid = 1 [(is_uid) = true];
3236
3237 // Fully qualified class name of the handler target class.
3238 //
3239 // This field does not contain PII. This is a system server class name.
3240 optional string handler_class_name = 2;
3241
3242 // The name of the thread that runs the Looper.
3243 //
3244 // This field does not contain PII. This is a system server thread name.
3245 optional string looper_thread_name = 3;
3246
3247 // The name of the dispatched message.
3248 //
3249 // This field does not contain PII. This is a system server constant or class
3250 // name.
3251 optional string message_name = 4;
3252
3253 // Total number of successfully dispatched messages.
3254 optional int64 message_count = 5;
3255
3256 // Total number of messages that failed dispatching.
3257 optional int64 exception_count = 6;
3258
3259 // Total number of processed messages we have data recorded for. If we
3260 // collected data for all the messages, message_count will be equal to
3261 // recorded_message_count.
3262 //
3263 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003264 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003265 optional int64 recorded_message_count = 7;
3266
3267 // Total latency of all processed messages.
3268 // Average can be computed using recorded_total_latency_micros /
3269 // recorded_message_count.
3270 optional int64 recorded_total_latency_micros = 8;
3271
3272 // Total CPU usage of all processed message.
3273 // Average can be computed using recorded_total_cpu_micros /
3274 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003275 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003276 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003277
3278 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3279 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003280
3281 // Max recorded CPU usage of all processed messages.
3282 optional int64 recorded_max_cpu_micros = 11;
3283
3284 // Max recorded latency of all processed messages.
3285 optional int64 recorded_max_latency_micros = 12;
3286
3287 // Total number of messages we tracked the dispatching delay for. If we
3288 // collected data for all the messages, message_count will be equal to
3289 // recorded_delay_message_count.
3290 //
3291 // If recorded_delay_message_count is different than message_count, it means data
3292 // collection has been sampled or/and not all messages specified the target dispatch time.
3293 // The fields below will be sampled in this case.
3294 optional int64 recorded_delay_message_count = 13;
3295
3296 // Total dispatching delay of all processed messages.
3297 // Calculated as a difference between the target dispatching time (Message.when)
3298 // and the actual dispatching time.
3299 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3300 optional int64 recorded_total_delay_millis = 14;
3301
3302 // Max dispatching delay of all processed messages.
3303 // Calculated as a difference between the target dispatching time (Message.when)
3304 // and the actual dispatching time.
3305 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003306}
Tej Singh86dc9db2018-09-06 00:39:57 +00003307
3308/**
3309 * Pulls disk information, such as write speed and latency.
3310 */
3311message DiskStats {
3312 // Time taken to open, write 512B to, and close a file.
3313 // -1 if error performing the check.
3314 optional int64 data_write_latency_millis = 1;
3315
3316 optional bool file_based_encryption = 2;
3317
3318 // Recent disk write speed in kB/s.
3319 // -1 if error querying storageed.
3320 // 0 if data is unavailable.
3321 optional int32 recent_disk_write_speed = 3;
3322}
3323
3324
3325/**
3326 * Free and total bytes of the Data, Cache, and System partition.
3327 */
3328message DirectoryUsage {
3329 enum Directory {
3330 UNKNOWN = 0;
3331 DATA = 1;
3332 CACHE = 2;
3333 SYSTEM = 3;
3334 }
3335 optional Directory directory = 1;
3336 optional int64 free_bytes = 2;
3337 optional int64 total_bytes = 3;
3338}
3339
3340
3341/**
3342 * Size of an application: apk size, data size, and cache size.
3343 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3344 * Information is only reported for apps with the primary user (user 0).
3345 * Sizes are aggregated by package name.
3346 */
3347message AppSize {
3348 // Including uids will involve modifying diskstats logic.
3349 optional string package_name = 1;
3350 // App size in bytes. -1 if unavailable.
3351 optional int64 app_size_bytes = 2;
3352 // App data size in bytes. -1 if unavailable.
3353 optional int64 app_data_size_bytes = 3;
3354 // App cache size in bytes. -1 if unavailable.
3355 optional int64 app_cache_size_bytes = 4;
3356 // Time that the cache file was produced.
3357 // Uses System.currentTimeMillis(), which is wall clock time.
3358 optional int64 cache_time_millis = 5;
3359}
3360
3361
3362/**
3363 * Size of a particular category. Eg: photos, videos.
3364 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3365 */
3366message CategorySize {
3367 enum Category {
3368 UNKNOWN = 0;
3369 APP_SIZE = 1;
3370 APP_DATA_SIZE = 2;
3371 APP_CACHE_SIZE = 3;
3372 PHOTOS = 4;
3373 VIDEOS = 5;
3374 AUDIO = 6;
3375 DOWNLOADS = 7;
3376 SYSTEM = 8;
3377 OTHER = 9;
3378 }
3379 optional Category category = 1;
3380 // Category size in bytes.
3381 optional int64 size_bytes = 2;
3382 // Time that the cache file was produced.
3383 // Uses System.currentTimeMillis(), which is wall clock time.
3384 optional int64 cache_time_millis = 3;
3385}
Tej Singhd6d6d772018-09-05 17:41:25 -07003386
3387/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003388 * Pulls per uid I/O stats. The stats are cumulative since boot.
3389 *
3390 * Read/write bytes are I/O events from a storage device
3391 * Read/write chars are data requested by read/write syscalls, and can be
3392 * satisfied by caching.
3393 *
3394 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3395 */
3396message DiskIo {
3397 optional int32 uid = 1 [(is_uid) = true];
3398 optional int64 fg_chars_read = 2;
3399 optional int64 fg_chars_write = 3;
3400 optional int64 fg_bytes_read = 4;
3401 optional int64 fg_bytes_write = 5;
3402 optional int64 bg_chars_read = 6;
3403 optional int64 bg_chars_write = 7;
3404 optional int64 bg_bytes_read = 8;
3405 optional int64 bg_bytes_write = 9;
3406 optional int64 fg_fsync = 10;
3407 optional int64 bg_fsync= 11;
3408}
3409
3410
3411/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003412 * Pulls the number of fingerprints for each user.
3413 *
Kevin Chyn1741a072019-01-17 11:54:40 -08003414 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07003415 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003416message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07003417 // The associated user. Eg: 0 for owners, 10+ for others.
3418 // Defined in android/os/UserHandle.java
3419 optional int32 user = 1;
3420 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08003421 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003422}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003423
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08003424/**
3425 * A mapping of role holder -> role
3426 */
3427message RoleHolder {
3428 // uid of the role holder
3429 optional int32 uid = 1 [(is_uid) = true];
3430
3431 // package name of the role holder
3432 optional string package_name = 2;
3433
3434 // the role held
3435 optional string role = 3;
3436}
3437
Yangsteraf9aee72018-10-12 09:26:16 -07003438message AggStats {
3439 optional int64 min = 1;
3440
3441 optional int64 average = 2;
3442
3443 optional int64 max = 3;
3444}
3445
3446message ProcessStatsStateProto {
3447 optional android.service.procstats.ScreenState screen_state = 1;
3448
3449 optional android.service.procstats.MemoryState memory_state = 2;
3450
3451 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3452 // and not frameworks/base/core/java/android/app/ActivityManager.java
3453 optional android.service.procstats.ProcessState process_state = 3;
3454
3455 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003456 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003457
3458 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003459 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003460
3461 // # of samples taken
3462 optional int32 sample_size = 5;
3463
3464 // PSS is memory reserved for this process
3465 optional AggStats pss = 6;
3466
3467 // USS is memory shared between processes, divided evenly for accounting
3468 optional AggStats uss = 7;
3469
3470 // RSS is memory resident for this process
3471 optional AggStats rss = 8;
3472}
3473
3474// Next Tag: 7
3475message ProcessStatsProto {
3476 // Name of process.
3477 optional string process = 1;
3478
3479 // Uid of the process.
3480 optional int32 uid = 2;
3481
3482 // Information about how often kills occurred
3483 message Kill {
3484 // Count of excessive CPU kills
3485 optional int32 cpu = 1;
3486
3487 // Count of kills when cached
3488 optional int32 cached = 2;
3489
3490 // PSS stats during cached kill
3491 optional AggStats cached_pss = 3;
3492 }
3493 optional Kill kill = 3;
3494
3495 // Time and memory spent in various states.
3496 repeated ProcessStatsStateProto states = 5;
3497
3498 // Total time process has been running... screen_state, memory_state, and process_state
3499 // will not be set.
3500 optional ProcessStatsStateProto total_running_state = 6;
3501}
3502
3503message PackageServiceOperationStatsProto {
3504 // Operate enum: Started, Foreground, Bound, Executing
3505 optional android.service.procstats.ServiceOperationState operation = 1;
3506
3507 // Number of times the service was in this operation.
3508 optional int32 count = 2;
3509
3510 // Information about a state the service can be in.
3511 message StateStats {
3512 // Screen state enum.
3513 optional android.service.procstats.ScreenState screen_state = 1;
3514 // Memory state enum.
3515 optional android.service.procstats.MemoryState memory_state = 2;
3516
3517 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003518 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003519 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003520 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003521 }
3522 repeated StateStats state_stats = 3;
3523}
3524
3525message PackageServiceStatsProto {
3526 // Name of service component.
3527 optional string service_name = 1;
3528
3529 // The operation stats.
3530 // The package_name, package_uid, package_version, service_name will not be set to save space.
3531 repeated PackageServiceOperationStatsProto operation_stats = 2;
3532}
3533
3534message PackageAssociationSourceProcessStatsProto {
3535 // Uid of the process.
3536 optional int32 process_uid = 1;
3537 // Process name.
3538 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08003539 // Package name.
3540 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07003541 // Total count of the times this association appeared.
3542 optional int32 total_count = 3;
3543
3544 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003545 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003546
3547 // Total count of the times this association became actively impacting its target process.
3548 optional int32 active_count = 5;
3549
3550 // Information on one source in this association.
3551 message StateStats {
3552 // Process state enum.
3553 optional android.service.procstats.ProcessState process_state = 1;
3554 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003555 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003556 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003557 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003558 }
3559 repeated StateStats active_state_stats = 6;
3560}
3561
3562message PackageAssociationProcessStatsProto {
3563 // Name of the target component.
3564 optional string component_name = 1;
3565 // Information on one source in this association.
3566 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3567}
3568
3569
3570message ProcessStatsPackageProto {
3571 // Name of package.
3572 optional string package = 1;
3573
3574 // Uid of the package.
3575 optional int32 uid = 2;
3576
3577 // Version of the package.
3578 optional int64 version = 3;
3579
3580 // Stats for each process running with the package loaded in to it.
3581 repeated ProcessStatsProto process_stats = 4;
3582
3583 // Stats for each of the package's services.
3584 repeated PackageServiceStatsProto service_stats = 5;
3585
3586 // Stats for each association with the package.
3587 repeated PackageAssociationProcessStatsProto association_stats = 6;
3588}
3589
3590message ProcessStatsSectionProto {
3591 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003592 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003593
3594 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003595 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003596
3597 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003598 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003599
3600 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003601 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003602
3603 // System runtime library. e.g. "libdvm.so", "libart.so".
3604 optional string runtime = 5;
3605
3606 // whether kernel reports swapped pss.
3607 optional bool has_swapped_pss = 6;
3608
3609 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3610 enum Status {
3611 STATUS_UNKNOWN = 0;
3612 STATUS_COMPLETE = 1;
3613 STATUS_PARTIAL = 2;
3614 STATUS_SHUTDOWN = 3;
3615 STATUS_SYSPROPS = 4;
3616 }
3617 repeated Status status = 7;
3618
Chenjie Yub2ecc792019-01-17 10:27:26 -08003619 // Number of pages available of various types and sizes, representation fragmentation.
3620 repeated ProcessStatsAvailablePagesProto available_pages = 10;
3621
Yangsteraf9aee72018-10-12 09:26:16 -07003622 // Stats for each process.
3623 repeated ProcessStatsProto process_stats = 8;
3624
3625 // Stats for each package.
3626 repeated ProcessStatsPackageProto package_stats = 9;
3627}
3628
Chenjie Yub2ecc792019-01-17 10:27:26 -08003629message ProcessStatsAvailablePagesProto {
3630 // Node these pages are in (as per /proc/pagetypeinfo)
3631 optional int32 node = 1;
3632
3633 // Zone these pages are in (as per /proc/pagetypeinfo)
3634 optional string zone = 2;
3635
3636 // Label for the type of these pages (as per /proc/pagetypeinfo)
3637 optional string label = 3;
3638
3639 // Distribution of number of pages available by order size. First entry in array is
3640 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
3641 repeated int32 pages_per_order = 4;
3642}
3643
Chenjie Yu12e5e672018-09-14 15:54:59 -07003644/**
3645 * Pulled from ProcessStatsService.java
3646 */
3647message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003648 optional ProcessStatsSectionProto proc_stats_section = 1;
3649}
3650
Chenjie Yuf910b7802019-01-11 16:08:20 -08003651/**
3652 * Pulled from ProcessStatsService.java
3653 */
3654message ProcStatsPkgProc {
3655 optional ProcessStatsSectionProto proc_stats_section = 1;
3656}
3657
Yangsteraf9aee72018-10-12 09:26:16 -07003658message PowerProfileProto {
3659 optional double cpu_suspend = 1;
3660
3661 optional double cpu_idle = 2;
3662
3663 optional double cpu_active = 3;
3664
3665 message CpuCluster {
3666 optional int32 id = 1;
3667 optional double cluster_power = 2;
3668 optional int32 cores = 3;
3669 repeated int64 speed = 4;
3670 repeated double core_power = 5;
3671 }
3672
3673 repeated CpuCluster cpu_cluster = 40;
3674
3675 optional double wifi_scan = 4;
3676
3677 optional double wifi_on = 5;
3678
3679 optional double wifi_active = 6;
3680
3681 optional double wifi_controller_idle = 7;
3682
3683 optional double wifi_controller_rx = 8;
3684
3685 optional double wifi_controller_tx = 9;
3686
3687 repeated double wifi_controller_tx_levels = 10;
3688
3689 optional double wifi_controller_operating_voltage = 11;
3690
3691 optional double bluetooth_controller_idle = 12;
3692
3693 optional double bluetooth_controller_rx = 13;
3694
3695 optional double bluetooth_controller_tx = 14;
3696
3697 optional double bluetooth_controller_operating_voltage = 15;
3698
3699 optional double modem_controller_sleep = 16;
3700
3701 optional double modem_controller_idle = 17;
3702
3703 optional double modem_controller_rx = 18;
3704
3705 repeated double modem_controller_tx = 19;
3706
3707 optional double modem_controller_operating_voltage = 20;
3708
3709 optional double gps_on = 21;
3710
3711 repeated double gps_signal_quality_based = 22;
3712
3713 optional double gps_operating_voltage = 23;
3714
3715 optional double bluetooth_on = 24;
3716
3717 optional double bluetooth_active = 25;
3718
3719 optional double bluetooth_at_cmd = 26;
3720
3721 optional double ambient_display = 27;
3722
3723 optional double screen_on = 28;
3724
3725 optional double radio_on = 29;
3726
3727 optional double radio_scanning = 30;
3728
3729 optional double radio_active = 31;
3730
3731 optional double screen_full = 32;
3732
3733 optional double audio = 33;
3734
3735 optional double video = 34;
3736
3737 optional double flashlight = 35;
3738
3739 optional double memory = 36;
3740
3741 optional double camera = 37;
3742
3743 optional double wifi_batched_scan = 38;
3744
3745 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003746}
Chenjie Yuab530202018-09-26 12:39:20 -07003747
3748/**
3749 * power_profile.xml and other constants for power model calculations.
3750 * Pulled from PowerProfile.java
3751 */
3752message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003753 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003754}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003755
3756/**
arangelovd5db50e2018-10-12 20:24:39 +01003757 * Logs when a user restriction was added or removed.
3758 *
3759 * Logged from:
3760 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3761 */
3762message UserRestrictionChanged {
3763 // The raw string of the user restriction as defined in UserManager.
3764 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3765 optional string restriction = 1;
3766 // Whether the restriction is enabled or disabled.
3767 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003768}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003769
3770/**
3771 * Pulls process user time and system time. Puller takes a snapshot of all pids
3772 * in the system and returns cpu stats for those that are working at the time.
3773 * Dead pids will be dropped. Kernel processes are excluded.
3774 * Min cool-down is 5 sec.
3775 */
3776message ProcessCpuTime {
3777 optional int32 uid = 1 [(is_uid) = true];
3778
3779 optional string process_name = 2;
3780 // Process cpu time in user space, cumulative from boot/process start
3781 optional int64 user_time_millis = 3;
3782 // Process cpu time in system space, cumulative from boot/process start
3783 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003784}
Misha Wagner5a51e002018-10-03 15:04:09 +01003785
3786/**
3787 * Pulls the CPU usage for each thread.
3788 *
3789 * Read from /proc/$PID/task/$TID/time_in_state files.
3790 *
3791 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3792 * time_in_state files not being present on some phones, have not been addressed. These should be
3793 * considered before a public release.
3794 */
3795message CpuTimePerThreadFreq {
3796 // UID that owns the process.
3797 optional int32 uid = 1 [(is_uid) = true];
3798 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003799 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003800 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003801 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003802 // Name of the process taken from `/proc/$PID/cmdline`.
3803 optional string process_name = 4;
3804 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3805 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003806
3807 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3808 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3809 // frequencies are given here as the alternative is sending eight separate atoms. This method
3810 // significantly reduces the amount of data created
3811 optional int32 frequency1_khz = 6;
3812 optional int32 time1_millis = 7;
3813 optional int32 frequency2_khz = 8;
3814 optional int32 time2_millis = 9;
3815 optional int32 frequency3_khz = 10;
3816 optional int32 time3_millis = 11;
3817 optional int32 frequency4_khz = 12;
3818 optional int32 time4_millis = 13;
3819 optional int32 frequency5_khz = 14;
3820 optional int32 time5_millis = 15;
3821 optional int32 frequency6_khz = 16;
3822 optional int32 time6_millis = 17;
3823 optional int32 frequency7_khz = 18;
3824 optional int32 time7_millis = 19;
3825 optional int32 frequency8_khz = 20;
3826 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003827}
Bookatz75ee6042018-11-09 12:27:37 -08003828
3829/**
Bookatz366a4432018-11-20 09:42:33 -08003830 * Pulls information about the device's build.
3831 */
3832message BuildInformation {
3833 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3834 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3835 optional string fingerprint = 1;
3836
3837 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3838 optional string brand = 2;
3839
3840 // Build.PRODUCT. The name of the overall product.
3841 optional string product = 3;
3842
3843 // Build.DEVICE. The name of the industrial design.
3844 optional string device = 4;
3845
3846 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3847 optional string version_release = 5;
3848
3849 // Build.ID. E.g. a label like "M4-rc20".
3850 optional string id = 6;
3851
3852 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3853 // represent this build.
3854 optional string version_incremental = 7;
3855
3856 // Build.TYPE. The type of build, like "user" or "eng".
3857 optional string type = 8;
3858
3859 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3860 optional string tags = 9;
3861}
3862
3863/**
Bookatz75ee6042018-11-09 12:27:37 -08003864 * Pulls on-device BatteryStats power use calculations for the overall device.
3865 */
3866message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08003867 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3868 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3869 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3870 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08003871}
3872
3873/**
3874 * Pulls on-device BatteryStats power use calculations broken down by uid.
3875 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3876 * that is attributed to non-uid items. They must all be included to get the total power use.
3877 */
3878message DeviceCalculatedPowerBlameUid {
3879 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3880 optional int32 uid = 1 [(is_uid) = true];
3881
Bookatz3dbc13a2018-12-21 12:16:51 -08003882 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3883 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3884 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08003885}
3886
3887/**
3888 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3889 * drain type.
3890 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3891 * is attributed uids. They must all be included to get the total power use.
3892 */
3893message DeviceCalculatedPowerBlameOther {
3894 // The type of item whose power use is being reported.
3895 enum DrainType {
3896 AMBIENT_DISPLAY = 0;
3897 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3898 BLUETOOTH = 2;
3899 CAMERA = 3;
3900 // Cell-standby
3901 CELL = 4;
3902 FLASHLIGHT = 5;
3903 IDLE = 6;
3904 MEMORY = 7;
3905 // Amount that total computed drain exceeded the drain estimated using the
3906 // battery level changes and capacity.
3907 OVERCOUNTED = 8;
3908 PHONE = 9;
3909 SCREEN = 10;
3910 // Amount that total computed drain was below the drain estimated using the
3911 // battery level changes and capacity.
3912 UNACCOUNTED = 11;
3913 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3914 WIFI = 13;
3915 }
3916 optional DrainType drain_type = 1;
3917
Bookatz3dbc13a2018-12-21 12:16:51 -08003918 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3919 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3920 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003921}
arangelov4e994062018-11-13 16:12:38 +00003922
3923/**
3924 * Logs device policy features.
3925 *
3926 * Logged from:
3927 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3928 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3929 */
3930message DevicePolicyEvent {
3931 // The event id - unique for each event.
3932 optional android.stats.devicepolicy.EventId event_id = 1;
3933 // The admin package name.
3934 optional string admin_package_name = 2;
3935 // A generic integer parameter.
3936 optional int32 integer_value = 3;
3937 // A generic boolean parameter.
3938 optional bool boolean_value = 4;
3939 // A parameter specifying a time period in milliseconds.
3940 optional uint64 time_period_millis = 5;
3941 // A parameter specifying a list of package names, bundle extras or string parameters.
3942 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3943}
shawnlinea5b66b2018-11-13 15:05:29 +08003944
3945/**
3946 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3947 *
3948 * Logged from:
3949 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3950 */
3951message DocsUILaunchReported {
3952 optional android.stats.docsui.LaunchAction launch_action = 1;
3953 optional bool has_initial_uri = 2;
3954 optional android.stats.docsui.MimeType mime_type = 3;
3955 optional android.stats.docsui.Root initial_root = 4;
3956}
3957
3958/**
3959 * Logs root/app visited event in file managers/picker. Call this when the user
3960 * taps on root/app in hamburger menu.
3961 *
3962 * Logged from:
3963 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3964 */
3965message DocsUIRootVisitedReported {
3966 optional android.stats.docsui.ContextScope scope = 1;
3967 optional android.stats.docsui.Root root = 2;
3968}
3969
3970/**
3971 * Logs file operation stats. Call this when a file operation has completed.
3972 *
3973 * Logged from:
3974 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3975 */
3976message DocsUIFileOperationReported {
3977 optional android.stats.docsui.Provider provider = 1;
3978 optional android.stats.docsui.FileOperation file_op = 2;
3979}
3980
3981/**
3982 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3983 * mode.
3984 *
3985 * Logged from:
3986 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3987 */
3988message DocsUIFileOperationCopyMoveModeReported {
3989 optional android.stats.docsui.FileOperation file_op = 1;
3990 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3991}
3992
3993
3994/**
3995 * Logs file sub operation stats. Call this when a file operation has failed.
3996 *
3997 * Logged from:
3998 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3999 */
4000message DocsUIFileOperationFailureReported {
4001 optional android.stats.docsui.Authority authority = 1;
4002 optional android.stats.docsui.SubFileOperation sub_op = 2;
4003}
4004
4005/**
4006* Logs the cancellation of a file operation. Call this when a job is canceled
4007*
4008* Logged from:
4009* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4010*/
4011message DocsUIFileOperationCanceledReported {
4012 optional android.stats.docsui.FileOperation file_op = 1;
4013}
4014
4015/**
4016 * Logs startup time in milliseconds.
4017 *
4018 * Logged from:
4019 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4020 */
4021message DocsUIStartupMsReported {
4022 optional int32 startup_millis = 1;
4023}
4024
4025/**
4026 * Logs the action that was started by user.
4027 *
4028 * Logged from:
4029 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4030 */
4031message DocsUIUserActionReported {
4032 optional android.stats.docsui.UserAction action = 1;
4033}
4034
4035/**
4036 * Logs the invalid type when invalid scoped access is requested.
4037 *
4038 * Logged from:
4039 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4040 */
4041message DocsUIInvalidScopedAccessRequestReported {
4042 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004043}
Ben Murdochbab399f2018-12-06 11:01:38 +00004044
4045/**
shawnlina75e82d2019-01-07 10:31:12 +08004046 * Logs the package name that launches docsui picker mode.
4047 *
4048 * Logged from:
4049 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4050 */
4051message DocsUIPickerLaunchedFromReported {
4052 optional string package_name = 1;
4053}
4054
4055/**
4056 * Logs the search type.
4057 *
4058 * Logged from:
4059 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4060 */
4061message DocsUISearchTypeReported {
4062 optional android.stats.docsui.SearchType search_type = 1;
4063}
4064
4065/**
4066 * Logs the search mode.
4067 *
4068 * Logged from:
4069 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4070 */
4071message DocsUISearchModeReported {
4072 optional android.stats.docsui.SearchMode search_mode = 1;
4073}
4074
4075/**
4076 * Logs the pick result information.
4077 *
4078 * Logged from:
4079 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4080 */
4081message DocsUIPickResultReported {
4082 optional int32 total_action_count = 1;
4083 optional int64 duration_millis = 2;
4084 optional int32 file_count= 3;
4085 optional bool is_searching = 4;
4086 optional android.stats.docsui.Root picked_from = 5;
4087 optional android.stats.docsui.MimeType mime_type = 6;
4088 optional int32 repeatedly_pick_times = 7;
4089}
4090
4091/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004092 * Logs when an app's memory is compacted.
4093 *
4094 * Logged from:
4095 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4096 */
4097message AppCompacted {
4098 // The pid of the process being compacted.
4099 optional int32 pid = 1;
4100
4101 // The name of the process being compacted.
4102 optional string process_name = 2;
4103
4104 // The type of compaction.
4105 enum Action {
4106 UNKNOWN = 0;
4107 SOME = 1;
4108 FULL = 2;
4109 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004110 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004111
4112 // Total RSS in kilobytes consumed by the process prior to compaction.
4113 optional int64 before_rss_total_kilobytes = 4;
4114
4115 // File RSS in kilobytes consumed by the process prior to compaction.
4116 optional int64 before_rss_file_kilobytes = 5;
4117
4118 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4119 optional int64 before_rss_anon_kilobytes = 6;
4120
4121 // Swap in kilobytes consumed by the process prior to compaction.
4122 optional int64 before_swap_kilobytes = 7;
4123
4124 // Total RSS in kilobytes consumed by the process after compaction.
4125 optional int64 after_rss_total_kilobytes = 8;
4126
4127 // File RSS in kilobytes consumed by the process after compaction.
4128 optional int64 after_rss_file_kilobytes = 9;
4129
4130 // Anonymous RSS in kilobytes consumed by the process after compaction.
4131 optional int64 after_rss_anon_kilobytes = 10;
4132
4133 // Swap in kilobytes consumed by the process after compaction.
4134 optional int64 after_swap_kilobytes = 11;
4135
4136 // The time taken to perform compaction in milliseconds.
4137 optional int64 time_to_compact_millis = 12;
4138
4139 // The last compaction action performed for this app.
4140 optional Action last_action = 13;
4141
Ben Murdoch01720b82018-12-19 18:03:44 +00004142 // The last time that compaction was attempted on this process in milliseconds
4143 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4144 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004145
Ben Murdoch01720b82018-12-19 18:03:44 +00004146 // The oom_score_adj at the time of compaction.
4147 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004148
4149 // The process state at the time of compaction.
4150 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4151}
lifr157fc552018-12-12 16:38:04 +08004152
4153/**
4154 * Logs the latency period(in microseconds) and the return code of
4155 * the DNS(Domain Name System) lookups.
4156 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4157 * to get info(address or hostname) from DNS server(or DNS cache).
4158 * Logged from:
4159 * /system/netd/server/DnsProxyListener.cpp
4160 */
4161message NetworkDnsEventReported {
4162 // The types of the DNS lookups, as defined in
4163 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4164 enum EventType {
4165 EVENT_UNKNOWN = 0;
4166 EVENT_GETADDRINFO = 1;
4167 EVENT_GETHOSTBYNAME = 2;
4168 EVENT_GETHOSTBYADDR = 3;
4169 EVENT_RES_NSEND = 4;
4170 }
4171 optional EventType event_type = 1;
4172
4173 // The return value of the DNS resolver for each DNS lookups.
4174 //bionic/libc/include/netdb.h
4175 //system/netd/resolv/include/netd_resolv/resolv.h
4176 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004177 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004178 EAI_ADDRFAMILY = 1;
4179 EAI_AGAIN = 2;
4180 EAI_BADFLAGS = 3;
4181 EAI_FAIL = 4;
4182 EAI_FAMILY = 5;
4183 EAI_MEMORY = 6;
4184 EAI_NODATA = 7;
4185 EAI_NONAME = 8;
4186 EAI_SERVICE = 9;
4187 EAI_SOCKTYPE = 10;
4188 EAI_SYSTEM = 11;
4189 EAI_BADHINTS = 12;
4190 EAI_PROTOCOL = 13;
4191 EAI_OVERFLOW = 14;
4192 RESOLV_TIMEOUT = 255;
4193 EAI_MAX = 256;
4194 }
4195 optional ReturnCode return_code = 2;
4196
4197 // The latency period(in microseconds) it took for this DNS lookup to complete.
4198 optional int32 latency_micros = 3;
4199}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004200
4201/**
4202 * Logs when a data stall event occurs.
4203 *
4204 * Log from:
4205 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4206 */
4207message DataStallEvent {
4208 // Data stall evaluation type.
4209 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4210 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4211 optional int32 evaluation_type = 1;
4212 // See definition in data_stall_event.proto.
4213 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4214 // See definition in data_stall_event.proto.
4215 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4216 // See definition in data_stall_event.proto.
4217 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4218 // See definition in data_stall_event.proto.
4219 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4220 // See definition in data_stall_event.proto.
4221 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4222}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004223
4224/*
4225 * Logs when RescueParty resets some set of experiment flags.
4226 *
4227 * Logged from:
4228 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4229 */
4230message RescuePartyResetReported {
4231 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4232 optional int32 rescue_level = 1;
4233}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004234
4235/**
4236 * Logs when signed config is received from an APK, and if that config was applied successfully.
4237 * Logged from:
4238 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4239 */
4240message SignedConfigReported {
4241 enum Type {
4242 UNKNOWN_TYPE = 0;
4243 GLOBAL_SETTINGS = 1;
4244 }
4245 optional Type type = 1;
4246
4247 // The final status of the signed config received.
4248 enum Status {
4249 UNKNOWN_STATUS = 0;
4250 APPLIED = 1;
4251 BASE64_FAILURE_CONFIG = 2;
4252 BASE64_FAILURE_SIGNATURE = 3;
4253 SECURITY_EXCEPTION = 4;
4254 INVALID_CONFIG = 5;
4255 OLD_CONFIG = 6;
4256 SIGNATURE_CHECK_FAILED = 7;
4257 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004258 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004259 }
4260 optional Status status = 2;
4261
4262 // The version of the signed config processed.
4263 optional int32 version = 3;
4264
4265 // The package name that the config was extracted from.
4266 optional string from_package = 4;
4267
4268 enum Key {
4269 NO_KEY = 0;
4270 DEBUG = 1;
4271 PRODUCTION = 2;
4272 }
4273 // Which key was used to verify the config.
4274 optional Key verified_with = 5;
4275}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004276
4277/*
4278 * Logs GNSS Network-Initiated (NI) location events.
4279 *
4280 * Logged from:
4281 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4282 */
4283message GnssNiEventReported {
4284 // The type of GnssNiEvent.
4285 enum EventType {
4286 UNKNOWN = 0;
4287 NI_REQUEST = 1;
4288 NI_RESPONSE = 2;
4289 }
4290 optional EventType event_type = 1;
4291
4292 // An ID generated by HAL to associate NI notifications and UI responses.
4293 optional int32 notification_id = 2;
4294
4295 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004296 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004297
4298 // NI requires notification.
4299 optional bool need_notify = 4;
4300
4301 // NI requires verification.
4302 optional bool need_verify = 5;
4303
4304 // NI requires privacy override, no notification/minimal trace.
4305 optional bool privacy_override = 6;
4306
4307 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4308 // seconds.
4309 optional int32 timeout = 7;
4310
4311 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004312 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004313
4314 // String representing the requester of the network inititated location request.
4315 optional string requestor_id = 9;
4316
4317 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4318 // network initiated location request.
4319 optional string text = 10;
4320
4321 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004322 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004323
4324 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004325 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004326
4327 // True if SUPL ES is enabled.
4328 optional bool is_supl_es_enabled = 13;
4329
4330 // True if GNSS location is enabled.
4331 optional bool is_location_enabled = 14;
4332
4333 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004334 optional android.server.location.GnssUserResponseType user_response = 15;
4335}
4336
4337/**
4338 * Logs GNSS non-framework (NFW) location notification.
4339 *
4340 * Logged from:
4341 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4342 */
4343message GnssNfwNotificationReported {
4344 // Package name of the Android proxy application representing the non-framework entity that
4345 // requested location. Set to empty string if unknown.
4346 optional string proxy_app_package_name = 1;
4347
4348 // Protocol stack that initiated the non-framework location request.
4349 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4350
4351 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4352 // set to empty string. This field is opaque to the framework and used for logging purposes.
4353 optional string other_protocol_stack_name = 3;
4354
4355 // Source initiating/receiving the location information.
4356 optional android.server.location.NfwRequestor requestor = 4;
4357
4358 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4359 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4360 // and used for logging purposes.
4361 optional string requestor_id = 5;
4362
4363 // Indicates whether location information was provided for this request.
4364 optional android.server.location.NfwResponseType response_type = 6;
4365
4366 // True if the device is in user initiated emergency session.
4367 optional bool in_emergency_mode = 7;
4368
4369 // True if cached location is provided.
4370 optional bool is_cached_location = 8;
4371
4372 // True if proxy app permission mismatch between framework and GNSS HAL.
4373 optional bool is_permission_mismatched = 9;
4374}
4375
4376/**
4377 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4378 *
4379 * Logged from:
4380 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4381 */
4382message GnssConfigurationReported {
4383 // SUPL host name.
4384 optional string supl_host = 1;
4385
4386 // SUPL port number.
4387 optional int32 supl_port = 2;
4388
4389 // C2K host name.
4390 optional string c2k_host = 3;
4391
4392 // C2K port number.
4393 optional int32 c2k_port = 4;
4394
4395 // The SUPL version requested by Carrier.
4396 optional int32 supl_ver = 5;
4397
4398 // The SUPL mode.
4399 optional android.server.location.SuplMode supl_mode = 6;
4400
4401 // True if NI emergency SUPL restrictions is enabled.
4402 optional bool supl_es = 7;
4403
4404 // LTE Positioning Profile settings
4405 optional android.server.location.LppProfile lpp_profile = 8;
4406
4407 // Positioning protocol on A-Glonass system.
4408 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4409
4410 // True if emergency PDN is used. Otherwise, regular PDN is used.
4411 optional bool use_emergency_pdn_for_emergency_supl= 10;
4412
4413 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4414 optional android.server.location.GpsLock gps_lock = 11;
4415
4416 // Number of seconds to extend the emergency session duration post emergency call.
4417 optional int32 es_extension_sec = 12;
4418
4419 // The full list of package names of proxy Android applications representing the non-framework
4420 // location access entities (on/off the device) for which the framework user has granted
4421 // non-framework location access permission. The package names are concatenated in one string
4422 // with spaces as separators.
4423 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004424}
Jack Yu95b64f32018-12-13 18:26:11 +08004425
4426/**
4427 * Logs when a NFC device's error occurred.
4428 * Logged from:
4429 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4430 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
4431 */
4432message NfcErrorOccurred {
4433 enum Type {
4434 UNKNOWN = 0;
4435 CMD_TIMEOUT = 1;
4436 ERROR_NOTIFICATION = 2;
4437 AID_OVERFLOW = 3;
4438 }
4439 optional Type type = 1;
4440 // If it's nci cmd timeout, log the timeout command.
4441 optional uint32 nci_cmd = 2;
4442
4443 optional uint32 error_ntf_status_code = 3;
4444}
4445
4446/**
4447 * Logs when a NFC device's state changed event
4448 * Logged from:
4449 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
4450 */
4451message NfcStateChanged {
4452 enum State {
4453 UNKNOWN = 0;
4454 OFF = 1;
4455 ON = 2;
4456 ON_LOCKED = 3; // Secure Nfc enabled.
4457 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
4458 }
4459 optional State state = 1;
4460}
4461
4462/**
4463 * Logs when a NFC Beam Transaction occurred.
4464 * Logged from:
4465 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
4466 */
4467message NfcBeamOccurred {
4468 enum Operation {
4469 UNKNOWN = 0;
4470 SEND = 1;
4471 RECEIVE = 2;
4472 }
4473 optional Operation operation = 1;
4474}
4475
4476/**
4477 * Logs when a NFC Card Emulation Transaction occurred.
4478 * Logged from:
4479 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
4480 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
4481 */
4482message NfcCardemulationOccurred {
4483 enum Category {
4484 UNKNOWN = 0;
4485 HCE_PAYMENT = 1;
4486 HCE_OTHER = 2;
4487 OFFHOST = 3;
4488 }
4489 // Transaction belongs to HCE payment or HCE other category, or offhost.
4490 optional Category category = 1;
4491 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
4492 optional string se_name = 2;
4493}
4494
4495/**
4496 * Logs when a NFC Tag event occurred.
4497 * Logged from:
4498 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
4499 */
4500message NfcTagOccurred {
4501 enum Type {
4502 UNKNOWN = 0;
4503 URL = 1;
4504 BT_PAIRING = 2;
4505 PROVISION = 3;
4506 WIFI_CONNECT = 4;
4507 APP_LAUNCH = 5;
4508 OTHERS = 6;
4509 }
4510 optional Type type = 1;
4511}
4512
4513/**
4514 * Logs when Hce transaction triggered
4515 * Logged from:
4516 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4517 */
4518message NfcHceTransactionOccurred {
4519 // The latency period(in microseconds) it took for the first HCE data
4520 // exchange.
4521 optional uint32 latency_micros = 1;
4522}
4523
4524/**
4525 * Logs when SecureElement state event changed
4526 * Logged from:
4527 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4528 */
4529message SeStateChanged {
4530 enum State {
4531 UNKNOWN = 0;
4532 INITIALIZED = 1;
4533 DISCONNECTED = 2;
4534 CONNECTED = 3;
4535 HALCRASH = 4;
4536 }
4537 optional State state = 1;
4538
4539 optional string state_change_reason = 2;
4540 // SIMx or eSEx.
4541 optional string terminal = 3;
4542}
4543
4544/**
4545 * Logs when Omapi API used
4546 * Logged from:
4547 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4548 */
4549message SeOmapiReported {
4550 enum Operation {
4551 UNKNOWN = 0;
4552 OPEN_CHANNEL = 1;
4553 }
4554 optional Operation operation = 1;
4555 // SIMx or eSEx.
4556 optional string terminal = 2;
4557
Jack Yu4bb90eb2019-01-23 15:13:41 +08004558 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08004559}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004560
4561/**
Alex Saloa060aee2019-01-21 14:36:41 -08004562 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
4563 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004564 * Logged from:
4565 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
4566 */
4567message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08004568 optional int64 dispatch_latency_millis = 1;
4569}
4570
4571/**
4572 * Logs AttentionManagerService attention check result.
4573 *
4574 * Logged from:
4575 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
4576 */
4577message AttentionManagerServiceResultReported {
4578 // See core/java/android/service/attention/AttentionService.java
4579 enum AttentionCheckResult {
4580 UNKNOWN = 20;
4581 ATTENTION_SUCCESS_ABSENT = 0;
4582 ATTENTION_SUCCESS_PRESENT = 1;
4583 ATTENTION_FAILURE_PREEMPTED = 2;
4584 ATTENTION_FAILURE_TIMED_OUT = 3;
4585 ATTENTION_FAILURE_UNKNOWN = 4;
4586 }
4587 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004588}
Michael Groover9e7b06e2018-12-28 19:55:51 -08004589
4590/**
4591 * Logs when an adb connection changes state.
4592 *
4593 * Logged from:
4594 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
4595 */
4596message AdbConnectionChanged {
4597 // The last time this system connected via adb, or 0 if the 'always allow' option was not
4598 // previously selected for this system.
4599 optional int64 last_connection_time_millis = 1;
4600
4601 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
4602 // to reconnect via adb without user interaction.
4603 optional int64 auth_window_millis = 2;
4604
4605 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
4606 optional android.debug.AdbConnectionStateEnum state = 3;
4607
4608 // True if the 'always allow' option was selected for this system.
4609 optional bool always_allow = 4;
4610}
Carter Hsub8fd1e92019-01-11 15:24:45 +08004611
4612/*
4613 * Logs the reported speech DSP status.
4614 *
4615 * Logged from:
4616 * Vendor audio implementation.
4617 */
4618message SpeechDspStatReported {
4619 // The total Speech DSP uptime in milliseconds.
4620 optional int32 total_uptime_millis = 1;
4621 // The total Speech DSP downtime in milliseconds.
4622 optional int32 total_downtime_millis = 2;
4623 optional int32 total_crash_count = 3;
4624 optional int32 total_recover_count = 4;
4625}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08004626
4627/**
4628 * Logs USB connector contaminant status.
4629 *
4630 * Logged from: USB Service.
4631 */
4632message UsbContaminantReported {
4633 optional string id = 1;
4634 optional android.service.usb.ContaminantPresenceStatus status = 2;
4635}
Olivier Gaillard18d452202019-01-22 15:03:41 +00004636
4637/**
4638 * This atom is for debugging purpose.
4639 */
4640message DebugElapsedClock {
4641 // Monotically increasing value for each pull.
4642 optional int64 pull_count = 1;
4643 // Time from System.elapsedRealtime.
4644 optional int64 elapsed_clock_millis = 2;
4645 // Time from System.elapsedRealtime.
4646 optional int64 same_elapsed_clock_millis = 3;
4647 // Diff between current elapsed time and elapsed time from previous pull.
4648 optional int64 elapsed_clock_diff_millis = 4;
4649
4650 enum Type {
4651 TYPE_UNKNOWN = 0;
4652 ALWAYS_PRESENT = 1;
4653 PRESENT_ON_ODD_PULLS = 2;
4654 }
4655 // Type of behavior for the pulled data.
4656 optional Type type = 5;
4657}
4658
4659/**
4660 * This atom is for debugging purpose.
4661 */
4662message DebugFailingElapsedClock {
4663 // Monotically increasing value for each pull.
4664 optional int64 pull_count = 1;
4665 // Time from System.elapsedRealtime.
4666 optional int64 elapsed_clock_millis = 2;
4667 // Time from System.elapsedRealtime.
4668 optional int64 same_elapsed_clock_millis = 3;
4669 // Diff between current elapsed time and elapsed time from previous pull.
4670 optional int64 elapsed_clock_diff_millis = 4;
4671}
Steven Wuacef6bb2019-01-23 14:21:17 -05004672
4673/** Logs System UI bubbles event changed.
4674 *
4675 * Logged from:
4676 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
4677 */
4678message BubbleUIChanged {
4679
4680 // The app package that is posting the bubble.
4681 optional string package_name = 1;
4682
4683 // The notification channel that is posting the bubble.
4684 optional string notification_channel = 2;
4685
4686 // The notification id associated with the posted bubble.
4687 optional int32 notification_id = 3;
4688
4689 // The position of the bubble within the bubble stack.
4690 optional int32 position = 4;
4691
4692 // The total number of bubbles within the bubble stack.
4693 optional int32 total_number = 5;
4694
4695 // User interactions with the bubble.
4696 enum Action {
4697 UNKNOWN = 0;
4698 POSTED = 1;
4699 UPDATED = 2;
4700 EXPANDED = 3;
4701 COLLAPSED = 4;
4702 DISMISSED = 5;
4703 STACK_DISMISSED = 6;
4704 STACK_MOVED = 7;
4705 HEADER_GO_TO_APP = 8;
4706 HEADER_GO_TO_SETTINGS = 9;
4707 PERMISSION_OPT_IN = 10;
4708 PERMISSION_OPT_OUT = 11;
4709 PERMISSION_IGNORED = 12;
4710 SWIPE_LEFT = 13;
4711 SWIPE_RIGHT = 14;
4712 }
4713 optional Action action = 6;
4714
4715 // Normalized screen position of the bubble stack. The range is between 0 and 1.
4716 optional float normalized_x_position = 7;
4717 optional float normalized_y_position = 8;
4718}
Kweku Adams8845d012018-12-11 20:06:45 -08004719
4720/**
4721 * Logs that a constraint for a scheduled job has changed.
4722 *
4723 * Logged from:
4724 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
4725 */
4726message ScheduledJobConstraintChanged {
4727 repeated AttributionNode attribution_node = 1;
4728
4729 // Name of the job.
4730 optional string job_name = 2;
4731
4732 optional com.android.server.job.ConstraintEnum constraint = 3;
4733
4734 enum State {
4735 UNSATISFIED = 0;
4736 SATISFIED = 1;
4737 }
4738 optional State state = 4;
4739}