blob: e84eced8bb1aff436cb6a13863ae20f19d149fb5 [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;
David Chenc8a43242017-10-17 16:23:28 -0700272 }
yroa1fe77c2018-02-26 14:22:54 -0800273
Bookatz76aafcf2018-09-17 16:17:10 -0700274 // DO NOT USE field numbers above 100,000 in AOSP.
275 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
276 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700277}
278
Yao Chend54f9dd2017-10-17 17:37:48 +0000279/**
Yangster-mac20877162017-12-22 17:19:39 -0800280 * This proto represents a node of an attribution chain.
281 * Note: All attribution chains are represented as a repeated field of type
282 * AttributionNode. It is understood that in such arrays, the order is that
283 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000284 */
Yangster-mac20877162017-12-22 17:19:39 -0800285message AttributionNode {
286 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800287 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800288
Yangster-mac20877162017-12-22 17:19:39 -0800289 // The (optional) string tag for an element in the attribution chain. If the
290 // element has no tag, it is encoded as an empty string.
291 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700292}
293
Yangster-mac48b3d622018-08-18 12:38:11 -0700294message KeyValuePair {
295 optional int32 key = 1;
296 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700297 int32 value_int = 2;
298 int64 value_long = 3;
299 string value_str = 4;
300 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700301 }
302}
303
304message KeyValuePairsAtom {
305 optional int32 uid = 1;
306 repeated KeyValuePair pairs = 2;
307}
308
Yao Chend54f9dd2017-10-17 17:37:48 +0000309/*
310 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800311 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000312 *
313 * RULES:
314 * - The field ids for each atom must start at 1, and count upwards by 1.
315 * Skipping field ids is not allowed.
316 * - These form an API, so renaming, renumbering or removing fields is
317 * not allowed between android releases. (This is not currently enforced,
318 * but there will be a tool to enforce this restriction).
319 * - The types must be built-in protocol buffer types, namely, no sub-messages
320 * are allowed (yet). The bytes type is also not allowed.
321 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800322 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000323 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800324 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000325 * - A field that is a uid should be a string field, tagged with the [xxx]
326 * annotation. The generated code on android will be represented by UIDs,
327 * and those UIDs will be translated in xxx to those strings.
328 *
329 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700330 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000331 * - If there is a UID, it goes first. Think in an object-oriented fashion.
332 * *****************************************************************************
333 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700334
Yao Chend54f9dd2017-10-17 17:37:48 +0000335/**
Yangster-mace16189a2018-08-26 12:20:16 -0700336 * Logs when the Thermal service HAL notifies the throttling start/stop events.
337 *
338 * Logged from:
339 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
340 */
341message ThermalThrottlingStateChanged {
342 optional android.os.TemperatureTypeEnum sensor_type = 1;
343
344 enum State {
345 UNKNOWN = 0;
346 START = 1;
347 STOP = 2;
348 }
349
350 optional State state = 2;
351
352 optional float temperature = 3;
353}
354
355/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000356 * Logs when the screen state changes.
357 *
358 * Logged from:
359 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
360 */
361message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800362 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700363 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700364}
Yao Chend54f9dd2017-10-17 17:37:48 +0000365
366/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700367 * Logs that the process state of the uid, as determined by ActivityManager
368 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000369 *
370 * Logged from:
371 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
372 */
Bookatzc1a050a2017-10-10 15:49:28 -0700373message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700374 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000375
Bookatzdb026a22018-01-10 19:01:56 -0800376 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700377 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000378}
379
380/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700381 * Logs process state change of a process, as per the activity manager.
382 *
383 * Logged from:
384 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
385 */
386message ProcessStateChanged {
387 optional int32 uid = 1;
388 optional string process_name = 2;
389 optional string package_name = 3;
390 // TODO: remove this when validation is done
391 optional int64 version = 5;
392 // The state, from frameworks/base/core/proto/android/app/enums.proto.
393 optional android.app.ProcessStateEnum state = 4;
394}
395
396/**
397 * Logs when ActivityManagerService sleep state is changed.
398 *
399 * Logged from:
400 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
401 */
402message ActivityManagerSleepStateChanged {
403 // TODO: import frameworks proto
404 enum State {
405 UNKNOWN = 0;
406 ASLEEP = 1;
407 AWAKE = 2;
408 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700409 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700410}
411
412/**
413 * Logs when system memory state changes.
414 *
415 * Logged from:
416 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
417 */
418message MemoryFactorStateChanged {
419 // TODO: import frameworks proto
420 enum State {
421 MEMORY_UNKNOWN = 0;
422 NORMAL = 1; // normal.
423 MODERATE = 2; // moderate memory pressure.
424 LOW = 3; // low memory.
425 CRITICAL = 4; // critical memory.
426
427 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700428 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700429}
430
431/**
432 * Logs when app is using too much cpu, according to ActivityManagerService.
433 *
434 * Logged from:
435 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
436 */
437message ExcessiveCpuUsageReported {
438 optional int32 uid = 1;
439 optional string process_name = 2;
440 optional string package_name = 3;
441 // package version. TODO: remove this when validation is done
442 optional int64 version = 4;
443}
444
445/**
446 * Logs when a cached process is killed, along with its pss.
447 *
448 * Logged from:
449 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
450 */
451message CachedKillReported {
452 optional int32 uid = 1;
453 optional string process_name = 2;
454 optional string package_name = 3;
455 // TODO: remove this when validation is done
456 optional int64 version = 5;
457 optional int64 pss = 4;
458}
459
460/**
461 * Logs when memory stats of a process is reported.
462 *
463 * Logged from:
464 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
465 */
466message ProcessMemoryStatReported {
467 optional int32 uid = 1;
468 optional string process_name = 2;
469 optional string package_name = 3;
470 //TODO: remove this when validation is done
471 optional int64 version = 9;
472 optional int64 pss = 4;
473 optional int64 uss = 5;
474 optional int64 rss = 6;
475 enum Type {
476 ADD_PSS_INTERNAL_SINGLE = 0;
477 ADD_PSS_INTERNAL_ALL_MEM = 1;
478 ADD_PSS_INTERNAL_ALL_POLL = 2;
479 ADD_PSS_EXTERNAL = 3;
480 ADD_PSS_EXTERNAL_SLOW = 4;
481 }
482 optional Type type = 7;
483 optional int64 duration = 8;
484}
485
486/**
Bookatzc1a050a2017-10-10 15:49:28 -0700487 * Logs that a process started, finished, crashed, or ANRed.
488 *
489 * Logged from:
490 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
491 */
492message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700493 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700494
David Chen0b5c90c2018-01-25 16:51:49 -0800495 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800496 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700497
Bookatzddccf0a2017-11-28 16:48:14 -0800498 // What lifecycle state the process changed to.
499 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800500 enum State {
501 FINISHED = 0;
502 STARTED = 1;
503 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800504 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800505 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700506}
507
Bookatzc1a050a2017-10-10 15:49:28 -0700508/**
509 * Logs when the ble scan state changes.
510 *
511 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700512 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700513 */
514message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800515 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700516
517 enum State {
518 OFF = 0;
519 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700520 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
521 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700522 }
523 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700524
Bookatze5ec0b42018-03-26 13:34:56 -0700525 // Does the scan have a filter.
526 optional bool is_filtered = 3;
527 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
528 optional bool is_first_match = 4;
529 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
530 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700531}
532
533/**
534 * Logs reporting of a ble scan finding results.
535 *
536 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700537 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700538 */
Bookatzae6738e2018-09-13 11:38:56 -0700539// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700540message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800541 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700542
543 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800544 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700545}
546
547/**
548 * Logs when a sensor state changes.
549 *
550 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700551 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700552 */
553message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800554 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700555
Bookatzc1a050a2017-10-10 15:49:28 -0700556 // The id (int) of the sensor.
557 optional int32 sensor_id = 2;
558
559 enum State {
560 OFF = 0;
561 ON = 1;
562 }
563 optional State state = 3;
564}
565
Bookatzc1a050a2017-10-10 15:49:28 -0700566/**
567 * Logs when GPS state changes.
568 *
569 * Logged from:
570 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
571 */
572message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800573 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700574
575 enum State {
576 OFF = 0;
577 ON = 1;
578 }
579 optional State state = 2;
580}
581
Bookatz48d362e2018-11-06 15:49:08 -0800582/**
583 * Logs when GPS signal quality.
584 *
585 * Logged from:
586 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
587 */
588message GpsSignalQualityChanged {
589 optional android.server.location.GpsSignalQualityEnum level = 1;
590}
591
Bookatzc1a050a2017-10-10 15:49:28 -0700592
593/**
594 * Logs when a sync manager sync state changes.
595 *
596 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700597 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700598 */
599message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800600 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700601
David Chen0b5c90c2018-01-25 16:51:49 -0800602 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800603 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700604
605 enum State {
606 OFF = 0;
607 ON = 1;
608 }
609 optional State state = 3;
610}
611
Yangster-mac96353002018-09-05 11:18:55 -0700612/*
613 * Deferred job stats.
614 *
615 * Logged from:
616 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
617*/
618message DeferredJobStatsReported {
619 repeated AttributionNode attribution_node = 1;
620
621 // Number of jobs deferred.
622 optional int32 num_jobs_deferred = 2;
623
624 // Time since the last job runs.
625 optional int64 time_since_last_job_millis = 3;
626}
627
Bookatzc1a050a2017-10-10 15:49:28 -0700628/**
629 * Logs when a job scheduler job state changes.
630 *
631 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700632 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700633 */
634message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800635 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700636
637 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800638 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700639
640 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800641 FINISHED = 0;
642 STARTED = 1;
643 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700644 }
645 optional State state = 3;
646
Tej Singh33a412b2018-03-16 18:43:59 -0700647 // The reason a job has stopped.
648 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700649 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700650 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700651}
652
653/**
654 * Logs when the audio state changes.
655 *
656 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700657 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700658 */
659message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800660 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700661
662 enum State {
663 OFF = 0;
664 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700665 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
666 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700667 }
668 optional State state = 2;
669}
670
671/**
672 * Logs when the video codec state changes.
673 *
674 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700675 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700676 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800677message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800678 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700679
680 enum State {
681 OFF = 0;
682 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700683 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
684 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700685 }
686 optional State state = 2;
687}
688
689/**
690 * Logs when the flashlight state changes.
691 *
692 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700693 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700694 */
695message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800696 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700697
698 enum State {
699 OFF = 0;
700 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700701 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
702 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700703 }
704 optional State state = 2;
705}
706
707/**
708 * Logs when the camera state changes.
709 *
710 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700711 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700712 */
713message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800714 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700715
716 enum State {
717 OFF = 0;
718 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700719 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
720 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700721 }
722 optional State state = 2;
723}
724
725/**
726 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000727 *
728 * Logged from:
729 * TODO
730 */
Bookatzd6746242017-10-24 18:39:35 -0700731message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800732 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000733
Bookatz1a1b0462018-01-12 11:47:03 -0800734 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
735 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700736 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700737
738 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
739 optional string tag = 3;
740
741 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800742 RELEASE = 0;
743 ACQUIRE = 1;
744 CHANGE_RELEASE = 2;
745 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700746 }
747 optional State state = 4;
748}
749
750/**
Bookatzc1a050a2017-10-10 15:49:28 -0700751 * Logs when a partial wakelock is considered 'long' (over 1 min).
752 *
753 * Logged from:
754 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
755 */
756message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800757 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700758
Yao Chend54f9dd2017-10-17 17:37:48 +0000759 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
760 optional string tag = 2;
761
Bookatzc1a050a2017-10-10 15:49:28 -0700762 // TODO: I have no idea what this is.
763 optional string history_tag = 3;
764
765 enum State {
766 OFF = 0;
767 ON = 1;
768 }
769 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000770}
771
Bookatzc1a050a2017-10-10 15:49:28 -0700772/**
Bookatza66083f2018-09-20 17:24:00 -0700773 * Logs when the device is interactive, according to the PowerManager Notifier.
774 *
775 * Logged from:
776 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
777 */
778message InteractiveStateChanged {
779 enum State {
780 OFF = 0;
781 ON = 1;
782 }
783 optional State state = 1;
784}
785
786/**
Bookatzc1a050a2017-10-10 15:49:28 -0700787 * Logs Battery Saver state change.
788 *
789 * Logged from:
790 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
791 */
792message BatterySaverModeStateChanged {
793 enum State {
794 OFF = 0;
795 ON = 1;
796 }
797 optional State state = 1;
798}
799
800/**
801 * Logs Doze mode state change.
802 *
803 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800804 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700805 */
806message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800807 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800808}
809
810
811/**
812 * Logs state change of Doze mode including maintenance windows.
813 *
814 * Logged from:
815 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
816 */
817message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800818 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700819}
820
821/**
822 * Logs screen brightness level.
823 *
824 * Logged from:
825 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
826 */
827message ScreenBrightnessChanged {
828 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
829 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700830}
831
832/**
833 * Logs battery level (percent full, from 0 to 100).
834 *
835 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700836 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700837 */
838message BatteryLevelChanged {
839 // Battery level. Should be in [0, 100].
840 optional int32 battery_level = 1;
841}
842
843/**
844 * Logs change in charging status of the device.
845 *
846 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700847 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700848 */
849message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800850 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
851 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700852}
853
854/**
855 * Logs whether the device is plugged in, and what power source it is using.
856 *
857 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700858 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700859 */
860message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800861 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
862 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700863}
864
Bookatz8c6571b2017-10-24 15:04:41 -0700865/**
866 * Logs when an app's wakeup alarm fires.
867 *
868 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700869 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700870 */
871message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800872 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800873
874 // Name of the wakeup alarm.
875 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700876
877 // Name of source package (for historical reasons, since BatteryStats tracked it).
878 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800879}
880
881/**
882 * Logs when an an app causes the mobile radio to change state.
883 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
884 *
885 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700886 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800887 */
888message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800889 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800890
Bookatz1a1b0462018-01-12 11:47:03 -0800891 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
892 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800893}
894
895/**
896 * Logs when an an app causes the wifi radio to change state.
897 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
898 *
899 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700900 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800901 */
902message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800903 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800904
Bookatz1a1b0462018-01-12 11:47:03 -0800905 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
906 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700907}
908
909/**
910 * Logs kernel wakeup reasons and aborts.
911 *
912 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700913 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700914 */
915message KernelWakeupReported {
916 // Name of the kernel wakeup reason (or abort).
917 optional string wakeup_reason_name = 1;
918
919 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800920 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700921}
922
923/**
Bookatzda1798c2018-12-13 14:16:00 -0800924 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800925 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800926 *
927 * Logged from:
928 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
929 */
930message WifiEnabledStateChanged {
931 enum State {
932 OFF = 0;
933 ON = 1;
934 }
935 optional State state = 1;
936}
937
938/**
939 * 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 -0800940 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
941 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800942 *
943 * Logged from:
944 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
945 */
946message WifiRunningStateChanged {
947 repeated AttributionNode attribution_node = 1;
948
949 enum State {
950 OFF = 0;
951 ON = 1;
952 }
953 optional State state = 2;
954}
955
956/**
Bookatze5885242017-10-24 20:10:31 -0700957 * Logs wifi locks held by an app.
958 *
959 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700960 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700961 */
962message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800963 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700964
965 enum State {
966 OFF = 0;
967 ON = 1;
968 }
969 optional State state = 2;
970}
971
972/**
973 * Logs wifi signal strength changes.
974 *
975 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800976 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700977 */
978message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800979 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
980 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700981}
982
983/**
984 * Logs wifi scans performed by an app.
985 *
986 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800987 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700988 */
989message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800990 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700991
992 enum State {
993 OFF = 0;
994 ON = 1;
995 }
996 optional State state = 2;
997}
998
999/**
Tej Singh4503e102018-01-04 14:35:01 -08001000 * Logs wifi multicast locks held by an app
1001 *
1002 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001003 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001004 */
1005message WifiMulticastLockStateChanged {
1006 repeated AttributionNode attribution_node = 1;
1007
1008 enum State {
1009 OFF = 0;
1010 ON = 1;
1011 }
1012 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001013
1014 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001015}
1016
1017/**
Tej Singh1ea42892018-01-19 09:27:00 -08001018 * Logs shutdown reason and duration on next boot.
1019 *
1020 * Logged from:
1021 * frameworks/base/core/java/com/android/server/BootReceiver.java
1022 */
1023message ShutdownSequenceReported {
1024 // True if shutdown is for a reboot. Default: false if we do not know.
1025 optional bool reboot = 1;
1026
1027 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1028 optional string reason = 2;
1029
1030 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1031 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001032 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001033
1034 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001035 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001036}
1037
Tej Singh6483ea42018-01-25 17:45:49 -08001038
1039/**
1040 * Logs boot reason and duration.
1041 *
1042 * Logged from:
1043 * system/core/bootstat/bootstat.cpp
1044 */
1045message BootSequenceReported {
1046 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1047 // Default: "<EMPTY>" if not available.
1048 optional string bootloader_reason = 1;
1049
1050 // Reason for system boot. Eg. bootloader, reboot,userrequested
1051 // Default: "<EMPTY>" if not available.
1052 optional string system_reason = 2;
1053
1054 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001055 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001056
1057 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001058 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001059
1060 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001061 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001062
1063 // Time since last boot in ms. Default: 0 if not available.
1064 optional int64 time_since_last_boot = 6;
1065}
1066
Tej Singhc477d9c2018-02-05 18:31:39 -08001067
1068/**
1069 * Logs call state and disconnect cause (if applicable).
1070 *
1071 * Logged from:
1072 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1073 */
1074message CallStateChanged {
1075 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1076 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1077 optional android.telecom.CallStateEnum call_state = 1;
1078
1079 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1080 // This value is only applicable when the call_state is DISCONNECTED, and
1081 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1082 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1083 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1084
1085 // True if the call is self-managed, which are apps that use the
1086 // telecom infrastructure to make their own calls.
1087 optional bool self_managed = 3;
1088
1089 // True if call is external. External calls are calls on connected Wear
1090 // devices but show up in Telecom so the user can pull them onto the device.
1091 optional bool external_call = 4;
1092}
1093
Tej Singh1ea42892018-01-19 09:27:00 -08001094/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001095 * Logs keyguard state. The keyguard is the lock screen.
1096 *
1097 * Logged from:
1098 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1099 */
1100message KeyguardStateChanged {
1101 enum State {
1102 UNKNOWN = 0;
1103 // The keyguard is hidden when the phone is unlocked.
1104 HIDDEN = 1;
1105 // The keyguard is shown when the phone is locked (screen turns off).
1106 SHOWN= 2;
1107 // The keyguard is occluded when something is overlaying the keyguard.
1108 // Eg. Opening the camera while on the lock screen.
1109 OCCLUDED = 3;
1110 }
1111 optional State state = 1;
1112}
1113
1114/**
1115 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1116 * prompts the user to enter a password (pattern, pin, etc).
1117 *
1118 * Logged from:
1119 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1120 */
1121
1122message KeyguardBouncerStateChanged {
1123 enum State {
1124 UNKNOWN = 0;
1125 // Bouncer is hidden, either as a result of successfully entering the
1126 // password, screen timing out, or user going back to lock screen.
1127 HIDDEN = 1;
1128 // This is when the user is being prompted to enter the password.
1129 SHOWN = 2;
1130 }
1131 optional State state = 1;
1132}
1133
1134/**
1135 * Logs the result of entering a password into the keyguard bouncer.
1136 *
1137 * Logged from:
1138 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1139 */
1140message KeyguardBouncerPasswordEntered {
1141 enum BouncerResult {
1142 UNKNOWN = 0;
1143 // The password entered was incorrect.
1144 FAILURE = 1;
1145 // The password entered was correct.
1146 SUCCESS = 2;
1147 }
1148 optional BouncerResult result = 1;
1149}
1150
Tej Singha883b372018-02-15 11:30:01 -08001151/*
1152 * Logs changes to the configuration of the device. The configuration is defined
1153 * in frameworks/base/core/java/android/content/res/Configuration.java
1154 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1155 * Please go there to interpret the possible values each field can be.
1156 *
1157 * Logged from:
1158 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1159 */
1160message ResourceConfigurationChanged {
1161 // Bit mask of color capabilities of the screen.
1162 // Contains information about the color gamut and hdr mode of the screen.
1163 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001164 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001165
1166 // The target screen density being rendered to.
1167 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001168 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001169
1170 // Current user preference for the scaling factor for fonts,
1171 // relative to the base density scaling.
1172 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001173 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001174
1175 // Flag indicating whether the hard keyboard is hidden.
1176 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001177 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001178
1179 // The type of keyboard attached to the device.
1180 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1181 optional int32 keyboard = 5;
1182
1183 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1184 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001185 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001186
1187 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1188 // 0 if undefined.
1189 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1190 optional int32 mcc = 7;
1191
1192 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1193 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1194 // MNC_ZERO symbol defined in Configuration.java.
1195 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1196 optional int32 mnc = 8;
1197
1198 // The kind of navigation available on the device.
1199 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1200 optional int32 navigation = 9;
1201
1202 // Flag indicating whether the navigation is available.
1203 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001204 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001205
1206 // Overall orientation of the screen.
1207 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1208 optional int32 orientation = 11;
1209
1210 // The current height of the available screen space, in dp units.
1211 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001212 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001213
1214 // Bit mask of overall layout of the screen.
1215 // Contains information about screen size, whether the screen is wider/taller
1216 // than normal, whether the screen layout is right-tl-left or left-to-right,
1217 // and whether the screen has a rounded shape.
1218 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001219 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001220
1221 // Current width of the available screen space, in dp units.
1222 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001223 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001224
1225 // The smallest screen size an application will see in normal operation.
1226 // This is the smallest value of both screenWidthDp and screenHeightDp
1227 // in portrait and landscape.
1228 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001229 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001230
1231 // The type of touch screen attached to the device.
1232 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1233 optional int32 touchscreen = 16;
1234
1235 // Bit mask of the ui mode.
1236 // Contains information about the overall ui mode of the device.
1237 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1238 // Also contains information about whether the device is in night mode.
1239 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001240 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001241}
1242
Tej Singheee317b2018-03-07 19:28:05 -08001243
1244/**
1245 * Logs changes in the connection state of the mobile radio.
1246 *
1247 * Logged from:
1248 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1249 */
1250message MobileConnectionStateChanged {
1251 // States are from the state machine DataConnection.java.
1252 enum State {
1253 UNKNOWN = 0;
1254 // The connection is inactive, or disconnected.
1255 INACTIVE = 1;
1256 // The connection is being activated, or connecting.
1257 ACTIVATING = 2;
1258 // The connection is active, or connected.
1259 ACTIVE = 3;
1260 // The connection is disconnecting.
1261 DISCONNECTING = 4;
1262 // The connection is disconnecting after creating a connection.
1263 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1264 }
1265 optional State state = 1;
1266 // For multi-sim phones, this distinguishes between the sim cards.
1267 optional int32 sim_slot_index = 2;
1268 // Used to identify the connection. Starts at 0 and increments by 1 for
1269 // every new network created. Resets whenever the device reboots.
1270 optional int32 data_connection_id = 3;
1271 // A bitmask for the capabilities of this connection.
1272 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1273 // Default value (if we have no information): 0
1274 optional int64 capabilities = 4;
1275 // If this connection has internet.
1276 // This just checks if the DEFAULT bit of capabilities is set.
1277 optional bool has_internet = 5;
1278}
1279
1280/**
1281 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1282 *
1283 * Logged from:
1284 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1285 */
1286message MobileRadioTechnologyChanged {
1287 optional android.telephony.NetworkTypeEnum state = 1;
1288 // For multi-sim phones, this distinguishes between the sim cards.
1289 optional int32 sim_slot_index = 2;
1290}
1291
Andrew Chantb56388b2018-03-22 21:07:33 -07001292/**
1293 * Logs the VID and PID of any connected USB devices.
1294 *
1295 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1296 *
1297 * Logged by Vendor.
1298 */
1299message UsbDeviceAttached {
1300 optional int32 vid = 1;
1301 optional int32 pid = 2;
1302 optional bool has_audio = 3;
1303 optional bool has_hid = 4;
1304 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001305 enum State {
1306 STATE_DISCONNECTED = 0;
1307 STATE_CONNECTED = 1;
1308 }
1309 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001310 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001311}
1312
Tej Singheee317b2018-03-07 19:28:05 -08001313
Tej Singhdd7bd352018-02-09 19:33:15 -08001314/**
Tej Singh5d991e12018-03-09 19:48:11 -08001315 * Logs when Bluetooth is enabled and disabled.
1316 *
1317 * Logged from:
1318 * services/core/java/com/android/server/BluetoothManagerService.java
1319 */
1320message BluetoothEnabledStateChanged {
1321 repeated AttributionNode attribution_node = 1;
1322 // Whether or not bluetooth is enabled on the device.
1323 enum State {
1324 UNKNOWN = 0;
1325 ENABLED = 1;
1326 DISABLED = 2;
1327 }
1328 optional State state = 2;
1329 // The reason for being enabled/disabled.
1330 // Eg. Airplane mode, crash, application request.
1331 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1332 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001333 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001334}
1335
1336/**
Jack Hed9837c82019-01-09 01:19:13 -08001337 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001338 *
1339 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001340 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1341 *
1342 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001343 */
1344message BluetoothConnectionStateChanged {
1345 // The state of the connection.
1346 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1347 optional android.bluetooth.ConnectionStateEnum state = 1;
1348 // An identifier that can be used to match connect and disconnect events.
1349 // Currently is last two bytes of a hash of a device level ID and
1350 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001351 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1352 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001353 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1354 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001355 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001356 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001357 // An identifier that can be used to match events for this device.
1358 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1359 // Salt: Randomly generated 256 bit value
1360 // Hash algorithm: HMAC-SHA256
1361 // Size: 32 byte
1362 // Default: null or empty if the device identifier is not known
1363 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1364}
1365
1366/**
1367 * Logs when a Bluetooth device connects and disconnects over ACL
1368 *
1369 * Logged from:
1370 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1371 *
1372 * Next Tag: 3
1373 */
1374message BluetoothAclConnectionStateChanged {
1375 // An identifier that can be used to match events for this device.
1376 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1377 // Salt: Randomly generated 256 bit value
1378 // Hash algorithm: HMAC-SHA256
1379 // Size: 32 byte
1380 // Default: null or empty if the device identifier is not known
1381 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1382 // The state of the connection.
1383 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1384 optional android.bluetooth.ConnectionStateEnum state = 2;
1385}
1386
1387/**
1388 * Logs when a Bluetooth device connects and disconnects over SCO
1389 *
1390 * Logged from:
1391 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1392 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1393 *
1394 * Next Tag: 4
1395 */
1396message BluetoothScoConnectionStateChanged {
1397 // An identifier that can be used to match events for this device.
1398 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1399 // Salt: Randomly generated 256 bit value
1400 // Hash algorithm: HMAC-SHA256
1401 // Size: 32 byte
1402 // Default: null or empty if the device identifier is not known
1403 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1404 // The state of the connection.
1405 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1406 optional android.bluetooth.ConnectionStateEnum state = 2;
1407 // Codec used for this SCO connection
1408 // Default: UNKNOWN
1409 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001410}
1411
Jack Heab86dbd22018-12-18 15:43:27 -08001412// Logs when there is an event affecting Bluetooth device's link layer connection.
1413// - This event is triggered when there is a related HCI command or event
1414// - Users of this metrics can deduce Bluetooth device's connection state from these events
1415// - HCI commands are logged before the command is sent, after receiving command status, and after
1416// receiving command complete
1417// - HCI events are logged when they arrive
1418//
1419// Low level log from system/bt
1420//
1421// Bluetooth classic commands:
1422// - CMD_CREATE_CONNECTION
1423// - CMD_DISCONNECT
1424// - CMD_CREATE_CONNECTION_CANCEL
1425// - CMD_ACCEPT_CONNECTION_REQUEST
1426// - CMD_REJECT_CONNECTION_REQUEST
1427// - CMD_SETUP_ESCO_CONNECTION
1428// - CMD_ACCEPT_ESCO_CONNECTION
1429// - CMD_REJECT_ESCO_CONNECTION
1430// - CMD_ENH_SETUP_ESCO_CONNECTION
1431// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1432//
1433// Bluetooth low energy commands:
1434// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1435// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1436// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1437// - CMD_BLE_CLEAR_WHITE_LIST
1438// - CMD_BLE_ADD_WHITE_LIST
1439// - CMD_BLE_REMOVE_WHITE_LIST
1440//
1441// Bluetooth classic events:
1442// - EVT_CONNECTION_COMP
1443// - EVT_CONNECTION_REQUEST
1444// - EVT_DISCONNECTION_COMP
1445// - EVT_ESCO_CONNECTION_COMP
1446// - EVT_ESCO_CONNECTION_CHANGED
1447//
1448// Bluetooth low energy meta events:
1449// - BLE_EVT_CONN_COMPLETE_EVT
1450// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1451//
1452// Next tag: 10
1453message BluetoothLinkLayerConnectionEvent {
1454 // An identifier that can be used to match events for this device.
1455 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1456 // Salt: Randomly generated 256 bit value
1457 // Hash algorithm: HMAC-SHA256
1458 // Size: 32 byte
1459 // Default: null or empty if the device identifier is not known
1460 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1461 // Connection handle of this connection if available
1462 // Range: 0x0000 - 0x0EFF (12 bits)
1463 // Default: 0xFFFF if the handle is unknown
1464 optional int32 connection_handle = 2;
1465 // Direction of the link
1466 // Default: DIRECTION_UNKNOWN
1467 optional android.bluetooth.DirectionEnum direction = 3;
1468 // Type of this link
1469 // Default: LINK_TYPE_UNKNOWN
1470 optional android.bluetooth.LinkTypeEnum type = 4;
1471
1472 // Reason metadata for this link layer connection event, rules for interpretation:
1473 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1474 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1475 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1476 // set and valid, ignore hci_ble_event
1477
1478 // HCI command associated with this event
1479 // Default: CMD_UNKNOWN
1480 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1481 // HCI event associated with this event
1482 // Default: EVT_UNKNOWN
1483 optional android.bluetooth.hci.EventEnum hci_event = 6;
1484 // HCI BLE meta event associated with this event
1485 // Default: BLE_EVT_UNKNOWN
1486 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1487 // HCI command status code if this is triggerred by hci_cmd
1488 // Default: STATUS_UNKNOWN
1489 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1490 // HCI reason code associated with this event
1491 // Default: STATUS_UNKNOWN
1492 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1493}
1494
Howard Roe103fe22019-01-17 16:52:16 -08001495/**
1496 * Logs when a module is rolled back by Watchdog.
1497 *
1498 * Logged from: Rollback Manager
1499 */
1500message WatchdogRollbackOccurred {
1501 enum RollbackType {
1502 UNKNOWN = 0;
1503 ROLLBACK_INITIATE = 1;
1504 ROLLBACK_SUCCESS = 2;
1505 ROLLBACK_FAILURE = 3;
1506 }
1507 optional RollbackType rollback_type = 1;
1508
1509 optional string package_name = 2;
1510
1511 optional int32 package_version_code = 3;
1512}
1513
Jack Heab86dbd22018-12-18 15:43:27 -08001514
Tej Singh5d991e12018-03-09 19:48:11 -08001515/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001516 * Logs when something is plugged into or removed from the USB-C connector.
1517 *
1518 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001519 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001520 */
1521message UsbConnectorStateChanged {
1522 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001523 STATE_DISCONNECTED = 0;
1524 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001525 }
1526 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001527 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001528 // Last active session in ms.
1529 // 0 when the port is in connected state.
1530 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001531}
1532
1533/**
1534 * Logs the reported speaker impedance.
1535 *
1536 * Logged from:
1537 * Vendor audio implementation.
1538 */
1539message SpeakerImpedanceReported {
1540 optional int32 speaker_location = 1;
1541 optional int32 impedance = 2;
1542}
1543
1544/**
1545 * Logs the report of a failed hardware.
1546 *
1547 * Logged from:
1548 * Vendor HALs.
1549 *
1550 */
1551message HardwareFailed {
1552 enum HardwareType {
1553 HARDWARE_FAILED_UNKNOWN = 0;
1554 HARDWARE_FAILED_MICROPHONE = 1;
1555 HARDWARE_FAILED_CODEC = 2;
1556 HARDWARE_FAILED_SPEAKER = 3;
1557 HARDWARE_FAILED_FINGERPRINT = 4;
1558 }
1559 optional HardwareType hardware_type = 1;
1560
1561 /* hardware_location allows vendors to differentiate between multiple instances of
1562 * the same hardware_type. The specific locations are vendor defined integers,
1563 * referring to board-specific numbering schemes.
1564 */
1565 optional int32 hardware_location = 2;
1566
1567 /* failure_code is specific to the HardwareType of the failed hardware.
1568 * It should use the enum values defined below.
1569 */
1570 enum MicrophoneFailureCode {
1571 MICROPHONE_FAILURE_COMPLETE = 0;
1572 }
1573 enum CodecFailureCode {
1574 CODEC_FAILURE_COMPLETE = 0;
1575 }
1576 enum SpeakerFailureCode {
1577 SPEAKER_FAILURE_COMPLETE = 0;
1578 SPEAKER_FAILURE_HIGH_Z = 1;
1579 SPEAKER_FAILURE_SHORT = 2;
1580 }
1581 enum FingerprintFailureCode {
1582 FINGERPRINT_FAILURE_COMPLETE = 0;
1583 FINGERPRINT_SENSOR_BROKEN = 1;
1584 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1585 }
1586 optional int32 failure_code = 3;
1587}
1588
1589/**
1590 * Log an event when the device has been physically dropped.
1591 * Reported from the /vendor partition.
1592 */
1593message PhysicalDropDetected {
1594 // Confidence that the event was actually a drop, 0 -> 100
1595 optional int32 confidence_pctg = 1;
1596 // Peak acceleration of the drop, in 1/1000s of a g.
1597 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001598 // Duration of freefall in ms
1599 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001600}
1601
1602/**
1603 * Log bucketed battery charge cycles.
1604 *
1605 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001606 * a given charge point. For example, if 10 cycle buckets are
1607 * initialized, bucket 1 is the lowest 1/10th of the battery,
1608 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001609 *
1610 * Logged from:
1611 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1612 */
1613message ChargeCyclesReported {
1614 optional int32 cycle_bucket_1 = 1;
1615 optional int32 cycle_bucket_2 = 2;
1616 optional int32 cycle_bucket_3 = 3;
1617 optional int32 cycle_bucket_4 = 4;
1618 optional int32 cycle_bucket_5 = 5;
1619 optional int32 cycle_bucket_6 = 6;
1620 optional int32 cycle_bucket_7 = 7;
1621 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001622 optional int32 cycle_bucket_9 = 9;
1623 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001624}
1625
1626/**
Howard Roa46b6582018-09-18 16:45:02 -07001627 * Log battery health snapshot.
1628 *
1629 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1630 * are snapshotted periodically over 24hrs.
1631 */
1632message BatteryHealthSnapshot {
1633 enum BatterySnapshotType {
1634 UNKNOWN = 0;
1635 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1636 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1637 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1638 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1639 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1640 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1641 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1642 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1643 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1644 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1645 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1646 }
1647 optional BatterySnapshotType type = 1;
1648 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001649 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001650 // Voltage Battery Voltage, in microVolts.
1651 optional int32 voltage_micro_volt = 3;
1652 // Current Battery current, in microAmps.
1653 optional int32 current_micro_amps = 4;
1654 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1655 optional int32 open_circuit_micro_volt = 5;
1656 // Resistance Battery Resistance, in microOhms.
1657 optional int32 resistance_micro_ohm = 6;
1658 // Level Battery Level, as % of full.
1659 optional int32 level_percent = 7;
1660}
1661
1662/**
1663 * Log slow I/O operations on the primary storage.
1664 */
1665message SlowIo {
1666 // Classifications of IO Operations.
1667 enum IoOperation {
1668 UNKNOWN = 0;
1669 READ = 1;
1670 WRITE = 2;
1671 UNMAP = 3;
1672 SYNC = 4;
1673 }
1674 optional IoOperation operation = 1;
1675
1676 // The number of slow IO operations of this type over 24 hours.
1677 optional int32 count = 2;
1678}
1679
1680/**
1681 * Log battery caused shutdown with the last recorded voltage.
1682 */
1683message BatteryCausedShutdown {
1684 // The last recorded battery voltage prior to shutdown.
1685 optional int32 last_recorded_micro_volt = 1;
1686}
1687
1688/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001689 * Logs the duration of a davey (jank of >=700ms) when it occurs
1690 *
1691 * Logged from:
1692 * frameworks/base/libs/hwui/JankTracker.cpp
1693 */
1694message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001695 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001696 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001697
Tej Singhbb8554a2018-01-26 11:59:14 -08001698 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001699 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001700}
1701
1702/**
Bookatze5885242017-10-24 20:10:31 -07001703 * Logs phone signal strength changes.
1704 *
1705 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001706 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001707 */
1708message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001709 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1710 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001711}
1712
Yangster4ccebea2018-10-09 17:09:02 -07001713
1714/**
1715 * Logs when the phone state, sim state or signal strength changes
1716 *
1717 * Logged from:
1718 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1719 */
1720message PhoneServiceStateChanged {
1721 optional android.telephony.ServiceStateEnum state = 1;
1722 optional android.telephony.SimStateEnum sim_state = 2;
1723 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1724}
1725
1726/**
1727 * Logs when the phone becomes on or off.
1728 *
1729 * Logged from:
1730 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1731 */
1732message PhoneStateChanged {
1733 enum State {
1734 OFF = 0;
1735 ON = 1;
1736 }
1737 optional State state = 1;
1738}
1739
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001740message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001741 optional android.stats.launcher.LauncherAction action = 1;
1742 optional android.stats.launcher.LauncherState src_state = 2;
1743 optional android.stats.launcher.LauncherState dst_state = 3;
1744 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001745 optional bool is_swipe_up_enabled = 5;
1746}
1747
David Chenc28b2bb2017-10-24 12:52:52 -07001748/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001749 * Logs when Settings UI has changed.
1750 *
1751 * Logged from:
1752 * packages/apps/Settings
1753 */
1754message SettingsUIChanged {
1755 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001756 * Where this SettingsUIChange event comes from. For example, if
1757 * it's a PAGE_VISIBLE event, where the page is opened from.
1758 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001759 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001760
1761 /**
1762 * What the UI action is.
1763 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001764 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001765
1766 /**
1767 * Where the action is happening
1768 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001769 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001770
1771 /**
1772 * What preference changed in this event.
1773 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001774 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001775
1776 /**
1777 * The new value of the changed preference.
1778 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001779 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001780}
1781
1782/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08001783 * Logs basic timing information about touch events.
1784 * Reported at most every 5 minutes while device is being interacted with.
1785 *
1786 * Logged from:
1787 * frameworks/native/services/inputflinger
1788 */
1789message TouchEventReported {
1790 /**
1791 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
1792 * and the standard deviation of latency between the kernel and framework
1793 * for touchscreen events. The units are microseconds.
1794 *
1795 * The number is measured as the difference between the time at which
1796 * the input event was received in the evdev driver,
1797 * and the time at which the input event was received in EventHub.
1798 */
1799 // Minimum value
1800 optional float latency_min_micros = 1;
1801 // Maximum value
1802 optional float latency_max_micros = 2;
1803 // Average value
1804 optional float latency_mean_micros = 3;
1805 // Standard deviation
1806 optional float latency_stdev_micros = 4;
1807}
1808
1809/**
David Chenc28b2bb2017-10-24 12:52:52 -07001810 * Logs that a setting was updated.
1811 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001812 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001813 * The tag and is_default allow resetting of settings to default values based on the specified
1814 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1815 */
1816message SettingChanged {
1817 // The name of the setting.
1818 optional string setting = 1;
1819
1820 // The change being imposed on this setting. May represent a number, eg "3".
1821 optional string value = 2;
1822
1823 // The new value of this setting. For most settings, this is same as value. For some settings,
1824 // value is +X or -X where X represents an element in a set. For example, if the previous value
1825 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1826 // The +/- feature is currently only used for location_providers_allowed.
1827 optional string new_value = 3;
1828
1829 // The previous value of this setting.
1830 optional string prev_value = 4;
1831
1832 // The tag used with the is_default for resetting sets of settings. This is generally null.
1833 optional string tag = 5;
1834
Bookatz90867622018-01-31 15:05:57 -08001835 // True if this setting with tag should be resettable.
1836 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001837
David Chenbd789912018-03-16 17:19:55 -07001838 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001839 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001840
1841 enum ChangeReason {
1842 UPDATED = 1; // Updated can be an insertion or an update.
1843 DELETED = 2;
1844 }
1845 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001846}
Chenjie Yub3dda412017-10-24 13:41:59 -07001847
Chenjie Yu05013b32017-11-21 10:21:41 -08001848/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001849 * Logs activity going to foreground or background
1850 *
1851 * Logged from:
1852 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1853 */
1854message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001855 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001856 optional string pkg_name = 2;
1857 optional string class_name = 3;
1858
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001859 enum State {
1860 BACKGROUND = 0;
1861 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001862 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001863 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001864}
David Chenc8a43242017-10-17 16:23:28 -07001865
1866/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00001867 * Logs when a volume entered low Storage state.
1868 * Logged from:
1869 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
1870 */
1871message LowStorageStateChanged {
1872 // Volume that ran out of storage.
1873 optional string volume_description = 1;
1874
1875 enum State {
1876 UNKNOWN = 0;
1877 OFF = 1;
1878 ON = 2;
1879 }
1880 optional State state = 2;
1881}
1882
1883/**
1884 * Logs when an app is downgraded.
1885 * Logged from:
1886 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1887 */
1888message AppDowngraded {
1889 optional string package_name = 1;
1890 // Size of the package (all data) before being downgraded.
1891 optional int64 size_in_bytes_before = 2;
1892 // Size of the package (all data) after being downgraded.
1893 optional int64 size_in_bytes_after = 3;
1894
1895 optional bool aggressive = 4;
1896}
1897
1898/**
1899 * Logs when an app is optimized after being downgraded.
1900 * Logged from:
1901 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1902 */
1903message AppOptimizedAfterDowngraded {
1904 optional string package_name = 1;
1905}
1906
1907/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001908 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001909 * Logged from:
1910 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1911 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001912message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001913 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001914
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001915 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001916
1917 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001918 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001919 optional string process_name = 3;
1920
1921 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001922 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001923
1924 optional string package_name = 5;
1925
1926 enum InstantApp {
1927 UNAVAILABLE = 0;
1928 FALSE = 1;
1929 TRUE = 2;
1930 }
1931 optional InstantApp is_instant_app = 6;
1932
1933 enum ForegroundState {
1934 UNKNOWN = 0;
1935 BACKGROUND = 1;
1936 FOREGROUND = 2;
1937 }
1938 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001939
1940 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001941}
David Chen9e3808c2017-11-20 17:25:34 -08001942
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001943/**
1944 * Logs when a WTF (What a Terrible Failure) happened.
1945 * Logged from:
1946 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1947 */
1948message WTFOccurred {
1949 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001950
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001951 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001952
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001953 // The name of the process.
1954 // system_server if it is not by an app
1955 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001956
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001957 // The pid if available. -1 means not available.
1958 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001959
1960 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001961}
1962
1963/**
1964 * Logs when system server reports low memory.
1965 * Logged from:
1966 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1967 */
1968message LowMemReported {
1969}
1970
1971/**
1972 * Logs when an app ANR (App Not Responding) occurs.
1973 * Logged from:
1974 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1975 */
1976message ANROccurred {
1977 optional int32 uid = 1 [(is_uid) = true];
1978
1979 optional string process_name = 2;
1980
1981 optional string short_component_name = 3;
1982
1983 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001984
1985 enum InstantApp {
1986 UNAVAILABLE = 0;
1987 FALSE = 1;
1988 TRUE = 2;
1989 }
1990 optional InstantApp is_instant_app = 5;
1991
1992 enum ForegroundState {
1993 UNKNOWN = 0;
1994 BACKGROUND = 1;
1995 FOREGROUND = 2;
1996 }
1997 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001998
1999 optional android.server.ErrorSource error_source = 7;
2000
2001 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002002}
2003
Bookatza7020bd2018-08-28 16:29:35 -07002004/**
2005 * Logs when the vibrator state changes.
2006 * Logged from:
2007 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2008 */
2009message VibratorStateChanged {
2010 repeated AttributionNode attribution_node = 1;
2011
2012 enum State {
2013 OFF = 0;
2014 ON = 1;
2015 }
2016 optional State state = 2;
2017
2018 // Duration (in milliseconds) requested to keep the vibrator on.
2019 // Only applicable for State == ON.
2020 optional int64 duration_millis = 3;
2021}
2022
David Chen0a368b22017-12-06 16:28:16 -08002023/*
2024 * Allows other apps to push events into statsd.
2025 * Logged from:
2026 * frameworks/base/core/java/android/util/StatsLog.java
2027 */
David Chen0b5c90c2018-01-25 16:51:49 -08002028message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002029 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002030 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002031
2032 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2033 optional int32 label = 2;
2034
2035 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2036 // predicates for the metrics).
2037 enum State {
2038 UNKNOWN = 0;
2039 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2040 STOP = 2;
2041 START = 3;
2042 }
2043 optional State state = 3;
2044}
2045
David Chen9e3808c2017-11-20 17:25:34 -08002046/**
Bookatz7948c872018-09-04 12:58:33 -07002047 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2048 * For example, this could be due to the user manually changing the time.
2049 *
2050 * Logged from:
2051 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2052 */
2053message WallClockTimeShifted {
2054 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2055 optional int64 wall_clock_timestamp_millis = 1;
2056}
2057
2058/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002059 * Logs when statsd detects an anomaly.
2060 *
2061 * Logged from:
2062 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2063 */
2064message AnomalyDetected {
2065 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002066 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002067
Yangster-mac94e197c2018-01-02 16:03:03 -08002068 // Id of the config whose anomaly detection alert fired.
2069 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002070
Yangster-mac94e197c2018-01-02 16:03:03 -08002071 // Id of the alert (i.e. name of the anomaly that was detected).
2072 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002073}
2074
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002075message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002076 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002077 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002078
2079 // The app package name.
2080 optional string pkg_name = 2;
2081
2082 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002083 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002084 WARM = 1;
2085 HOT = 2;
2086 COLD = 3;
2087 }
2088 // The transition type.
2089 optional TransitionType type = 3;
2090
2091 // The activity name.
2092 optional string activity_name = 4;
2093
2094 // The name of the calling app. Empty if not set.
2095 optional string calling_pkg_name = 5;
2096
2097 // Whether the app is an instant app.
2098 optional bool is_instant_app = 6;
2099
2100 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002101 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002102
Bookatz80d11a02018-01-16 10:46:35 -08002103 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002104
David Chen0b5c90c2018-01-25 16:51:49 -08002105 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002106 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002107 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002108 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002109 optional int32 bind_application_delay_millis = 11;
2110 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002111
2112 // Empty if not set.
2113 optional string launch_token = 13;
2114
Calin Juravle759fbda2018-02-20 19:52:30 +00002115 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002116 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002117
2118 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002119 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002120}
2121
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002122message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002123 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002124 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002125
2126 // The app package name.
2127 optional string pkg_name = 2;
2128
2129 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002130 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002131 WARM = 1;
2132 HOT = 2;
2133 COLD = 3;
2134 }
2135 // The transition type.
2136 optional TransitionType type = 3;
2137
2138 // The activity name.
2139 optional string activity_name = 4;
2140}
2141
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002142message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002143 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002144 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002145
2146 // The app package name.
2147 optional string pkg_name = 2;
2148
2149 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002150 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002151 WITH_BUNDLE = 1;
2152 WITHOUT_BUNDLE = 2;
2153 }
2154 // The transition type.
2155 optional TransitionType type = 3;
2156
2157 // The activity name.
2158 optional string activity_name = 4;
2159
2160 optional bool transition_process_running = 5;
2161
2162 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002163 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002164}
2165
Bookatz8fcd09a2017-12-18 13:01:10 -08002166/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002167 * Logs a picture-in-picture action
2168 * Logged from:
2169 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2170 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2171 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2172 */
2173message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002174 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002175 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002176
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002177 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002178
Chenjie Yu52cacc62017-12-08 18:11:45 -08002179 enum State {
2180 ENTERED = 1;
2181 EXPANDED_TO_FULL_SCREEN = 2;
2182 MINIMIZED = 3;
2183 DISMISSED = 4;
2184 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002185 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002186}
2187
2188/**
Chenjie Yue8904192017-12-08 19:12:57 -08002189 * Logs overlay action
2190 * Logged from:
2191 * services/core/java/com/android/server/wm/Session.java
2192 */
2193message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002194 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002195
2196 optional string package_name = 2;
2197
2198 optional bool using_alert_window = 3;
2199
2200 enum State {
2201 ENTERED = 1;
2202 EXITED = 2;
2203 }
2204 optional State state = 4;
2205}
2206
Chenjie Yuccfe6452018-01-30 11:33:21 -08002207/*
2208 * Logs foreground service starts and stops.
2209 * Note that this is not when a service starts or stops, but when it is
2210 * considered foreground.
2211 * Logged from
2212 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2213 */
2214message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002215 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002216 // package_name + "/" + class_name
2217 optional string short_name = 2;
2218
2219 enum State {
2220 ENTER = 1;
2221 EXIT = 2;
2222 }
2223 optional State state = 3;
2224}
2225
Chenjie Yue8904192017-12-08 19:12:57 -08002226/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002227 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2228 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2229 * attributed back to the parent (host) uid. One example is Chrome.
2230 *
2231 * Logged from:
2232 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2233 */
2234message IsolatedUidChanged {
2235 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002236 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002237 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002238 optional int32 parent_uid = 1;
2239
2240 optional int32 isolated_uid = 2;
2241
2242 // We expect an isolated uid to be removed before if it's used for another parent uid.
2243 enum Event {
2244 REMOVED = 0;
2245 CREATED = 1;
2246 }
2247 optional Event event = 3;
2248}
2249
2250/*
2251 * Logs the reception of an incoming network packet causing the main system to wake up for
2252 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2253 * and processed by WakeupController.cpp.
2254 */
2255message PacketWakeupOccurred {
2256 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2257 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002258 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002259 // The interface name on which the packet was received.
2260 optional string iface = 2;
2261 // The ethertype value of the packet.
2262 optional int32 ethertype = 3;
2263 // String representation of the destination MAC address of the packet.
2264 optional string destination_hardware_address = 4;
2265 // String representation of the source address of the packet if this was an IP packet.
2266 optional string source_ip = 5;
2267 // String representation of the destination address of the packet if this was an IP packet.
2268 optional string destination_ip = 6;
2269 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2270 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2271 // families.
2272 optional int32 ip_next_header = 7;
2273 // The source port if this was a TCP or UDP packet.
2274 optional int32 source_port = 8;
2275 // The destination port if this was a TCP or UDP packet.
2276 optional int32 destination_port = 9;
2277}
2278
2279/*
2280 * Logs the memory stats for an app on startup.
2281 * Logged from:
2282 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2283 */
2284message AppStartMemoryStateCaptured {
2285 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002286 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002287
2288 // The process name.
2289 optional string process_name = 2;
2290
2291 // The activity name.
2292 optional string activity_name = 3;
2293
2294 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002295 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002296
2297 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002298 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002299
2300 // RSS
2301 optional int64 rss_in_bytes = 6;
2302
2303 // CACHE
2304 optional int64 cache_in_bytes = 7;
2305
2306 // SWAP
2307 optional int64 swap_in_bytes = 8;
2308}
2309
2310/*
2311 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2312 * for LMK event.
2313 * Logged from:
2314 * system/core/lmkd/lmkd.c
2315 */
2316message LmkStateChanged {
2317 enum State {
2318 UNKNOWN = 0;
2319 START = 1;
2320 STOP = 2;
2321 }
2322 optional State state = 1;
2323}
2324
2325/*
2326 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2327 * Logged from:
2328 * system/core/lmkd/lmkd.c
2329 */
2330message LmkKillOccurred {
2331 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002332 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002333
2334 // The process name.
2335 optional string process_name = 2;
2336
2337 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002338 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002339
2340 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002341 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002342
2343 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002344 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002345
2346 // RSS
2347 optional int64 rss_in_bytes = 6;
2348
2349 // CACHE
2350 optional int64 cache_in_bytes = 7;
2351
2352 // SWAP
2353 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002354
2355 // The elapsed real time of start of the process.
2356 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002357}
2358
Rajeev Kumar51b54602018-03-01 12:18:26 -08002359/*
2360 * Logs when the ActivityManagerService detects that an app died.
2361 *
2362 * Logged from:
2363 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2364 */
2365message AppDied {
2366 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002367 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002368}
2369
Howard Ro21a039c2018-08-06 14:55:47 -07002370/**
2371 * An atom for generic metrics logging. Available from Android Q.
2372 */
2373message GenericAtom {
2374 // The uid of the application that sent this custom atom.
2375 optional int32 uid = 1 [(is_uid) = true];
2376
2377 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002378 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002379}
2380
Tej Singhd6d6d772018-09-05 17:41:25 -07002381/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002382 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002383 *
2384 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002385 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002386 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002387message BiometricAcquired {
2388 // Biometric modality that was acquired.
2389 optional android.hardware.biometrics.ModalityEnum modality = 1;
2390 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2391 optional int32 user = 2;
2392 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2393 optional bool is_crypto = 3;
2394 // Action that the device is performing. Acquired messages are only expected for enroll and
2395 // authenticate. Other actions may indicate an error.
2396 optional android.hardware.biometrics.ActionEnum action = 4;
2397 // The client that this acquisition was received for.
2398 optional android.hardware.biometrics.ClientEnum client = 5;
2399 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
2400 optional int32 acquire_info = 6;
2401 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
2402 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07002403}
2404
2405/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002406 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002407 *
2408 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002409 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002410 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002411message BiometricAuthenticated {
2412 // Biometric modality that was used.
2413 optional android.hardware.biometrics.ModalityEnum modality = 1;
2414 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2415 optional int32 user = 2;
2416 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
2417 // storage.
2418 optional bool is_crypto = 3;
2419 // The client that this acquisition was received for.
2420 optional android.hardware.biometrics.ClientEnum client = 4;
Tej Singhd6d6d772018-09-05 17:41:25 -07002421
Kevin Chyn1741a072019-01-17 11:54:40 -08002422 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07002423 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08002424 REJECTED = 1;
2425 PENDING_CONFIRMATION = 2;
2426 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07002427 }
Kevin Chyn1741a072019-01-17 11:54:40 -08002428
2429 // State of the current auth attempt.
2430 optional State state = 5;
2431 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
2432 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
2433 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
2434 // CONFIRMED.
Kevin Chyn1d19c692019-01-27 12:23:47 -08002435 optional int64 latency_millis = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08002436}
2437
2438/**
2439 * Logs when a biometric error occurs.
2440 *
2441 * Logged from:
2442 * frameworks/base/services/core/java/com/android/server/biometrics
2443 */
2444message BiometricErrorOccurred {
2445 // Biometric modality that was used.
2446 optional android.hardware.biometrics.ModalityEnum modality = 1;
2447 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2448 optional int32 user = 2;
2449 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
2450 optional bool is_crypto = 3;
2451 // Action that the device is performing.
2452 optional android.hardware.biometrics.ActionEnum action = 4;
2453 // The client that this acquisition was received for.
2454 optional android.hardware.biometrics.ClientEnum client = 5;
2455 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
2456 // are unique to modality.
2457 optional int32 error_info = 6;
2458 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
2459 // by the vendor and not specified by the HIDL interface.
2460 optional int32 error_info_vendor = 7;
2461}
2462
2463/**
2464 * Logs when a biometric HAL has crashed.
2465 * Logged from:
2466 * frameworks/base/services/core/java/com/android/server/biometrics
2467 */
2468message BiometricHalDeathReported {
2469 // Biometric modality.
2470 optional android.hardware.biometrics.ModalityEnum modality = 1;
Tej Singhd6d6d772018-09-05 17:41:25 -07002471}
Howard Ro688ae182018-09-25 00:09:36 -07002472
2473message Notification {
2474
2475 // Type of notification event.
2476 enum Type {
2477 TYPE_UNKNOWN = 0;
2478 // Notification became visible to the user.
2479 TYPE_OPEN = 1;
2480 // Notification became hidden.
2481 TYPE_CLOSE = 2;
2482 // Notification switched to detail mode.
2483 TYPE_DETAIL = 3;
2484 // Notification was clicked.
2485 TYPE_ACTION = 4;
2486 // Notification was dismissed.
2487 TYPE_DISMISS = 5;
2488 // Notification switched to summary mode. The enum value of 14 is to
2489 // match that of metrics_constants.
2490 TYPE_COLLAPSE = 14;
2491 }
2492 optional Type type = 1;
2493
2494 // Package name associated with the notification.
2495 optional string package_name = 2;
2496
2497 // Tag associated with notification.
2498 optional string tag = 3;
2499
2500 // Application-supplied ID associated with the notification.
2501 optional int32 id = 4;
2502
2503 // Index of notification in the notification panel.
2504 optional int32 shade_index = 5;
2505
2506 // The number of notifications in the notification panel.
2507 optional int32 shade_count = 6;
2508
2509 // Importance for the notification.
2510 optional int32 importance = 7;
2511
2512 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002513 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002514
2515 // Importance for the notification channel.
2516 optional int32 channel_importance = 9;
2517
Howard Ro183c2bd2018-10-18 13:52:10 -07002518 // Application-supplied ID associated with the notifications group.
2519 optional string group_id = 10;
2520
Howard Ro688ae182018-09-25 00:09:36 -07002521 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002522 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002523
Howard Ro183c2bd2018-10-18 13:52:10 -07002524 // Reason for dismissal of a notification. This field is only meaningful for
2525 // TYPE_DISMISS events.
2526 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002527
Howard Ro183c2bd2018-10-18 13:52:10 -07002528 // The first post time of notification, stable across updates.
2529 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002530
Howard Ro183c2bd2018-10-18 13:52:10 -07002531 // The most recent interruption time, or the creation time if no updates.
2532 // Differs from update_millis because updates are filtered based on whether
2533 // they actually interrupted the user.
2534 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002535
Howard Ro183c2bd2018-10-18 13:52:10 -07002536 // The most recent update time, or the creation time if no updates.
2537 optional int64 update_millis = 15;
2538
2539 // The most recent visibility event.
2540 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002541}
2542
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002543/*
Tej Singh0d176952019-01-16 19:10:54 -08002544 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08002545 */
Tej Singh0d176952019-01-16 19:10:54 -08002546message FlagFlipUpdateOccurred {
2547 // If the event is from a flag config package, specify the package name.
2548 optional string flag_flip_package_name = 1;
2549
2550 // The order id of the package
2551 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08002552}
2553
2554/*
2555 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08002556 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08002557 */
2558message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08002559 // Name of the train.
2560 optional string train_name = 1;
2561 // Version code for a "train" of packages that need to be installed atomically
2562 optional int64 train_version_code = 2;
2563 // After installation of this package, device requires a restart.
2564 optional bool requires_staging = 3;
2565 // Rollback should be enabled for this install.
2566 optional bool rollback_enabled = 4;
2567 // Requires low latency monitoring if possible.
2568 optional bool requires_low_latency_monitor = 5;
2569
Yangster-macb89807e2018-11-15 21:10:57 -08002570 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08002571 UNKNOWN = 0;
2572 INSTALL_REQUESTED = 1;
2573 INSTALL_STARTED = 2;
2574 INSTALL_STAGED_NOT_READY = 3;
2575 INSTALL_STAGED_READY = 4;
2576 INSTALL_SUCCESS = 5;
2577 INSTALL_FAILURE = 6;
2578 INSTALL_CANCELLED = 7;
2579 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08002580 }
Chenjie Yu8366c712019-01-16 20:48:30 -08002581 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08002582}
2583
Maggie Whitefc1aa592018-11-28 21:55:23 -08002584/** Represents USB port overheat event. */
2585message UsbPortOverheatEvent {
2586 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
2587 optional int32 plug_temperature_deci_c = 1;
2588
2589 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
2590 optional int32 max_temperature_deci_c = 2;
2591
2592 /* Time between USB plug event and overheat threshold trip, in seconds. */
2593 optional int32 time_to_overheat_secs = 3;
2594
2595 /* Time between overheat threshold trip and hysteresis, in seconds. */
2596 optional int32 time_to_hysteresis_secs = 4;
2597
2598 /* Time between hysteresis and active mitigation ending, in seconds. */
2599 optional int32 time_to_inactive_secs = 5;
2600};
2601
Maggie White8735b852019-01-18 11:40:49 -08002602/**
2603 * Logs total effective full charge and discharge cycles on a battery.
2604 * Here are some examples of one effective cycle:
2605 * 1) the battery charges from 0% to 100% and drains back to 0%,
2606 * 2) charging from 50% to 100% and draining back to 50% twice.
2607 * Pulled from:
2608 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2609 */
2610message BatteryCycleCount {
2611 /* Number of total charge and discharge cycles on the system battery. */
2612 optional int32 cycle_count = 1;
2613}
2614
Yangster-macb89807e2018-11-15 21:10:57 -08002615/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002616 * Logs when a connection becomes available and lost.
2617 * Logged in StatsCompanionService.java
2618 */
2619message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002620 // Id of the network.
2621 optional int32 net_id = 1;
2622
2623 enum State {
2624 UNKNOWN = 0;
2625 CONNECTED = 1;
2626 DISCONNECTED = 2;
2627 }
2628 // Connected state of a network.
2629 optional State state = 2;
2630}
2631
2632/**
2633 * Logs when a service starts and stops.
2634 * Logged from:
2635 * services/core/java/com/android/server/am/ActiveServices.java
2636 */
2637message ServiceStateChanged {
2638
2639 optional int32 uid = 1 [(is_uid) = true];
2640
2641 optional string package_name = 2;
2642
2643 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002644
2645 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002646 START = 1;
2647 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002648 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002649
2650 optional State state = 4;
2651}
2652
2653/**
2654 * Logs when a service is launched.
2655 * Logged from:
2656 * services/core/java/com/android/server/am/ActiveServices.java
2657 */
2658message ServiceLaunchReported {
2659
2660 optional int32 uid = 1 [(is_uid) = true];
2661
2662 optional string package_name = 2;
2663
2664 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002665}
Howard Ro688ae182018-09-25 00:09:36 -07002666
Chenjie Yubbcbc602018-02-05 16:51:52 -08002667//////////////////////////////////////////////////////////////////////
2668// Pulled atoms below this line //
2669//////////////////////////////////////////////////////////////////////
2670
2671/**
David Chenc8a43242017-10-17 16:23:28 -07002672 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2673 *
2674 * Pulled from:
2675 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2676 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002677message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002678 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002679
2680 optional int64 rx_bytes = 2;
2681
2682 optional int64 rx_packets = 3;
2683
2684 optional int64 tx_bytes = 4;
2685
2686 optional int64 tx_packets = 5;
2687}
2688
2689/**
2690 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2691 *
2692 * Pulled from:
2693 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2694 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002695message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002696 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002697
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002698 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2699 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002700
2701 optional int64 rx_bytes = 3;
2702
2703 optional int64 rx_packets = 4;
2704
2705 optional int64 tx_bytes = 5;
2706
2707 optional int64 tx_packets = 6;
2708}
2709
2710/**
2711 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2712 *
2713 * Pulled from:
2714 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2715 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002716message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002717 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002718
2719 optional int64 rx_bytes = 2;
2720
2721 optional int64 rx_packets = 3;
2722
2723 optional int64 tx_bytes = 4;
2724
2725 optional int64 tx_packets = 5;
2726}
2727
2728/**
2729 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2730 *
2731 * Pulled from:
2732 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2733 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002734message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002735 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002736
Yao Chenc40a19d2018-03-15 16:48:25 -07002737 // 1 denotes foreground and 0 denotes background. This is called Set in
2738 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002739 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002740
2741 optional int64 rx_bytes = 3;
2742
2743 optional int64 rx_packets = 4;
2744
2745 optional int64 tx_bytes = 5;
2746
2747 optional int64 tx_packets = 6;
2748}
2749
2750/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002751 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2752 *
2753 * Pulled from:
2754 * StatsCompanionService
2755 */
2756message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002757 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002758
2759 optional int64 rx_bytes = 2;
2760
2761 optional int64 tx_bytes = 3;
2762}
2763
2764/**
David Chenc8a43242017-10-17 16:23:28 -07002765 * Pulls the kernel wakelock durations. This atom is adapted from
2766 * android/internal/os/KernelWakelockStats.java
2767 *
2768 * Pulled from:
2769 * StatsCompanionService using KernelWakelockReader.
2770 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002771message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002772 optional string name = 1;
2773
2774 optional int32 count = 2;
2775
2776 optional int32 version = 3;
2777
Yangster-maca8a30442018-10-13 23:46:34 -07002778 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002779}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002780
Chenjie Yu05013b32017-11-21 10:21:41 -08002781/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002782 * Pulls low power state information. If power.stats HAL is not available, this
2783 * includes platform and subsystem sleep state information,
2784 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2785 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002786 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002787 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002788 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2789 * as defined in:
2790 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002791 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002792message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002793 // Subsystem name
2794 optional string subsystem_name = 1;
2795 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2796 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002797 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2798 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002799 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002800 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002801 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002802 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002803 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002804}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002805
Chenjie Yu05013b32017-11-21 10:21:41 -08002806/**
Bookatz92da2832018-11-01 18:10:03 -07002807 * Pulls on-device power measurement information.
2808 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2809 * Pulled from:
2810 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2811 */
2812message OnDevicePowerMeasurement {
2813 // Name of the subsystem (to which the rail belongs).
2814 optional string subsystem_name = 1;
2815
2816 // Rail name. The rail lies within the subsystem.
2817 optional string rail_name = 2;
2818
2819 // Time (in ms since boot) at which the rail energy value was measured.
2820 // This may differ slightly from the time that statsd logs this information.
2821 optional uint64 measurement_timestamp_millis = 3;
2822
2823 // Accumulated energy used via the rail since device boot in uWs.
2824 optional uint64 energy_microwatt_secs = 4;
2825}
2826
2827/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002828 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002829 * Pulls the time the cpu spend on the frequency index. Frequency index
2830 * starts from highest to lowest. The value should be monotonically
2831 * increasing since boot. However, if there is a cpu
2832 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002833 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002834message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002835 optional uint32 cluster = 1;
2836 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002837 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002838}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002839
Chenjie Yu05013b32017-11-21 10:21:41 -08002840/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002841 * Pulls Cpu Time Per Uid.
2842 * Note that isolated process uid time should be attributed to host uids.
2843 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002844message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002845 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002846 optional uint64 user_time_micros = 2;
2847 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002848}
2849
2850/**
2851 * Pulls Cpu Time Per Uid per frequency.
2852 * Note that isolated process uid time should be attributed to host uids.
2853 * For each uid, we order the time by descending frequencies.
2854 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002855message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002856 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002857 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002858 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002859}
Hugo Benichi884970e2017-11-14 22:42:46 +09002860
Chenjie Yu05013b32017-11-21 10:21:41 -08002861/**
2862 * Pulls Wifi Controller Activity Energy Info
2863 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002864message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002865 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002866 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002867 // stack reported state
2868 // TODO: replace this with proto enum
2869 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002870 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002871 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002872 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002873 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002874 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002875 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002876 // product of current(mA), voltage(V) and time(ms)
2877 optional uint64 controller_energy_used = 6;
2878}
2879
2880/**
2881 * Pulls Modem Activity Energy Info
2882 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002883message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002884 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002885 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002886 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002887 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002888 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002889 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002890 /**
2891 * Tx power index
2892 * index 0 = tx_power < 0dBm
2893 * index 1 = 0dBm < tx_power < 5dBm
2894 * index 2 = 5dBm < tx_power < 15dBm
2895 * index 3 = 15dBm < tx_power < 20dBm
2896 * index 4 = tx_power > 20dBm
2897 */
2898 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002899 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002900 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002901 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002902 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002903 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002904 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002905 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002906 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002907 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002908 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002909 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002910 // product of current(mA), voltage(V) and time(ms)
2911 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002912}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002913
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002914/**
2915 * Pulls Bluetooth Activity Energy Info
2916 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2917 */
2918message BluetoothActivityInfo {
2919 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002920 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002921 // bluetooth stack state
2922 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002923 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002924 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002925 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002926 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002927 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002928 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002929 // product of current(mA), voltage(V) and time(ms)
2930 optional uint64 energy_used = 6;
2931}
2932
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002933/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002934 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002935 *
2936 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002937 */
2938message ProcessMemoryState {
2939 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002940 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002941
2942 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002943 // Usually package name, "system" for system server.
2944 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002945 optional string process_name = 2;
2946
Rafal Slawikda51b932018-12-13 16:31:33 +00002947 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002948 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002949
2950 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002951 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002952
2953 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002954 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002955
Rajeev Kumar90235992018-01-29 11:06:48 -08002956 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002957 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2958 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002959 optional int64 rss_in_bytes = 6;
2960
2961 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002962 // Value is read from memory.stat, field total_cache if per-app memory
2963 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002964 optional int64 cache_in_bytes = 7;
2965
2966 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002967 // Value is read from memory.stat, field total_swap if per-app memory
2968 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002969 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002970
Rafal Slawikd03ae422018-11-20 11:27:45 +00002971 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002972 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002973
2974 // Elapsed real time when the process started.
2975 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2976 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002977}
2978
2979/*
Rafal Slawik08621582018-10-15 14:53:07 +01002980 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002981 *
2982 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002983 */
2984message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002985 // The uid if available. -1 means not available.
2986 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002987
Rafal Slawikbf67d072018-10-23 11:07:54 +01002988 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002989 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002990 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002991
Rafal Slawikbf67d072018-10-23 11:07:54 +01002992 // # of page-faults
2993 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002994
Rafal Slawikbf67d072018-10-23 11:07:54 +01002995 // # of major page-faults
2996 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002997
Rafal Slawikbf67d072018-10-23 11:07:54 +01002998 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002999 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003000 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003001
Rafal Slawikd03ae422018-11-20 11:27:45 +00003002 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003003 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003004
3005 // Elapsed real time when the process started.
3006 // Value is read from /proc/PID/stat, field 22.
3007 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003008}
3009
3010/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003011 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003012 *
3013 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3014 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003015 *
3016 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003017 */
3018message ProcessMemoryHighWaterMark {
3019 // The uid if available. -1 means not available.
3020 optional int32 uid = 1 [(is_uid) = true];
3021
Rafal Slawikda51b932018-12-13 16:31:33 +00003022 // The process name.
3023 // Usually package name or process cmdline.
3024 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003025 optional string process_name = 2;
3026
3027 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3028 // /proc/PID/status.
3029 optional int64 rss_high_water_mark_in_bytes = 3;
3030}
3031
3032/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003033 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003034 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003035message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003036 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003037}
3038
3039/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003040 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003041 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003042message SystemUptime {
3043 // Milliseconds since the system was booted.
3044 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3045 // for external input).
3046 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003047 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003048}
3049
3050/*
3051 * Reads from /proc/uid_concurrent_active_time which has the format:
3052 * active: X (X is # cores)
3053 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3054 * [uid1]: [time-0] [time-1] [time-2] ... ...
3055 * ...
3056 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3057 * The file contains a monotonically increasing count of time for a single boot.
3058 */
3059message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003060 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003061 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003062}
3063
3064/**
3065 * Reads from /proc/uid_concurrent_policy_time which has the format:
3066 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3067 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3068 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3069 * ...
3070 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3071 * The file contains a monotonically increasing count of time for a single boot.
3072 */
3073message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003074 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003075 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003076 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003077}
3078
3079/*
3080 * Pulls free disk space, for data, system partition and temporary directory.
3081 */
3082message DiskSpace {
3083 // available bytes in data partition
3084 optional uint64 data_available_bytes = 1;
3085 // available bytes in system partition
3086 optional uint64 system_available_bytes = 2;
3087 // available bytes in download cache or temp directories
3088 optional uint64 temp_available_bytes = 3;
3089}
Tej Singhbf972d92018-01-10 20:51:13 -08003090
3091/**
3092 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003093 *
3094 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003095 */
3096message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003097 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003098}
3099
3100/**
3101 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003102 * Pulled from:
3103 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003104 */
3105message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003106 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003107}
3108
3109/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003110 * Pulls battery voltage.
3111 * Pulled from:
3112 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3113 */
3114message BatteryVoltage {
3115 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003116 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003117}
3118
3119/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003120 * Pulls battery level (percent full, from 0 to 100).
3121 *
3122 * Pulled from:
3123 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3124 */
3125message BatteryLevel {
3126 // Battery level. Should be in [0, 100].
3127 optional int32 battery_level = 1;
3128}
3129
3130/**
Tej Singhd89137e2018-03-26 14:51:40 -07003131 * Pulls the temperature of various parts of the device.
3132 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003133 *
3134 * Pulled from:
3135 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3136 */
3137message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003138 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003139 optional android.os.TemperatureTypeEnum sensor_location = 1;
3140
3141 // The name of the temperature source. Eg. CPU0
3142 optional string sensor_name = 2;
3143
Tej Singhd89137e2018-03-26 14:51:40 -07003144 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003145 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003146 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003147}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003148
3149/**
3150 * Pulls the statistics of calls to Binder.
3151 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003152 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3153 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003154 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003155 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003156 */
3157message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003158 // UID of the process responsible for the binder transaction. It will be set if the process
3159 // executing the binder transaction attribute the transaction to another uid using
3160 // Binder.setThreadWorkSource().
3161 //
3162 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003163 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003164 // UID of the process executing the binder transaction.
3165 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003166 // Fully qualified class name of the API call.
3167 //
3168 // This is a system server class name.
3169 //
3170 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3171 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3172 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3173 // commonly used APIs.
3174 optional string service_class_name = 2;
3175 // Method name of the API call. It can also be a transaction code if we cannot
3176 // resolve it to a name. See Binder#getTransactionName.
3177 //
3178 // This is a system server method name.
3179 optional string service_method_name = 3;
3180 // Total number of API calls.
3181 optional int64 call_count = 4;
3182 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3183 optional bool screen_interactive = 13;
3184 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3185 // call_count will be equal to recorded_call_count.
3186 //
3187 // If recorded_call_count is different than call_count, it means data collection has been
3188 // sampled. All the fields below will be sampled in this case.
3189 optional int64 recorded_call_count = 12;
3190 // Number of exceptions thrown by the API.
3191 optional int64 recorded_exception_count = 5;
3192 // Total latency of all API calls.
3193 // Average can be computed using total_latency_micros / recorded_call_count.
3194 optional int64 recorded_total_latency_micros = 6;
3195 // Maximum latency of one API call.
3196 optional int64 recorded_max_latency_micros = 7;
3197 // Total CPU usage of all API calls.
3198 // Average can be computed using total_cpu_micros / recorded_call_count.
3199 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3200 optional int64 recorded_total_cpu_micros = 8;
3201 // Maximum CPU usage of one API call.
3202 optional int64 recorded_max_cpu_micros = 9;
3203 // Maximum parcel reply size of one API call.
3204 optional int64 recorded_max_reply_size_bytes = 10;
3205 // Maximum parcel request size of one API call.
3206 optional int64 recorded_max_request_size_bytes = 11;
3207}
3208
3209/**
3210 * Pulls the statistics of exceptions during calls to Binder.
3211 *
3212 * Binder stats are cumulative from boot unless somebody reset the data using
3213 * > adb shell dumpsys binder_calls_stats --reset
3214 */
3215message BinderCallsExceptions {
3216 // Exception class name, e.g. java.lang.IllegalArgumentException.
3217 //
3218 // This is an exception class name thrown by the system server.
3219 optional string exception_class_name = 1;
3220 // Total number of exceptions.
3221 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003222}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003223
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003224/**
3225 * Pulls the statistics of message dispatching on HandlerThreads.
3226 *
3227 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3228 * config on the device.
3229 *
3230 * Next tag: 11
3231 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003232message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003233 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003234 optional int32 uid = 1 [(is_uid) = true];
3235
3236 // Fully qualified class name of the handler target class.
3237 //
3238 // This field does not contain PII. This is a system server class name.
3239 optional string handler_class_name = 2;
3240
3241 // The name of the thread that runs the Looper.
3242 //
3243 // This field does not contain PII. This is a system server thread name.
3244 optional string looper_thread_name = 3;
3245
3246 // The name of the dispatched message.
3247 //
3248 // This field does not contain PII. This is a system server constant or class
3249 // name.
3250 optional string message_name = 4;
3251
3252 // Total number of successfully dispatched messages.
3253 optional int64 message_count = 5;
3254
3255 // Total number of messages that failed dispatching.
3256 optional int64 exception_count = 6;
3257
3258 // Total number of processed messages we have data recorded for. If we
3259 // collected data for all the messages, message_count will be equal to
3260 // recorded_message_count.
3261 //
3262 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003263 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003264 optional int64 recorded_message_count = 7;
3265
3266 // Total latency of all processed messages.
3267 // Average can be computed using recorded_total_latency_micros /
3268 // recorded_message_count.
3269 optional int64 recorded_total_latency_micros = 8;
3270
3271 // Total CPU usage of all processed message.
3272 // Average can be computed using recorded_total_cpu_micros /
3273 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003274 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003275 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003276
3277 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3278 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003279
3280 // Max recorded CPU usage of all processed messages.
3281 optional int64 recorded_max_cpu_micros = 11;
3282
3283 // Max recorded latency of all processed messages.
3284 optional int64 recorded_max_latency_micros = 12;
3285
3286 // Total number of messages we tracked the dispatching delay for. If we
3287 // collected data for all the messages, message_count will be equal to
3288 // recorded_delay_message_count.
3289 //
3290 // If recorded_delay_message_count is different than message_count, it means data
3291 // collection has been sampled or/and not all messages specified the target dispatch time.
3292 // The fields below will be sampled in this case.
3293 optional int64 recorded_delay_message_count = 13;
3294
3295 // Total dispatching delay of all processed messages.
3296 // Calculated as a difference between the target dispatching time (Message.when)
3297 // and the actual dispatching time.
3298 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3299 optional int64 recorded_total_delay_millis = 14;
3300
3301 // Max dispatching delay of all processed messages.
3302 // Calculated as a difference between the target dispatching time (Message.when)
3303 // and the actual dispatching time.
3304 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003305}
Tej Singh86dc9db2018-09-06 00:39:57 +00003306
3307/**
3308 * Pulls disk information, such as write speed and latency.
3309 */
3310message DiskStats {
3311 // Time taken to open, write 512B to, and close a file.
3312 // -1 if error performing the check.
3313 optional int64 data_write_latency_millis = 1;
3314
3315 optional bool file_based_encryption = 2;
3316
3317 // Recent disk write speed in kB/s.
3318 // -1 if error querying storageed.
3319 // 0 if data is unavailable.
3320 optional int32 recent_disk_write_speed = 3;
3321}
3322
3323
3324/**
3325 * Free and total bytes of the Data, Cache, and System partition.
3326 */
3327message DirectoryUsage {
3328 enum Directory {
3329 UNKNOWN = 0;
3330 DATA = 1;
3331 CACHE = 2;
3332 SYSTEM = 3;
3333 }
3334 optional Directory directory = 1;
3335 optional int64 free_bytes = 2;
3336 optional int64 total_bytes = 3;
3337}
3338
3339
3340/**
3341 * Size of an application: apk size, data size, and cache size.
3342 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3343 * Information is only reported for apps with the primary user (user 0).
3344 * Sizes are aggregated by package name.
3345 */
3346message AppSize {
3347 // Including uids will involve modifying diskstats logic.
3348 optional string package_name = 1;
3349 // App size in bytes. -1 if unavailable.
3350 optional int64 app_size_bytes = 2;
3351 // App data size in bytes. -1 if unavailable.
3352 optional int64 app_data_size_bytes = 3;
3353 // App cache size in bytes. -1 if unavailable.
3354 optional int64 app_cache_size_bytes = 4;
3355 // Time that the cache file was produced.
3356 // Uses System.currentTimeMillis(), which is wall clock time.
3357 optional int64 cache_time_millis = 5;
3358}
3359
3360
3361/**
3362 * Size of a particular category. Eg: photos, videos.
3363 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3364 */
3365message CategorySize {
3366 enum Category {
3367 UNKNOWN = 0;
3368 APP_SIZE = 1;
3369 APP_DATA_SIZE = 2;
3370 APP_CACHE_SIZE = 3;
3371 PHOTOS = 4;
3372 VIDEOS = 5;
3373 AUDIO = 6;
3374 DOWNLOADS = 7;
3375 SYSTEM = 8;
3376 OTHER = 9;
3377 }
3378 optional Category category = 1;
3379 // Category size in bytes.
3380 optional int64 size_bytes = 2;
3381 // Time that the cache file was produced.
3382 // Uses System.currentTimeMillis(), which is wall clock time.
3383 optional int64 cache_time_millis = 3;
3384}
Tej Singhd6d6d772018-09-05 17:41:25 -07003385
3386/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003387 * Pulls per uid I/O stats. The stats are cumulative since boot.
3388 *
3389 * Read/write bytes are I/O events from a storage device
3390 * Read/write chars are data requested by read/write syscalls, and can be
3391 * satisfied by caching.
3392 *
3393 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3394 */
3395message DiskIo {
3396 optional int32 uid = 1 [(is_uid) = true];
3397 optional int64 fg_chars_read = 2;
3398 optional int64 fg_chars_write = 3;
3399 optional int64 fg_bytes_read = 4;
3400 optional int64 fg_bytes_write = 5;
3401 optional int64 bg_chars_read = 6;
3402 optional int64 bg_chars_write = 7;
3403 optional int64 bg_bytes_read = 8;
3404 optional int64 bg_bytes_write = 9;
3405 optional int64 fg_fsync = 10;
3406 optional int64 bg_fsync= 11;
3407}
3408
3409
3410/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003411 * Pulls the number of fingerprints for each user.
3412 *
Kevin Chyn1741a072019-01-17 11:54:40 -08003413 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07003414 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003415message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07003416 // The associated user. Eg: 0 for owners, 10+ for others.
3417 // Defined in android/os/UserHandle.java
3418 optional int32 user = 1;
3419 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08003420 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003421}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003422
Yangsteraf9aee72018-10-12 09:26:16 -07003423message AggStats {
3424 optional int64 min = 1;
3425
3426 optional int64 average = 2;
3427
3428 optional int64 max = 3;
3429}
3430
3431message ProcessStatsStateProto {
3432 optional android.service.procstats.ScreenState screen_state = 1;
3433
3434 optional android.service.procstats.MemoryState memory_state = 2;
3435
3436 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3437 // and not frameworks/base/core/java/android/app/ActivityManager.java
3438 optional android.service.procstats.ProcessState process_state = 3;
3439
3440 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003441 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003442
3443 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003444 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003445
3446 // # of samples taken
3447 optional int32 sample_size = 5;
3448
3449 // PSS is memory reserved for this process
3450 optional AggStats pss = 6;
3451
3452 // USS is memory shared between processes, divided evenly for accounting
3453 optional AggStats uss = 7;
3454
3455 // RSS is memory resident for this process
3456 optional AggStats rss = 8;
3457}
3458
3459// Next Tag: 7
3460message ProcessStatsProto {
3461 // Name of process.
3462 optional string process = 1;
3463
3464 // Uid of the process.
3465 optional int32 uid = 2;
3466
3467 // Information about how often kills occurred
3468 message Kill {
3469 // Count of excessive CPU kills
3470 optional int32 cpu = 1;
3471
3472 // Count of kills when cached
3473 optional int32 cached = 2;
3474
3475 // PSS stats during cached kill
3476 optional AggStats cached_pss = 3;
3477 }
3478 optional Kill kill = 3;
3479
3480 // Time and memory spent in various states.
3481 repeated ProcessStatsStateProto states = 5;
3482
3483 // Total time process has been running... screen_state, memory_state, and process_state
3484 // will not be set.
3485 optional ProcessStatsStateProto total_running_state = 6;
3486}
3487
3488message PackageServiceOperationStatsProto {
3489 // Operate enum: Started, Foreground, Bound, Executing
3490 optional android.service.procstats.ServiceOperationState operation = 1;
3491
3492 // Number of times the service was in this operation.
3493 optional int32 count = 2;
3494
3495 // Information about a state the service can be in.
3496 message StateStats {
3497 // Screen state enum.
3498 optional android.service.procstats.ScreenState screen_state = 1;
3499 // Memory state enum.
3500 optional android.service.procstats.MemoryState memory_state = 2;
3501
3502 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003503 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003504 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003505 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003506 }
3507 repeated StateStats state_stats = 3;
3508}
3509
3510message PackageServiceStatsProto {
3511 // Name of service component.
3512 optional string service_name = 1;
3513
3514 // The operation stats.
3515 // The package_name, package_uid, package_version, service_name will not be set to save space.
3516 repeated PackageServiceOperationStatsProto operation_stats = 2;
3517}
3518
3519message PackageAssociationSourceProcessStatsProto {
3520 // Uid of the process.
3521 optional int32 process_uid = 1;
3522 // Process name.
3523 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08003524 // Package name.
3525 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07003526 // Total count of the times this association appeared.
3527 optional int32 total_count = 3;
3528
3529 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003530 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003531
3532 // Total count of the times this association became actively impacting its target process.
3533 optional int32 active_count = 5;
3534
3535 // Information on one source in this association.
3536 message StateStats {
3537 // Process state enum.
3538 optional android.service.procstats.ProcessState process_state = 1;
3539 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003540 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003541 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003542 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003543 }
3544 repeated StateStats active_state_stats = 6;
3545}
3546
3547message PackageAssociationProcessStatsProto {
3548 // Name of the target component.
3549 optional string component_name = 1;
3550 // Information on one source in this association.
3551 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3552}
3553
3554
3555message ProcessStatsPackageProto {
3556 // Name of package.
3557 optional string package = 1;
3558
3559 // Uid of the package.
3560 optional int32 uid = 2;
3561
3562 // Version of the package.
3563 optional int64 version = 3;
3564
3565 // Stats for each process running with the package loaded in to it.
3566 repeated ProcessStatsProto process_stats = 4;
3567
3568 // Stats for each of the package's services.
3569 repeated PackageServiceStatsProto service_stats = 5;
3570
3571 // Stats for each association with the package.
3572 repeated PackageAssociationProcessStatsProto association_stats = 6;
3573}
3574
3575message ProcessStatsSectionProto {
3576 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003577 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003578
3579 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003580 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003581
3582 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003583 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003584
3585 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003586 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003587
3588 // System runtime library. e.g. "libdvm.so", "libart.so".
3589 optional string runtime = 5;
3590
3591 // whether kernel reports swapped pss.
3592 optional bool has_swapped_pss = 6;
3593
3594 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3595 enum Status {
3596 STATUS_UNKNOWN = 0;
3597 STATUS_COMPLETE = 1;
3598 STATUS_PARTIAL = 2;
3599 STATUS_SHUTDOWN = 3;
3600 STATUS_SYSPROPS = 4;
3601 }
3602 repeated Status status = 7;
3603
Chenjie Yub2ecc792019-01-17 10:27:26 -08003604 // Number of pages available of various types and sizes, representation fragmentation.
3605 repeated ProcessStatsAvailablePagesProto available_pages = 10;
3606
Yangsteraf9aee72018-10-12 09:26:16 -07003607 // Stats for each process.
3608 repeated ProcessStatsProto process_stats = 8;
3609
3610 // Stats for each package.
3611 repeated ProcessStatsPackageProto package_stats = 9;
3612}
3613
Chenjie Yub2ecc792019-01-17 10:27:26 -08003614message ProcessStatsAvailablePagesProto {
3615 // Node these pages are in (as per /proc/pagetypeinfo)
3616 optional int32 node = 1;
3617
3618 // Zone these pages are in (as per /proc/pagetypeinfo)
3619 optional string zone = 2;
3620
3621 // Label for the type of these pages (as per /proc/pagetypeinfo)
3622 optional string label = 3;
3623
3624 // Distribution of number of pages available by order size. First entry in array is
3625 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
3626 repeated int32 pages_per_order = 4;
3627}
3628
Chenjie Yu12e5e672018-09-14 15:54:59 -07003629/**
3630 * Pulled from ProcessStatsService.java
3631 */
3632message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003633 optional ProcessStatsSectionProto proc_stats_section = 1;
3634}
3635
Chenjie Yuf910b7802019-01-11 16:08:20 -08003636/**
3637 * Pulled from ProcessStatsService.java
3638 */
3639message ProcStatsPkgProc {
3640 optional ProcessStatsSectionProto proc_stats_section = 1;
3641}
3642
Yangsteraf9aee72018-10-12 09:26:16 -07003643message PowerProfileProto {
3644 optional double cpu_suspend = 1;
3645
3646 optional double cpu_idle = 2;
3647
3648 optional double cpu_active = 3;
3649
3650 message CpuCluster {
3651 optional int32 id = 1;
3652 optional double cluster_power = 2;
3653 optional int32 cores = 3;
3654 repeated int64 speed = 4;
3655 repeated double core_power = 5;
3656 }
3657
3658 repeated CpuCluster cpu_cluster = 40;
3659
3660 optional double wifi_scan = 4;
3661
3662 optional double wifi_on = 5;
3663
3664 optional double wifi_active = 6;
3665
3666 optional double wifi_controller_idle = 7;
3667
3668 optional double wifi_controller_rx = 8;
3669
3670 optional double wifi_controller_tx = 9;
3671
3672 repeated double wifi_controller_tx_levels = 10;
3673
3674 optional double wifi_controller_operating_voltage = 11;
3675
3676 optional double bluetooth_controller_idle = 12;
3677
3678 optional double bluetooth_controller_rx = 13;
3679
3680 optional double bluetooth_controller_tx = 14;
3681
3682 optional double bluetooth_controller_operating_voltage = 15;
3683
3684 optional double modem_controller_sleep = 16;
3685
3686 optional double modem_controller_idle = 17;
3687
3688 optional double modem_controller_rx = 18;
3689
3690 repeated double modem_controller_tx = 19;
3691
3692 optional double modem_controller_operating_voltage = 20;
3693
3694 optional double gps_on = 21;
3695
3696 repeated double gps_signal_quality_based = 22;
3697
3698 optional double gps_operating_voltage = 23;
3699
3700 optional double bluetooth_on = 24;
3701
3702 optional double bluetooth_active = 25;
3703
3704 optional double bluetooth_at_cmd = 26;
3705
3706 optional double ambient_display = 27;
3707
3708 optional double screen_on = 28;
3709
3710 optional double radio_on = 29;
3711
3712 optional double radio_scanning = 30;
3713
3714 optional double radio_active = 31;
3715
3716 optional double screen_full = 32;
3717
3718 optional double audio = 33;
3719
3720 optional double video = 34;
3721
3722 optional double flashlight = 35;
3723
3724 optional double memory = 36;
3725
3726 optional double camera = 37;
3727
3728 optional double wifi_batched_scan = 38;
3729
3730 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003731}
Chenjie Yuab530202018-09-26 12:39:20 -07003732
3733/**
3734 * power_profile.xml and other constants for power model calculations.
3735 * Pulled from PowerProfile.java
3736 */
3737message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003738 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003739}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003740
3741/**
arangelovd5db50e2018-10-12 20:24:39 +01003742 * Logs when a user restriction was added or removed.
3743 *
3744 * Logged from:
3745 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3746 */
3747message UserRestrictionChanged {
3748 // The raw string of the user restriction as defined in UserManager.
3749 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3750 optional string restriction = 1;
3751 // Whether the restriction is enabled or disabled.
3752 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003753}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003754
3755/**
3756 * Pulls process user time and system time. Puller takes a snapshot of all pids
3757 * in the system and returns cpu stats for those that are working at the time.
3758 * Dead pids will be dropped. Kernel processes are excluded.
3759 * Min cool-down is 5 sec.
3760 */
3761message ProcessCpuTime {
3762 optional int32 uid = 1 [(is_uid) = true];
3763
3764 optional string process_name = 2;
3765 // Process cpu time in user space, cumulative from boot/process start
3766 optional int64 user_time_millis = 3;
3767 // Process cpu time in system space, cumulative from boot/process start
3768 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003769}
Misha Wagner5a51e002018-10-03 15:04:09 +01003770
3771/**
3772 * Pulls the CPU usage for each thread.
3773 *
3774 * Read from /proc/$PID/task/$TID/time_in_state files.
3775 *
3776 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3777 * time_in_state files not being present on some phones, have not been addressed. These should be
3778 * considered before a public release.
3779 */
3780message CpuTimePerThreadFreq {
3781 // UID that owns the process.
3782 optional int32 uid = 1 [(is_uid) = true];
3783 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003784 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003785 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003786 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003787 // Name of the process taken from `/proc/$PID/cmdline`.
3788 optional string process_name = 4;
3789 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3790 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003791
3792 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3793 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3794 // frequencies are given here as the alternative is sending eight separate atoms. This method
3795 // significantly reduces the amount of data created
3796 optional int32 frequency1_khz = 6;
3797 optional int32 time1_millis = 7;
3798 optional int32 frequency2_khz = 8;
3799 optional int32 time2_millis = 9;
3800 optional int32 frequency3_khz = 10;
3801 optional int32 time3_millis = 11;
3802 optional int32 frequency4_khz = 12;
3803 optional int32 time4_millis = 13;
3804 optional int32 frequency5_khz = 14;
3805 optional int32 time5_millis = 15;
3806 optional int32 frequency6_khz = 16;
3807 optional int32 time6_millis = 17;
3808 optional int32 frequency7_khz = 18;
3809 optional int32 time7_millis = 19;
3810 optional int32 frequency8_khz = 20;
3811 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003812}
Bookatz75ee6042018-11-09 12:27:37 -08003813
3814/**
Bookatz366a4432018-11-20 09:42:33 -08003815 * Pulls information about the device's build.
3816 */
3817message BuildInformation {
3818 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3819 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3820 optional string fingerprint = 1;
3821
3822 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3823 optional string brand = 2;
3824
3825 // Build.PRODUCT. The name of the overall product.
3826 optional string product = 3;
3827
3828 // Build.DEVICE. The name of the industrial design.
3829 optional string device = 4;
3830
3831 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3832 optional string version_release = 5;
3833
3834 // Build.ID. E.g. a label like "M4-rc20".
3835 optional string id = 6;
3836
3837 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3838 // represent this build.
3839 optional string version_incremental = 7;
3840
3841 // Build.TYPE. The type of build, like "user" or "eng".
3842 optional string type = 8;
3843
3844 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3845 optional string tags = 9;
3846}
3847
3848/**
Bookatz75ee6042018-11-09 12:27:37 -08003849 * Pulls on-device BatteryStats power use calculations for the overall device.
3850 */
3851message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08003852 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3853 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3854 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3855 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08003856}
3857
3858/**
3859 * Pulls on-device BatteryStats power use calculations broken down by uid.
3860 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3861 * that is attributed to non-uid items. They must all be included to get the total power use.
3862 */
3863message DeviceCalculatedPowerBlameUid {
3864 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3865 optional int32 uid = 1 [(is_uid) = true];
3866
Bookatz3dbc13a2018-12-21 12:16:51 -08003867 // Power used by this uid 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 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08003870}
3871
3872/**
3873 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3874 * drain type.
3875 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3876 * is attributed uids. They must all be included to get the total power use.
3877 */
3878message DeviceCalculatedPowerBlameOther {
3879 // The type of item whose power use is being reported.
3880 enum DrainType {
3881 AMBIENT_DISPLAY = 0;
3882 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3883 BLUETOOTH = 2;
3884 CAMERA = 3;
3885 // Cell-standby
3886 CELL = 4;
3887 FLASHLIGHT = 5;
3888 IDLE = 6;
3889 MEMORY = 7;
3890 // Amount that total computed drain exceeded the drain estimated using the
3891 // battery level changes and capacity.
3892 OVERCOUNTED = 8;
3893 PHONE = 9;
3894 SCREEN = 10;
3895 // Amount that total computed drain was below the drain estimated using the
3896 // battery level changes and capacity.
3897 UNACCOUNTED = 11;
3898 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3899 WIFI = 13;
3900 }
3901 optional DrainType drain_type = 1;
3902
Bookatz3dbc13a2018-12-21 12:16:51 -08003903 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3904 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3905 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003906}
arangelov4e994062018-11-13 16:12:38 +00003907
3908/**
3909 * Logs device policy features.
3910 *
3911 * Logged from:
3912 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3913 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3914 */
3915message DevicePolicyEvent {
3916 // The event id - unique for each event.
3917 optional android.stats.devicepolicy.EventId event_id = 1;
3918 // The admin package name.
3919 optional string admin_package_name = 2;
3920 // A generic integer parameter.
3921 optional int32 integer_value = 3;
3922 // A generic boolean parameter.
3923 optional bool boolean_value = 4;
3924 // A parameter specifying a time period in milliseconds.
3925 optional uint64 time_period_millis = 5;
3926 // A parameter specifying a list of package names, bundle extras or string parameters.
3927 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3928}
shawnlinea5b66b2018-11-13 15:05:29 +08003929
3930/**
3931 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3932 *
3933 * Logged from:
3934 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3935 */
3936message DocsUILaunchReported {
3937 optional android.stats.docsui.LaunchAction launch_action = 1;
3938 optional bool has_initial_uri = 2;
3939 optional android.stats.docsui.MimeType mime_type = 3;
3940 optional android.stats.docsui.Root initial_root = 4;
3941}
3942
3943/**
3944 * Logs root/app visited event in file managers/picker. Call this when the user
3945 * taps on root/app in hamburger menu.
3946 *
3947 * Logged from:
3948 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3949 */
3950message DocsUIRootVisitedReported {
3951 optional android.stats.docsui.ContextScope scope = 1;
3952 optional android.stats.docsui.Root root = 2;
3953}
3954
3955/**
3956 * Logs file operation stats. Call this when a file operation has completed.
3957 *
3958 * Logged from:
3959 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3960 */
3961message DocsUIFileOperationReported {
3962 optional android.stats.docsui.Provider provider = 1;
3963 optional android.stats.docsui.FileOperation file_op = 2;
3964}
3965
3966/**
3967 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3968 * mode.
3969 *
3970 * Logged from:
3971 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3972 */
3973message DocsUIFileOperationCopyMoveModeReported {
3974 optional android.stats.docsui.FileOperation file_op = 1;
3975 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3976}
3977
3978
3979/**
3980 * Logs file sub operation stats. Call this when a file operation has failed.
3981 *
3982 * Logged from:
3983 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3984 */
3985message DocsUIFileOperationFailureReported {
3986 optional android.stats.docsui.Authority authority = 1;
3987 optional android.stats.docsui.SubFileOperation sub_op = 2;
3988}
3989
3990/**
3991* Logs the cancellation of a file operation. Call this when a job is canceled
3992*
3993* Logged from:
3994* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3995*/
3996message DocsUIFileOperationCanceledReported {
3997 optional android.stats.docsui.FileOperation file_op = 1;
3998}
3999
4000/**
4001 * Logs startup time in milliseconds.
4002 *
4003 * Logged from:
4004 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4005 */
4006message DocsUIStartupMsReported {
4007 optional int32 startup_millis = 1;
4008}
4009
4010/**
4011 * Logs the action that was started by user.
4012 *
4013 * Logged from:
4014 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4015 */
4016message DocsUIUserActionReported {
4017 optional android.stats.docsui.UserAction action = 1;
4018}
4019
4020/**
4021 * Logs the invalid type when invalid scoped access is requested.
4022 *
4023 * Logged from:
4024 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4025 */
4026message DocsUIInvalidScopedAccessRequestReported {
4027 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004028}
Ben Murdochbab399f2018-12-06 11:01:38 +00004029
4030/**
shawnlina75e82d2019-01-07 10:31:12 +08004031 * Logs the package name that launches docsui picker mode.
4032 *
4033 * Logged from:
4034 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4035 */
4036message DocsUIPickerLaunchedFromReported {
4037 optional string package_name = 1;
4038}
4039
4040/**
4041 * Logs the search type.
4042 *
4043 * Logged from:
4044 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4045 */
4046message DocsUISearchTypeReported {
4047 optional android.stats.docsui.SearchType search_type = 1;
4048}
4049
4050/**
4051 * Logs the search mode.
4052 *
4053 * Logged from:
4054 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4055 */
4056message DocsUISearchModeReported {
4057 optional android.stats.docsui.SearchMode search_mode = 1;
4058}
4059
4060/**
4061 * Logs the pick result information.
4062 *
4063 * Logged from:
4064 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4065 */
4066message DocsUIPickResultReported {
4067 optional int32 total_action_count = 1;
4068 optional int64 duration_millis = 2;
4069 optional int32 file_count= 3;
4070 optional bool is_searching = 4;
4071 optional android.stats.docsui.Root picked_from = 5;
4072 optional android.stats.docsui.MimeType mime_type = 6;
4073 optional int32 repeatedly_pick_times = 7;
4074}
4075
4076/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004077 * Logs when an app's memory is compacted.
4078 *
4079 * Logged from:
4080 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4081 */
4082message AppCompacted {
4083 // The pid of the process being compacted.
4084 optional int32 pid = 1;
4085
4086 // The name of the process being compacted.
4087 optional string process_name = 2;
4088
4089 // The type of compaction.
4090 enum Action {
4091 UNKNOWN = 0;
4092 SOME = 1;
4093 FULL = 2;
4094 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004095 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004096
4097 // Total RSS in kilobytes consumed by the process prior to compaction.
4098 optional int64 before_rss_total_kilobytes = 4;
4099
4100 // File RSS in kilobytes consumed by the process prior to compaction.
4101 optional int64 before_rss_file_kilobytes = 5;
4102
4103 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4104 optional int64 before_rss_anon_kilobytes = 6;
4105
4106 // Swap in kilobytes consumed by the process prior to compaction.
4107 optional int64 before_swap_kilobytes = 7;
4108
4109 // Total RSS in kilobytes consumed by the process after compaction.
4110 optional int64 after_rss_total_kilobytes = 8;
4111
4112 // File RSS in kilobytes consumed by the process after compaction.
4113 optional int64 after_rss_file_kilobytes = 9;
4114
4115 // Anonymous RSS in kilobytes consumed by the process after compaction.
4116 optional int64 after_rss_anon_kilobytes = 10;
4117
4118 // Swap in kilobytes consumed by the process after compaction.
4119 optional int64 after_swap_kilobytes = 11;
4120
4121 // The time taken to perform compaction in milliseconds.
4122 optional int64 time_to_compact_millis = 12;
4123
4124 // The last compaction action performed for this app.
4125 optional Action last_action = 13;
4126
Ben Murdoch01720b82018-12-19 18:03:44 +00004127 // The last time that compaction was attempted on this process in milliseconds
4128 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4129 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004130
Ben Murdoch01720b82018-12-19 18:03:44 +00004131 // The oom_score_adj at the time of compaction.
4132 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004133
4134 // The process state at the time of compaction.
4135 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4136}
lifr157fc552018-12-12 16:38:04 +08004137
4138/**
4139 * Logs the latency period(in microseconds) and the return code of
4140 * the DNS(Domain Name System) lookups.
4141 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4142 * to get info(address or hostname) from DNS server(or DNS cache).
4143 * Logged from:
4144 * /system/netd/server/DnsProxyListener.cpp
4145 */
4146message NetworkDnsEventReported {
4147 // The types of the DNS lookups, as defined in
4148 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4149 enum EventType {
4150 EVENT_UNKNOWN = 0;
4151 EVENT_GETADDRINFO = 1;
4152 EVENT_GETHOSTBYNAME = 2;
4153 EVENT_GETHOSTBYADDR = 3;
4154 EVENT_RES_NSEND = 4;
4155 }
4156 optional EventType event_type = 1;
4157
4158 // The return value of the DNS resolver for each DNS lookups.
4159 //bionic/libc/include/netdb.h
4160 //system/netd/resolv/include/netd_resolv/resolv.h
4161 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004162 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004163 EAI_ADDRFAMILY = 1;
4164 EAI_AGAIN = 2;
4165 EAI_BADFLAGS = 3;
4166 EAI_FAIL = 4;
4167 EAI_FAMILY = 5;
4168 EAI_MEMORY = 6;
4169 EAI_NODATA = 7;
4170 EAI_NONAME = 8;
4171 EAI_SERVICE = 9;
4172 EAI_SOCKTYPE = 10;
4173 EAI_SYSTEM = 11;
4174 EAI_BADHINTS = 12;
4175 EAI_PROTOCOL = 13;
4176 EAI_OVERFLOW = 14;
4177 RESOLV_TIMEOUT = 255;
4178 EAI_MAX = 256;
4179 }
4180 optional ReturnCode return_code = 2;
4181
4182 // The latency period(in microseconds) it took for this DNS lookup to complete.
4183 optional int32 latency_micros = 3;
4184}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004185
4186/**
4187 * Logs when a data stall event occurs.
4188 *
4189 * Log from:
4190 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4191 */
4192message DataStallEvent {
4193 // Data stall evaluation type.
4194 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4195 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4196 optional int32 evaluation_type = 1;
4197 // See definition in data_stall_event.proto.
4198 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4199 // See definition in data_stall_event.proto.
4200 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4201 // See definition in data_stall_event.proto.
4202 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4203 // See definition in data_stall_event.proto.
4204 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4205 // See definition in data_stall_event.proto.
4206 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4207}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004208
4209/*
4210 * Logs when RescueParty resets some set of experiment flags.
4211 *
4212 * Logged from:
4213 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4214 */
4215message RescuePartyResetReported {
4216 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4217 optional int32 rescue_level = 1;
4218}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004219
4220/**
4221 * Logs when signed config is received from an APK, and if that config was applied successfully.
4222 * Logged from:
4223 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4224 */
4225message SignedConfigReported {
4226 enum Type {
4227 UNKNOWN_TYPE = 0;
4228 GLOBAL_SETTINGS = 1;
4229 }
4230 optional Type type = 1;
4231
4232 // The final status of the signed config received.
4233 enum Status {
4234 UNKNOWN_STATUS = 0;
4235 APPLIED = 1;
4236 BASE64_FAILURE_CONFIG = 2;
4237 BASE64_FAILURE_SIGNATURE = 3;
4238 SECURITY_EXCEPTION = 4;
4239 INVALID_CONFIG = 5;
4240 OLD_CONFIG = 6;
4241 SIGNATURE_CHECK_FAILED = 7;
4242 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004243 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004244 }
4245 optional Status status = 2;
4246
4247 // The version of the signed config processed.
4248 optional int32 version = 3;
4249
4250 // The package name that the config was extracted from.
4251 optional string from_package = 4;
4252
4253 enum Key {
4254 NO_KEY = 0;
4255 DEBUG = 1;
4256 PRODUCTION = 2;
4257 }
4258 // Which key was used to verify the config.
4259 optional Key verified_with = 5;
4260}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004261
4262/*
4263 * Logs GNSS Network-Initiated (NI) location events.
4264 *
4265 * Logged from:
4266 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4267 */
4268message GnssNiEventReported {
4269 // The type of GnssNiEvent.
4270 enum EventType {
4271 UNKNOWN = 0;
4272 NI_REQUEST = 1;
4273 NI_RESPONSE = 2;
4274 }
4275 optional EventType event_type = 1;
4276
4277 // An ID generated by HAL to associate NI notifications and UI responses.
4278 optional int32 notification_id = 2;
4279
4280 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004281 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004282
4283 // NI requires notification.
4284 optional bool need_notify = 4;
4285
4286 // NI requires verification.
4287 optional bool need_verify = 5;
4288
4289 // NI requires privacy override, no notification/minimal trace.
4290 optional bool privacy_override = 6;
4291
4292 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4293 // seconds.
4294 optional int32 timeout = 7;
4295
4296 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004297 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004298
4299 // String representing the requester of the network inititated location request.
4300 optional string requestor_id = 9;
4301
4302 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4303 // network initiated location request.
4304 optional string text = 10;
4305
4306 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004307 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004308
4309 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004310 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004311
4312 // True if SUPL ES is enabled.
4313 optional bool is_supl_es_enabled = 13;
4314
4315 // True if GNSS location is enabled.
4316 optional bool is_location_enabled = 14;
4317
4318 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004319 optional android.server.location.GnssUserResponseType user_response = 15;
4320}
4321
4322/**
4323 * Logs GNSS non-framework (NFW) location notification.
4324 *
4325 * Logged from:
4326 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4327 */
4328message GnssNfwNotificationReported {
4329 // Package name of the Android proxy application representing the non-framework entity that
4330 // requested location. Set to empty string if unknown.
4331 optional string proxy_app_package_name = 1;
4332
4333 // Protocol stack that initiated the non-framework location request.
4334 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4335
4336 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4337 // set to empty string. This field is opaque to the framework and used for logging purposes.
4338 optional string other_protocol_stack_name = 3;
4339
4340 // Source initiating/receiving the location information.
4341 optional android.server.location.NfwRequestor requestor = 4;
4342
4343 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4344 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4345 // and used for logging purposes.
4346 optional string requestor_id = 5;
4347
4348 // Indicates whether location information was provided for this request.
4349 optional android.server.location.NfwResponseType response_type = 6;
4350
4351 // True if the device is in user initiated emergency session.
4352 optional bool in_emergency_mode = 7;
4353
4354 // True if cached location is provided.
4355 optional bool is_cached_location = 8;
4356
4357 // True if proxy app permission mismatch between framework and GNSS HAL.
4358 optional bool is_permission_mismatched = 9;
4359}
4360
4361/**
4362 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4363 *
4364 * Logged from:
4365 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4366 */
4367message GnssConfigurationReported {
4368 // SUPL host name.
4369 optional string supl_host = 1;
4370
4371 // SUPL port number.
4372 optional int32 supl_port = 2;
4373
4374 // C2K host name.
4375 optional string c2k_host = 3;
4376
4377 // C2K port number.
4378 optional int32 c2k_port = 4;
4379
4380 // The SUPL version requested by Carrier.
4381 optional int32 supl_ver = 5;
4382
4383 // The SUPL mode.
4384 optional android.server.location.SuplMode supl_mode = 6;
4385
4386 // True if NI emergency SUPL restrictions is enabled.
4387 optional bool supl_es = 7;
4388
4389 // LTE Positioning Profile settings
4390 optional android.server.location.LppProfile lpp_profile = 8;
4391
4392 // Positioning protocol on A-Glonass system.
4393 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4394
4395 // True if emergency PDN is used. Otherwise, regular PDN is used.
4396 optional bool use_emergency_pdn_for_emergency_supl= 10;
4397
4398 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4399 optional android.server.location.GpsLock gps_lock = 11;
4400
4401 // Number of seconds to extend the emergency session duration post emergency call.
4402 optional int32 es_extension_sec = 12;
4403
4404 // The full list of package names of proxy Android applications representing the non-framework
4405 // location access entities (on/off the device) for which the framework user has granted
4406 // non-framework location access permission. The package names are concatenated in one string
4407 // with spaces as separators.
4408 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004409}
Jack Yu95b64f32018-12-13 18:26:11 +08004410
4411/**
4412 * Logs when a NFC device's error occurred.
4413 * Logged from:
4414 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4415 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
4416 */
4417message NfcErrorOccurred {
4418 enum Type {
4419 UNKNOWN = 0;
4420 CMD_TIMEOUT = 1;
4421 ERROR_NOTIFICATION = 2;
4422 AID_OVERFLOW = 3;
4423 }
4424 optional Type type = 1;
4425 // If it's nci cmd timeout, log the timeout command.
4426 optional uint32 nci_cmd = 2;
4427
4428 optional uint32 error_ntf_status_code = 3;
4429}
4430
4431/**
4432 * Logs when a NFC device's state changed event
4433 * Logged from:
4434 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
4435 */
4436message NfcStateChanged {
4437 enum State {
4438 UNKNOWN = 0;
4439 OFF = 1;
4440 ON = 2;
4441 ON_LOCKED = 3; // Secure Nfc enabled.
4442 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
4443 }
4444 optional State state = 1;
4445}
4446
4447/**
4448 * Logs when a NFC Beam Transaction occurred.
4449 * Logged from:
4450 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
4451 */
4452message NfcBeamOccurred {
4453 enum Operation {
4454 UNKNOWN = 0;
4455 SEND = 1;
4456 RECEIVE = 2;
4457 }
4458 optional Operation operation = 1;
4459}
4460
4461/**
4462 * Logs when a NFC Card Emulation Transaction occurred.
4463 * Logged from:
4464 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
4465 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
4466 */
4467message NfcCardemulationOccurred {
4468 enum Category {
4469 UNKNOWN = 0;
4470 HCE_PAYMENT = 1;
4471 HCE_OTHER = 2;
4472 OFFHOST = 3;
4473 }
4474 // Transaction belongs to HCE payment or HCE other category, or offhost.
4475 optional Category category = 1;
4476 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
4477 optional string se_name = 2;
4478}
4479
4480/**
4481 * Logs when a NFC Tag event occurred.
4482 * Logged from:
4483 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
4484 */
4485message NfcTagOccurred {
4486 enum Type {
4487 UNKNOWN = 0;
4488 URL = 1;
4489 BT_PAIRING = 2;
4490 PROVISION = 3;
4491 WIFI_CONNECT = 4;
4492 APP_LAUNCH = 5;
4493 OTHERS = 6;
4494 }
4495 optional Type type = 1;
4496}
4497
4498/**
4499 * Logs when Hce transaction triggered
4500 * Logged from:
4501 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4502 */
4503message NfcHceTransactionOccurred {
4504 // The latency period(in microseconds) it took for the first HCE data
4505 // exchange.
4506 optional uint32 latency_micros = 1;
4507}
4508
4509/**
4510 * Logs when SecureElement state event changed
4511 * Logged from:
4512 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4513 */
4514message SeStateChanged {
4515 enum State {
4516 UNKNOWN = 0;
4517 INITIALIZED = 1;
4518 DISCONNECTED = 2;
4519 CONNECTED = 3;
4520 HALCRASH = 4;
4521 }
4522 optional State state = 1;
4523
4524 optional string state_change_reason = 2;
4525 // SIMx or eSEx.
4526 optional string terminal = 3;
4527}
4528
4529/**
4530 * Logs when Omapi API used
4531 * Logged from:
4532 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4533 */
4534message SeOmapiReported {
4535 enum Operation {
4536 UNKNOWN = 0;
4537 OPEN_CHANNEL = 1;
4538 }
4539 optional Operation operation = 1;
4540 // SIMx or eSEx.
4541 optional string terminal = 2;
4542
Jack Yu4bb90eb2019-01-23 15:13:41 +08004543 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08004544}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004545
4546/**
Alex Saloa060aee2019-01-21 14:36:41 -08004547 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
4548 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004549 * Logged from:
4550 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
4551 */
4552message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08004553 optional int64 dispatch_latency_millis = 1;
4554}
4555
4556/**
4557 * Logs AttentionManagerService attention check result.
4558 *
4559 * Logged from:
4560 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
4561 */
4562message AttentionManagerServiceResultReported {
4563 // See core/java/android/service/attention/AttentionService.java
4564 enum AttentionCheckResult {
4565 UNKNOWN = 20;
4566 ATTENTION_SUCCESS_ABSENT = 0;
4567 ATTENTION_SUCCESS_PRESENT = 1;
4568 ATTENTION_FAILURE_PREEMPTED = 2;
4569 ATTENTION_FAILURE_TIMED_OUT = 3;
4570 ATTENTION_FAILURE_UNKNOWN = 4;
4571 }
4572 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004573}
Michael Groover9e7b06e2018-12-28 19:55:51 -08004574
4575/**
4576 * Logs when an adb connection changes state.
4577 *
4578 * Logged from:
4579 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
4580 */
4581message AdbConnectionChanged {
4582 // The last time this system connected via adb, or 0 if the 'always allow' option was not
4583 // previously selected for this system.
4584 optional int64 last_connection_time_millis = 1;
4585
4586 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
4587 // to reconnect via adb without user interaction.
4588 optional int64 auth_window_millis = 2;
4589
4590 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
4591 optional android.debug.AdbConnectionStateEnum state = 3;
4592
4593 // True if the 'always allow' option was selected for this system.
4594 optional bool always_allow = 4;
4595}
Carter Hsub8fd1e92019-01-11 15:24:45 +08004596
4597/*
4598 * Logs the reported speech DSP status.
4599 *
4600 * Logged from:
4601 * Vendor audio implementation.
4602 */
4603message SpeechDspStatReported {
4604 // The total Speech DSP uptime in milliseconds.
4605 optional int32 total_uptime_millis = 1;
4606 // The total Speech DSP downtime in milliseconds.
4607 optional int32 total_downtime_millis = 2;
4608 optional int32 total_crash_count = 3;
4609 optional int32 total_recover_count = 4;
4610}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08004611
4612/**
4613 * Logs USB connector contaminant status.
4614 *
4615 * Logged from: USB Service.
4616 */
4617message UsbContaminantReported {
4618 optional string id = 1;
4619 optional android.service.usb.ContaminantPresenceStatus status = 2;
4620}
Olivier Gaillard18d452202019-01-22 15:03:41 +00004621
4622/**
4623 * This atom is for debugging purpose.
4624 */
4625message DebugElapsedClock {
4626 // Monotically increasing value for each pull.
4627 optional int64 pull_count = 1;
4628 // Time from System.elapsedRealtime.
4629 optional int64 elapsed_clock_millis = 2;
4630 // Time from System.elapsedRealtime.
4631 optional int64 same_elapsed_clock_millis = 3;
4632 // Diff between current elapsed time and elapsed time from previous pull.
4633 optional int64 elapsed_clock_diff_millis = 4;
4634
4635 enum Type {
4636 TYPE_UNKNOWN = 0;
4637 ALWAYS_PRESENT = 1;
4638 PRESENT_ON_ODD_PULLS = 2;
4639 }
4640 // Type of behavior for the pulled data.
4641 optional Type type = 5;
4642}
4643
4644/**
4645 * This atom is for debugging purpose.
4646 */
4647message DebugFailingElapsedClock {
4648 // Monotically increasing value for each pull.
4649 optional int64 pull_count = 1;
4650 // Time from System.elapsedRealtime.
4651 optional int64 elapsed_clock_millis = 2;
4652 // Time from System.elapsedRealtime.
4653 optional int64 same_elapsed_clock_millis = 3;
4654 // Diff between current elapsed time and elapsed time from previous pull.
4655 optional int64 elapsed_clock_diff_millis = 4;
4656}
Steven Wuacef6bb2019-01-23 14:21:17 -05004657
4658/** Logs System UI bubbles event changed.
4659 *
4660 * Logged from:
4661 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
4662 */
4663message BubbleUIChanged {
4664
4665 // The app package that is posting the bubble.
4666 optional string package_name = 1;
4667
4668 // The notification channel that is posting the bubble.
4669 optional string notification_channel = 2;
4670
4671 // The notification id associated with the posted bubble.
4672 optional int32 notification_id = 3;
4673
4674 // The position of the bubble within the bubble stack.
4675 optional int32 position = 4;
4676
4677 // The total number of bubbles within the bubble stack.
4678 optional int32 total_number = 5;
4679
4680 // User interactions with the bubble.
4681 enum Action {
4682 UNKNOWN = 0;
4683 POSTED = 1;
4684 UPDATED = 2;
4685 EXPANDED = 3;
4686 COLLAPSED = 4;
4687 DISMISSED = 5;
4688 STACK_DISMISSED = 6;
4689 STACK_MOVED = 7;
4690 HEADER_GO_TO_APP = 8;
4691 HEADER_GO_TO_SETTINGS = 9;
4692 PERMISSION_OPT_IN = 10;
4693 PERMISSION_OPT_OUT = 11;
4694 PERMISSION_IGNORED = 12;
4695 SWIPE_LEFT = 13;
4696 SWIPE_RIGHT = 14;
4697 }
4698 optional Action action = 6;
4699
4700 // Normalized screen position of the bubble stack. The range is between 0 and 1.
4701 optional float normalized_x_position = 7;
4702 optional float normalized_y_position = 8;
4703}
Kweku Adams8845d012018-12-11 20:06:45 -08004704
4705/**
4706 * Logs that a constraint for a scheduled job has changed.
4707 *
4708 * Logged from:
4709 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
4710 */
4711message ScheduledJobConstraintChanged {
4712 repeated AttributionNode attribution_node = 1;
4713
4714 // Name of the job.
4715 optional string job_name = 2;
4716
4717 optional com.android.server.job.ConstraintEnum constraint = 3;
4718
4719 enum State {
4720 UNSATISFIED = 0;
4721 SATISFIED = 1;
4722 }
4723 optional State state = 4;
4724}