blob: 8642715708b61d39f0c63d5c11f23362487613ee [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";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080031import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080032import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080033import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080034import "frameworks/base/core/proto/android/server/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080035import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070036import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080037import "frameworks/base/core/proto/android/service/usb.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070038import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080039import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070040import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080041import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080042import "frameworks/base/core/proto/android/telephony/enums.proto";
43import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000044import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
45import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080046
Yao Chend54f9dd2017-10-17 17:37:48 +000047/**
Stefan Lafonae2df012017-11-14 09:17:21 -080048 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000049 * raw stats log events from the Android system, also known as "atoms."
50 *
51 * This field contains a single oneof with all of the available messages.
52 * The stats-log-api-gen tool runs as part of the Android build and
53 * generates the android.util.StatsLog class, which contains the constants
54 * and methods that Android uses to log.
55 *
Stefan Lafonae2df012017-11-14 09:17:21 -080056 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000057 * Instead, statsd on Android constructs these messages synthetically,
58 * in the format defined here and in stats_log.proto.
59 */
Stefan Lafonae2df012017-11-14 09:17:21 -080060message Atom {
61 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070062 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070063 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
64 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070065 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070066 BleScanResultReceived ble_scan_result_received = 4;
67 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080068 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070069 SyncStateChanged sync_state_changed = 7;
70 ScheduledJobStateChanged scheduled_job_state_changed = 8;
71 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070072 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080073 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
74 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
75 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070076 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
77 MemoryFactorStateChanged memory_factor_state_changed = 15;
78 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
79 CachedKillReported cached_kill_reported = 17;
80 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070081 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080082 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
83 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
84 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070085 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080086 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070087 CameraStateChanged camera_state_changed = 25;
88 FlashlightStateChanged flashlight_state_changed = 26;
89 UidProcessStateChanged uid_process_state_changed = 27;
90 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
91 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070092 BatteryLevelChanged battery_level_changed = 30;
93 ChargingStateChanged charging_state_changed = 31;
94 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070095 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -080096 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -070097 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
98 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070099 WifiLockStateChanged wifi_lock_state_changed = 37;
100 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
101 WifiScanStateChanged wifi_scan_state_changed = 39;
102 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700103 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700104 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700105 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900106 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700107 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800108 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800109 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800110 AppStartOccurred app_start_occurred = 48;
111 AppStartCanceled app_start_canceled = 49;
112 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800113 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800114 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800115 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800116 LmkStateChanged lmk_state_changed = 54;
117 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800118 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800119 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800120 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800121 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800122 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800123 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800124 KeyguardStateChanged keyguard_state_changed = 62;
125 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
126 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800127 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800128 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800129 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
130 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800131 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700132 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800133 SpeakerImpedanceReported speaker_impedance_reported = 71;
134 HardwareFailed hardware_failed = 72;
135 PhysicalDropDetected physical_drop_detected = 73;
136 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800137 MobileConnectionStateChanged mobile_connection_state_changed = 75;
138 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700139 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800140 AppCrashOccurred app_crash_occurred = 78;
141 ANROccurred anr_occurred = 79;
142 WTFOccurred wtf_occurred = 80;
143 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700144 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700145 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700146 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700147 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700148 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700149 FingerprintAcquired fingerprint_acquired = 87;
150 FingerprintAuthenticated fingerprint_authenticated = 88;
151 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700152 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700153 BatteryHealthSnapshot battery_health_snapshot = 91;
154 SlowIo slow_io = 92;
155 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700156 PhoneServiceStateChanged phone_service_state_changed = 94;
157 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100158 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700159 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700160 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700161 // TODO: service state change is very noisy shortly after boot, as well
162 // as at other transitions - coming out of doze, device plugged in, etc.
163 // Consider removing this if it becomes a problem
164 ServiceStateChanged service_state_changed = 99;
165 ServiceLaunchReported service_launch_reported = 100;
Yangster-macb89807e2018-11-15 21:10:57 -0800166 PhenotypeFlagStateChanged phenotype_flag_state_changed = 101;
167 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000168 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800169 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
170 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
171 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
172 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
173 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
174 DocsUILaunchReported docs_ui_launch_reported = 109;
175 DocsUIRootVisitedReported docs_ui_root_visited = 110;
176 DocsUIStartupMsReported docs_ui_startup_ms = 111;
177 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800178 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
179 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000180 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800181 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800182 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
183 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
184 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
185 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800186 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000187 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000188 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800189 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800190 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800191 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
192 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000193 AppDowngraded app_downgraded = 128;
194 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
195 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800196 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
197 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800198 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800199 NfcErrorOccurred nfc_error_occurred = 134;
200 NfcStateChanged nfc_state_changed = 135;
201 NfcBeamOccurred nfc_beam_occurred = 136;
202 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
203 NfcTagOccurred nfc_tag_occurred = 138;
204 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
205 SeStateChanged se_state_changed = 140;
206 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800207 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800208 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800209 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800210 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800211 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800212 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Yao Chend54f9dd2017-10-17 17:37:48 +0000213 }
David Chenc8a43242017-10-17 16:23:28 -0700214
David Chen6e3e6cb2018-01-03 16:14:06 -0800215 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000216 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700217 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800218 WifiBytesTransfer wifi_bytes_transfer = 10000;
219 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
220 MobileBytesTransfer mobile_bytes_transfer = 10002;
221 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800222 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800223 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800224 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800225 CpuTimePerFreq cpu_time_per_freq = 10008;
226 CpuTimePerUid cpu_time_per_uid = 10009;
227 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800228 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800229 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800230 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800231 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800232 SystemElapsedRealtime system_elapsed_realtime = 10014;
233 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800234 CpuActiveTime cpu_active_time = 10016;
235 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000236 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800237 RemainingBatteryCapacity remaining_battery_capacity = 10019;
238 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800239 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100240 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100241 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100242 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000243 DiskStats disk_stats = 10025;
244 DirectoryUsage directory_usage = 10026;
245 AppSize app_size = 10027;
246 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700247 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700248 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700249 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700250 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700251 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800252 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700253 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100254 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100255 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700256 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800257 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
258 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
259 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000260 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800261 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800262 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800263 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000264 DebugElapsedClock debug_elapsed_clock = 10046;
265 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
David Chenc8a43242017-10-17 16:23:28 -0700266 }
yroa1fe77c2018-02-26 14:22:54 -0800267
Bookatz76aafcf2018-09-17 16:17:10 -0700268 // DO NOT USE field numbers above 100,000 in AOSP.
269 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
270 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700271}
272
Yao Chend54f9dd2017-10-17 17:37:48 +0000273/**
Yangster-mac20877162017-12-22 17:19:39 -0800274 * This proto represents a node of an attribution chain.
275 * Note: All attribution chains are represented as a repeated field of type
276 * AttributionNode. It is understood that in such arrays, the order is that
277 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000278 */
Yangster-mac20877162017-12-22 17:19:39 -0800279message AttributionNode {
280 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800281 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800282
Yangster-mac20877162017-12-22 17:19:39 -0800283 // The (optional) string tag for an element in the attribution chain. If the
284 // element has no tag, it is encoded as an empty string.
285 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700286}
287
Yangster-mac48b3d622018-08-18 12:38:11 -0700288message KeyValuePair {
289 optional int32 key = 1;
290 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700291 int32 value_int = 2;
292 int64 value_long = 3;
293 string value_str = 4;
294 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700295 }
296}
297
298message KeyValuePairsAtom {
299 optional int32 uid = 1;
300 repeated KeyValuePair pairs = 2;
301}
302
Yao Chend54f9dd2017-10-17 17:37:48 +0000303/*
304 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800305 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000306 *
307 * RULES:
308 * - The field ids for each atom must start at 1, and count upwards by 1.
309 * Skipping field ids is not allowed.
310 * - These form an API, so renaming, renumbering or removing fields is
311 * not allowed between android releases. (This is not currently enforced,
312 * but there will be a tool to enforce this restriction).
313 * - The types must be built-in protocol buffer types, namely, no sub-messages
314 * are allowed (yet). The bytes type is also not allowed.
315 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800316 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000317 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800318 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000319 * - A field that is a uid should be a string field, tagged with the [xxx]
320 * annotation. The generated code on android will be represented by UIDs,
321 * and those UIDs will be translated in xxx to those strings.
322 *
323 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700324 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000325 * - If there is a UID, it goes first. Think in an object-oriented fashion.
326 * *****************************************************************************
327 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700328
Yao Chend54f9dd2017-10-17 17:37:48 +0000329/**
Yangster-mace16189a2018-08-26 12:20:16 -0700330 * Logs when the Thermal service HAL notifies the throttling start/stop events.
331 *
332 * Logged from:
333 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
334 */
335message ThermalThrottlingStateChanged {
336 optional android.os.TemperatureTypeEnum sensor_type = 1;
337
338 enum State {
339 UNKNOWN = 0;
340 START = 1;
341 STOP = 2;
342 }
343
344 optional State state = 2;
345
346 optional float temperature = 3;
347}
348
349/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000350 * Logs when the screen state changes.
351 *
352 * Logged from:
353 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
354 */
355message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800356 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700357 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700358}
Yao Chend54f9dd2017-10-17 17:37:48 +0000359
360/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700361 * Logs that the process state of the uid, as determined by ActivityManager
362 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000363 *
364 * Logged from:
365 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
366 */
Bookatzc1a050a2017-10-10 15:49:28 -0700367message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700368 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000369
Bookatzdb026a22018-01-10 19:01:56 -0800370 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700371 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000372}
373
374/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700375 * Logs process state change of a process, as per the activity manager.
376 *
377 * Logged from:
378 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
379 */
380message ProcessStateChanged {
381 optional int32 uid = 1;
382 optional string process_name = 2;
383 optional string package_name = 3;
384 // TODO: remove this when validation is done
385 optional int64 version = 5;
386 // The state, from frameworks/base/core/proto/android/app/enums.proto.
387 optional android.app.ProcessStateEnum state = 4;
388}
389
390/**
391 * Logs when ActivityManagerService sleep state is changed.
392 *
393 * Logged from:
394 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
395 */
396message ActivityManagerSleepStateChanged {
397 // TODO: import frameworks proto
398 enum State {
399 UNKNOWN = 0;
400 ASLEEP = 1;
401 AWAKE = 2;
402 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700403 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700404}
405
406/**
407 * Logs when system memory state changes.
408 *
409 * Logged from:
410 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
411 */
412message MemoryFactorStateChanged {
413 // TODO: import frameworks proto
414 enum State {
415 MEMORY_UNKNOWN = 0;
416 NORMAL = 1; // normal.
417 MODERATE = 2; // moderate memory pressure.
418 LOW = 3; // low memory.
419 CRITICAL = 4; // critical memory.
420
421 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700422 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700423}
424
425/**
426 * Logs when app is using too much cpu, according to ActivityManagerService.
427 *
428 * Logged from:
429 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
430 */
431message ExcessiveCpuUsageReported {
432 optional int32 uid = 1;
433 optional string process_name = 2;
434 optional string package_name = 3;
435 // package version. TODO: remove this when validation is done
436 optional int64 version = 4;
437}
438
439/**
440 * Logs when a cached process is killed, along with its pss.
441 *
442 * Logged from:
443 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
444 */
445message CachedKillReported {
446 optional int32 uid = 1;
447 optional string process_name = 2;
448 optional string package_name = 3;
449 // TODO: remove this when validation is done
450 optional int64 version = 5;
451 optional int64 pss = 4;
452}
453
454/**
455 * Logs when memory stats of a process is reported.
456 *
457 * Logged from:
458 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
459 */
460message ProcessMemoryStatReported {
461 optional int32 uid = 1;
462 optional string process_name = 2;
463 optional string package_name = 3;
464 //TODO: remove this when validation is done
465 optional int64 version = 9;
466 optional int64 pss = 4;
467 optional int64 uss = 5;
468 optional int64 rss = 6;
469 enum Type {
470 ADD_PSS_INTERNAL_SINGLE = 0;
471 ADD_PSS_INTERNAL_ALL_MEM = 1;
472 ADD_PSS_INTERNAL_ALL_POLL = 2;
473 ADD_PSS_EXTERNAL = 3;
474 ADD_PSS_EXTERNAL_SLOW = 4;
475 }
476 optional Type type = 7;
477 optional int64 duration = 8;
478}
479
480/**
Bookatzc1a050a2017-10-10 15:49:28 -0700481 * Logs that a process started, finished, crashed, or ANRed.
482 *
483 * Logged from:
484 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
485 */
486message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700487 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700488
David Chen0b5c90c2018-01-25 16:51:49 -0800489 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800490 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700491
Bookatzddccf0a2017-11-28 16:48:14 -0800492 // What lifecycle state the process changed to.
493 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800494 enum State {
495 FINISHED = 0;
496 STARTED = 1;
497 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800498 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800499 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700500}
501
Bookatzc1a050a2017-10-10 15:49:28 -0700502/**
503 * Logs when the ble scan state changes.
504 *
505 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700506 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700507 */
508message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800509 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700510
511 enum State {
512 OFF = 0;
513 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700514 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
515 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700516 }
517 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700518
Bookatze5ec0b42018-03-26 13:34:56 -0700519 // Does the scan have a filter.
520 optional bool is_filtered = 3;
521 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
522 optional bool is_first_match = 4;
523 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
524 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700525}
526
527/**
528 * Logs reporting of a ble scan finding results.
529 *
530 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700531 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700532 */
Bookatzae6738e2018-09-13 11:38:56 -0700533// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700534message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800535 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700536
537 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800538 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700539}
540
541/**
542 * Logs when a sensor state changes.
543 *
544 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700545 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700546 */
547message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800548 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700549
Bookatzc1a050a2017-10-10 15:49:28 -0700550 // The id (int) of the sensor.
551 optional int32 sensor_id = 2;
552
553 enum State {
554 OFF = 0;
555 ON = 1;
556 }
557 optional State state = 3;
558}
559
Bookatzc1a050a2017-10-10 15:49:28 -0700560/**
561 * Logs when GPS state changes.
562 *
563 * Logged from:
564 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
565 */
566message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800567 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700568
569 enum State {
570 OFF = 0;
571 ON = 1;
572 }
573 optional State state = 2;
574}
575
Bookatz48d362e2018-11-06 15:49:08 -0800576/**
577 * Logs when GPS signal quality.
578 *
579 * Logged from:
580 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
581 */
582message GpsSignalQualityChanged {
583 optional android.server.location.GpsSignalQualityEnum level = 1;
584}
585
Bookatzc1a050a2017-10-10 15:49:28 -0700586
587/**
588 * Logs when a sync manager sync state changes.
589 *
590 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700591 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700592 */
593message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800594 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700595
David Chen0b5c90c2018-01-25 16:51:49 -0800596 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800597 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700598
599 enum State {
600 OFF = 0;
601 ON = 1;
602 }
603 optional State state = 3;
604}
605
Yangster-mac96353002018-09-05 11:18:55 -0700606/*
607 * Deferred job stats.
608 *
609 * Logged from:
610 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
611*/
612message DeferredJobStatsReported {
613 repeated AttributionNode attribution_node = 1;
614
615 // Number of jobs deferred.
616 optional int32 num_jobs_deferred = 2;
617
618 // Time since the last job runs.
619 optional int64 time_since_last_job_millis = 3;
620}
621
Bookatzc1a050a2017-10-10 15:49:28 -0700622/**
623 * Logs when a job scheduler job state changes.
624 *
625 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700626 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700627 */
628message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800629 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700630
631 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800632 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700633
634 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800635 FINISHED = 0;
636 STARTED = 1;
637 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700638 }
639 optional State state = 3;
640
Tej Singh33a412b2018-03-16 18:43:59 -0700641 // The reason a job has stopped.
642 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700643 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700644 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700645}
646
647/**
648 * Logs when the audio state changes.
649 *
650 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700651 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700652 */
653message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800654 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700655
656 enum State {
657 OFF = 0;
658 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700659 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
660 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700661 }
662 optional State state = 2;
663}
664
665/**
666 * Logs when the video codec state changes.
667 *
668 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700669 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700670 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800671message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800672 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700673
674 enum State {
675 OFF = 0;
676 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700677 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
678 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700679 }
680 optional State state = 2;
681}
682
683/**
684 * Logs when the flashlight state changes.
685 *
686 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700687 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700688 */
689message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800690 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700691
692 enum State {
693 OFF = 0;
694 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700695 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
696 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700697 }
698 optional State state = 2;
699}
700
701/**
702 * Logs when the camera state changes.
703 *
704 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700705 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700706 */
707message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800708 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700709
710 enum State {
711 OFF = 0;
712 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700713 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
714 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700715 }
716 optional State state = 2;
717}
718
719/**
720 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000721 *
722 * Logged from:
723 * TODO
724 */
Bookatzd6746242017-10-24 18:39:35 -0700725message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800726 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000727
Bookatz1a1b0462018-01-12 11:47:03 -0800728 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
729 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700730 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700731
732 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
733 optional string tag = 3;
734
735 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800736 RELEASE = 0;
737 ACQUIRE = 1;
738 CHANGE_RELEASE = 2;
739 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700740 }
741 optional State state = 4;
742}
743
744/**
Bookatzc1a050a2017-10-10 15:49:28 -0700745 * Logs when a partial wakelock is considered 'long' (over 1 min).
746 *
747 * Logged from:
748 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
749 */
750message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800751 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700752
Yao Chend54f9dd2017-10-17 17:37:48 +0000753 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
754 optional string tag = 2;
755
Bookatzc1a050a2017-10-10 15:49:28 -0700756 // TODO: I have no idea what this is.
757 optional string history_tag = 3;
758
759 enum State {
760 OFF = 0;
761 ON = 1;
762 }
763 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000764}
765
Bookatzc1a050a2017-10-10 15:49:28 -0700766/**
Bookatza66083f2018-09-20 17:24:00 -0700767 * Logs when the device is interactive, according to the PowerManager Notifier.
768 *
769 * Logged from:
770 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
771 */
772message InteractiveStateChanged {
773 enum State {
774 OFF = 0;
775 ON = 1;
776 }
777 optional State state = 1;
778}
779
780/**
Bookatzc1a050a2017-10-10 15:49:28 -0700781 * Logs Battery Saver state change.
782 *
783 * Logged from:
784 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
785 */
786message BatterySaverModeStateChanged {
787 enum State {
788 OFF = 0;
789 ON = 1;
790 }
791 optional State state = 1;
792}
793
794/**
795 * Logs Doze mode state change.
796 *
797 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800798 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700799 */
800message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800801 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800802}
803
804
805/**
806 * Logs state change of Doze mode including maintenance windows.
807 *
808 * Logged from:
809 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
810 */
811message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800812 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700813}
814
815/**
816 * Logs screen brightness level.
817 *
818 * Logged from:
819 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
820 */
821message ScreenBrightnessChanged {
822 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
823 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700824}
825
826/**
827 * Logs battery level (percent full, from 0 to 100).
828 *
829 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700830 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700831 */
832message BatteryLevelChanged {
833 // Battery level. Should be in [0, 100].
834 optional int32 battery_level = 1;
835}
836
837/**
838 * Logs change in charging status of the device.
839 *
840 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700841 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700842 */
843message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800844 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
845 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700846}
847
848/**
849 * Logs whether the device is plugged in, and what power source it is using.
850 *
851 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700852 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700853 */
854message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800855 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
856 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700857}
858
Bookatz8c6571b2017-10-24 15:04:41 -0700859/**
860 * Logs when an app's wakeup alarm fires.
861 *
862 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700863 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700864 */
865message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800866 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800867
868 // Name of the wakeup alarm.
869 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700870
871 // Name of source package (for historical reasons, since BatteryStats tracked it).
872 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800873}
874
875/**
876 * Logs when an an app causes the mobile radio to change state.
877 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
878 *
879 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700880 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800881 */
882message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800883 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800884
Bookatz1a1b0462018-01-12 11:47:03 -0800885 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
886 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800887}
888
889/**
890 * Logs when an an app causes the wifi radio to change state.
891 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
892 *
893 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700894 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800895 */
896message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800897 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800898
Bookatz1a1b0462018-01-12 11:47:03 -0800899 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
900 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700901}
902
903/**
904 * Logs kernel wakeup reasons and aborts.
905 *
906 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700907 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700908 */
909message KernelWakeupReported {
910 // Name of the kernel wakeup reason (or abort).
911 optional string wakeup_reason_name = 1;
912
913 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800914 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700915}
916
917/**
Bookatzda1798c2018-12-13 14:16:00 -0800918 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800919 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800920 *
921 * Logged from:
922 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
923 */
924message WifiEnabledStateChanged {
925 enum State {
926 OFF = 0;
927 ON = 1;
928 }
929 optional State state = 1;
930}
931
932/**
933 * 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 -0800934 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
935 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800936 *
937 * Logged from:
938 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
939 */
940message WifiRunningStateChanged {
941 repeated AttributionNode attribution_node = 1;
942
943 enum State {
944 OFF = 0;
945 ON = 1;
946 }
947 optional State state = 2;
948}
949
950/**
Bookatze5885242017-10-24 20:10:31 -0700951 * Logs wifi locks held by an app.
952 *
953 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700954 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700955 */
956message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800957 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700958
959 enum State {
960 OFF = 0;
961 ON = 1;
962 }
963 optional State state = 2;
964}
965
966/**
967 * Logs wifi signal strength changes.
968 *
969 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800970 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700971 */
972message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800973 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
974 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700975}
976
977/**
978 * Logs wifi scans performed by an app.
979 *
980 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800981 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700982 */
983message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800984 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700985
986 enum State {
987 OFF = 0;
988 ON = 1;
989 }
990 optional State state = 2;
991}
992
993/**
Tej Singh4503e102018-01-04 14:35:01 -0800994 * Logs wifi multicast locks held by an app
995 *
996 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800997 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -0800998 */
999message WifiMulticastLockStateChanged {
1000 repeated AttributionNode attribution_node = 1;
1001
1002 enum State {
1003 OFF = 0;
1004 ON = 1;
1005 }
1006 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001007
1008 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001009}
1010
1011/**
Tej Singh1ea42892018-01-19 09:27:00 -08001012 * Logs shutdown reason and duration on next boot.
1013 *
1014 * Logged from:
1015 * frameworks/base/core/java/com/android/server/BootReceiver.java
1016 */
1017message ShutdownSequenceReported {
1018 // True if shutdown is for a reboot. Default: false if we do not know.
1019 optional bool reboot = 1;
1020
1021 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1022 optional string reason = 2;
1023
1024 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1025 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001026 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001027
1028 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001029 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001030}
1031
Tej Singh6483ea42018-01-25 17:45:49 -08001032
1033/**
1034 * Logs boot reason and duration.
1035 *
1036 * Logged from:
1037 * system/core/bootstat/bootstat.cpp
1038 */
1039message BootSequenceReported {
1040 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1041 // Default: "<EMPTY>" if not available.
1042 optional string bootloader_reason = 1;
1043
1044 // Reason for system boot. Eg. bootloader, reboot,userrequested
1045 // Default: "<EMPTY>" if not available.
1046 optional string system_reason = 2;
1047
1048 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001049 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001050
1051 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001052 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001053
1054 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001055 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001056
1057 // Time since last boot in ms. Default: 0 if not available.
1058 optional int64 time_since_last_boot = 6;
1059}
1060
Tej Singhc477d9c2018-02-05 18:31:39 -08001061
1062/**
1063 * Logs call state and disconnect cause (if applicable).
1064 *
1065 * Logged from:
1066 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1067 */
1068message CallStateChanged {
1069 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1070 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1071 optional android.telecom.CallStateEnum call_state = 1;
1072
1073 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1074 // This value is only applicable when the call_state is DISCONNECTED, and
1075 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1076 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1077 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1078
1079 // True if the call is self-managed, which are apps that use the
1080 // telecom infrastructure to make their own calls.
1081 optional bool self_managed = 3;
1082
1083 // True if call is external. External calls are calls on connected Wear
1084 // devices but show up in Telecom so the user can pull them onto the device.
1085 optional bool external_call = 4;
1086}
1087
Tej Singh1ea42892018-01-19 09:27:00 -08001088/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001089 * Logs keyguard state. The keyguard is the lock screen.
1090 *
1091 * Logged from:
1092 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1093 */
1094message KeyguardStateChanged {
1095 enum State {
1096 UNKNOWN = 0;
1097 // The keyguard is hidden when the phone is unlocked.
1098 HIDDEN = 1;
1099 // The keyguard is shown when the phone is locked (screen turns off).
1100 SHOWN= 2;
1101 // The keyguard is occluded when something is overlaying the keyguard.
1102 // Eg. Opening the camera while on the lock screen.
1103 OCCLUDED = 3;
1104 }
1105 optional State state = 1;
1106}
1107
1108/**
1109 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1110 * prompts the user to enter a password (pattern, pin, etc).
1111 *
1112 * Logged from:
1113 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1114 */
1115
1116message KeyguardBouncerStateChanged {
1117 enum State {
1118 UNKNOWN = 0;
1119 // Bouncer is hidden, either as a result of successfully entering the
1120 // password, screen timing out, or user going back to lock screen.
1121 HIDDEN = 1;
1122 // This is when the user is being prompted to enter the password.
1123 SHOWN = 2;
1124 }
1125 optional State state = 1;
1126}
1127
1128/**
1129 * Logs the result of entering a password into the keyguard bouncer.
1130 *
1131 * Logged from:
1132 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1133 */
1134message KeyguardBouncerPasswordEntered {
1135 enum BouncerResult {
1136 UNKNOWN = 0;
1137 // The password entered was incorrect.
1138 FAILURE = 1;
1139 // The password entered was correct.
1140 SUCCESS = 2;
1141 }
1142 optional BouncerResult result = 1;
1143}
1144
Tej Singha883b372018-02-15 11:30:01 -08001145/*
1146 * Logs changes to the configuration of the device. The configuration is defined
1147 * in frameworks/base/core/java/android/content/res/Configuration.java
1148 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1149 * Please go there to interpret the possible values each field can be.
1150 *
1151 * Logged from:
1152 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1153 */
1154message ResourceConfigurationChanged {
1155 // Bit mask of color capabilities of the screen.
1156 // Contains information about the color gamut and hdr mode of the screen.
1157 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001158 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001159
1160 // The target screen density being rendered to.
1161 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001162 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001163
1164 // Current user preference for the scaling factor for fonts,
1165 // relative to the base density scaling.
1166 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001167 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001168
1169 // Flag indicating whether the hard keyboard is hidden.
1170 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001171 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001172
1173 // The type of keyboard attached to the device.
1174 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1175 optional int32 keyboard = 5;
1176
1177 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1178 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001179 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001180
1181 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1182 // 0 if undefined.
1183 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1184 optional int32 mcc = 7;
1185
1186 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1187 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1188 // MNC_ZERO symbol defined in Configuration.java.
1189 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1190 optional int32 mnc = 8;
1191
1192 // The kind of navigation available on the device.
1193 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1194 optional int32 navigation = 9;
1195
1196 // Flag indicating whether the navigation is available.
1197 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001198 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001199
1200 // Overall orientation of the screen.
1201 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1202 optional int32 orientation = 11;
1203
1204 // The current height of the available screen space, in dp units.
1205 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001206 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001207
1208 // Bit mask of overall layout of the screen.
1209 // Contains information about screen size, whether the screen is wider/taller
1210 // than normal, whether the screen layout is right-tl-left or left-to-right,
1211 // and whether the screen has a rounded shape.
1212 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001213 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001214
1215 // Current width of the available screen space, in dp units.
1216 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001217 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001218
1219 // The smallest screen size an application will see in normal operation.
1220 // This is the smallest value of both screenWidthDp and screenHeightDp
1221 // in portrait and landscape.
1222 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001223 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001224
1225 // The type of touch screen attached to the device.
1226 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1227 optional int32 touchscreen = 16;
1228
1229 // Bit mask of the ui mode.
1230 // Contains information about the overall ui mode of the device.
1231 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1232 // Also contains information about whether the device is in night mode.
1233 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001234 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001235}
1236
Tej Singheee317b2018-03-07 19:28:05 -08001237
1238/**
1239 * Logs changes in the connection state of the mobile radio.
1240 *
1241 * Logged from:
1242 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1243 */
1244message MobileConnectionStateChanged {
1245 // States are from the state machine DataConnection.java.
1246 enum State {
1247 UNKNOWN = 0;
1248 // The connection is inactive, or disconnected.
1249 INACTIVE = 1;
1250 // The connection is being activated, or connecting.
1251 ACTIVATING = 2;
1252 // The connection is active, or connected.
1253 ACTIVE = 3;
1254 // The connection is disconnecting.
1255 DISCONNECTING = 4;
1256 // The connection is disconnecting after creating a connection.
1257 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1258 }
1259 optional State state = 1;
1260 // For multi-sim phones, this distinguishes between the sim cards.
1261 optional int32 sim_slot_index = 2;
1262 // Used to identify the connection. Starts at 0 and increments by 1 for
1263 // every new network created. Resets whenever the device reboots.
1264 optional int32 data_connection_id = 3;
1265 // A bitmask for the capabilities of this connection.
1266 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1267 // Default value (if we have no information): 0
1268 optional int64 capabilities = 4;
1269 // If this connection has internet.
1270 // This just checks if the DEFAULT bit of capabilities is set.
1271 optional bool has_internet = 5;
1272}
1273
1274/**
1275 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1276 *
1277 * Logged from:
1278 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1279 */
1280message MobileRadioTechnologyChanged {
1281 optional android.telephony.NetworkTypeEnum state = 1;
1282 // For multi-sim phones, this distinguishes between the sim cards.
1283 optional int32 sim_slot_index = 2;
1284}
1285
Andrew Chantb56388b2018-03-22 21:07:33 -07001286/**
1287 * Logs the VID and PID of any connected USB devices.
1288 *
1289 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1290 *
1291 * Logged by Vendor.
1292 */
1293message UsbDeviceAttached {
1294 optional int32 vid = 1;
1295 optional int32 pid = 2;
1296 optional bool has_audio = 3;
1297 optional bool has_hid = 4;
1298 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001299 enum State {
1300 STATE_DISCONNECTED = 0;
1301 STATE_CONNECTED = 1;
1302 }
1303 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001304 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001305}
1306
Tej Singheee317b2018-03-07 19:28:05 -08001307
Tej Singhdd7bd352018-02-09 19:33:15 -08001308/**
Tej Singh5d991e12018-03-09 19:48:11 -08001309 * Logs when Bluetooth is enabled and disabled.
1310 *
1311 * Logged from:
1312 * services/core/java/com/android/server/BluetoothManagerService.java
1313 */
1314message BluetoothEnabledStateChanged {
1315 repeated AttributionNode attribution_node = 1;
1316 // Whether or not bluetooth is enabled on the device.
1317 enum State {
1318 UNKNOWN = 0;
1319 ENABLED = 1;
1320 DISABLED = 2;
1321 }
1322 optional State state = 2;
1323 // The reason for being enabled/disabled.
1324 // Eg. Airplane mode, crash, application request.
1325 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1326 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001327 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001328}
1329
1330/**
Jack Hed9837c82019-01-09 01:19:13 -08001331 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001332 *
1333 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001334 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1335 *
1336 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001337 */
1338message BluetoothConnectionStateChanged {
1339 // The state of the connection.
1340 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1341 optional android.bluetooth.ConnectionStateEnum state = 1;
1342 // An identifier that can be used to match connect and disconnect events.
1343 // Currently is last two bytes of a hash of a device level ID and
1344 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001345 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1346 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001347 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1348 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001349 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001350 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001351 // An identifier that can be used to match events for this device.
1352 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1353 // Salt: Randomly generated 256 bit value
1354 // Hash algorithm: HMAC-SHA256
1355 // Size: 32 byte
1356 // Default: null or empty if the device identifier is not known
1357 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1358}
1359
1360/**
1361 * Logs when a Bluetooth device connects and disconnects over ACL
1362 *
1363 * Logged from:
1364 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1365 *
1366 * Next Tag: 3
1367 */
1368message BluetoothAclConnectionStateChanged {
1369 // An identifier that can be used to match events for this device.
1370 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1371 // Salt: Randomly generated 256 bit value
1372 // Hash algorithm: HMAC-SHA256
1373 // Size: 32 byte
1374 // Default: null or empty if the device identifier is not known
1375 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1376 // The state of the connection.
1377 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1378 optional android.bluetooth.ConnectionStateEnum state = 2;
1379}
1380
1381/**
1382 * Logs when a Bluetooth device connects and disconnects over SCO
1383 *
1384 * Logged from:
1385 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1386 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1387 *
1388 * Next Tag: 4
1389 */
1390message BluetoothScoConnectionStateChanged {
1391 // An identifier that can be used to match events for this device.
1392 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1393 // Salt: Randomly generated 256 bit value
1394 // Hash algorithm: HMAC-SHA256
1395 // Size: 32 byte
1396 // Default: null or empty if the device identifier is not known
1397 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1398 // The state of the connection.
1399 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1400 optional android.bluetooth.ConnectionStateEnum state = 2;
1401 // Codec used for this SCO connection
1402 // Default: UNKNOWN
1403 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001404}
1405
Jack Heab86dbd22018-12-18 15:43:27 -08001406// Logs when there is an event affecting Bluetooth device's link layer connection.
1407// - This event is triggered when there is a related HCI command or event
1408// - Users of this metrics can deduce Bluetooth device's connection state from these events
1409// - HCI commands are logged before the command is sent, after receiving command status, and after
1410// receiving command complete
1411// - HCI events are logged when they arrive
1412//
1413// Low level log from system/bt
1414//
1415// Bluetooth classic commands:
1416// - CMD_CREATE_CONNECTION
1417// - CMD_DISCONNECT
1418// - CMD_CREATE_CONNECTION_CANCEL
1419// - CMD_ACCEPT_CONNECTION_REQUEST
1420// - CMD_REJECT_CONNECTION_REQUEST
1421// - CMD_SETUP_ESCO_CONNECTION
1422// - CMD_ACCEPT_ESCO_CONNECTION
1423// - CMD_REJECT_ESCO_CONNECTION
1424// - CMD_ENH_SETUP_ESCO_CONNECTION
1425// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1426//
1427// Bluetooth low energy commands:
1428// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1429// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1430// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1431// - CMD_BLE_CLEAR_WHITE_LIST
1432// - CMD_BLE_ADD_WHITE_LIST
1433// - CMD_BLE_REMOVE_WHITE_LIST
1434//
1435// Bluetooth classic events:
1436// - EVT_CONNECTION_COMP
1437// - EVT_CONNECTION_REQUEST
1438// - EVT_DISCONNECTION_COMP
1439// - EVT_ESCO_CONNECTION_COMP
1440// - EVT_ESCO_CONNECTION_CHANGED
1441//
1442// Bluetooth low energy meta events:
1443// - BLE_EVT_CONN_COMPLETE_EVT
1444// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1445//
1446// Next tag: 10
1447message BluetoothLinkLayerConnectionEvent {
1448 // An identifier that can be used to match events for this device.
1449 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1450 // Salt: Randomly generated 256 bit value
1451 // Hash algorithm: HMAC-SHA256
1452 // Size: 32 byte
1453 // Default: null or empty if the device identifier is not known
1454 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1455 // Connection handle of this connection if available
1456 // Range: 0x0000 - 0x0EFF (12 bits)
1457 // Default: 0xFFFF if the handle is unknown
1458 optional int32 connection_handle = 2;
1459 // Direction of the link
1460 // Default: DIRECTION_UNKNOWN
1461 optional android.bluetooth.DirectionEnum direction = 3;
1462 // Type of this link
1463 // Default: LINK_TYPE_UNKNOWN
1464 optional android.bluetooth.LinkTypeEnum type = 4;
1465
1466 // Reason metadata for this link layer connection event, rules for interpretation:
1467 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1468 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1469 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1470 // set and valid, ignore hci_ble_event
1471
1472 // HCI command associated with this event
1473 // Default: CMD_UNKNOWN
1474 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1475 // HCI event associated with this event
1476 // Default: EVT_UNKNOWN
1477 optional android.bluetooth.hci.EventEnum hci_event = 6;
1478 // HCI BLE meta event associated with this event
1479 // Default: BLE_EVT_UNKNOWN
1480 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1481 // HCI command status code if this is triggerred by hci_cmd
1482 // Default: STATUS_UNKNOWN
1483 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1484 // HCI reason code associated with this event
1485 // Default: STATUS_UNKNOWN
1486 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1487}
1488
Howard Roe103fe22019-01-17 16:52:16 -08001489/**
1490 * Logs when a module is rolled back by Watchdog.
1491 *
1492 * Logged from: Rollback Manager
1493 */
1494message WatchdogRollbackOccurred {
1495 enum RollbackType {
1496 UNKNOWN = 0;
1497 ROLLBACK_INITIATE = 1;
1498 ROLLBACK_SUCCESS = 2;
1499 ROLLBACK_FAILURE = 3;
1500 }
1501 optional RollbackType rollback_type = 1;
1502
1503 optional string package_name = 2;
1504
1505 optional int32 package_version_code = 3;
1506}
1507
Jack Heab86dbd22018-12-18 15:43:27 -08001508
Tej Singh5d991e12018-03-09 19:48:11 -08001509/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001510 * Logs when something is plugged into or removed from the USB-C connector.
1511 *
1512 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001513 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001514 */
1515message UsbConnectorStateChanged {
1516 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001517 STATE_DISCONNECTED = 0;
1518 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001519 }
1520 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001521 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001522 // Last active session in ms.
1523 // 0 when the port is in connected state.
1524 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001525}
1526
1527/**
1528 * Logs the reported speaker impedance.
1529 *
1530 * Logged from:
1531 * Vendor audio implementation.
1532 */
1533message SpeakerImpedanceReported {
1534 optional int32 speaker_location = 1;
1535 optional int32 impedance = 2;
1536}
1537
1538/**
1539 * Logs the report of a failed hardware.
1540 *
1541 * Logged from:
1542 * Vendor HALs.
1543 *
1544 */
1545message HardwareFailed {
1546 enum HardwareType {
1547 HARDWARE_FAILED_UNKNOWN = 0;
1548 HARDWARE_FAILED_MICROPHONE = 1;
1549 HARDWARE_FAILED_CODEC = 2;
1550 HARDWARE_FAILED_SPEAKER = 3;
1551 HARDWARE_FAILED_FINGERPRINT = 4;
1552 }
1553 optional HardwareType hardware_type = 1;
1554
1555 /* hardware_location allows vendors to differentiate between multiple instances of
1556 * the same hardware_type. The specific locations are vendor defined integers,
1557 * referring to board-specific numbering schemes.
1558 */
1559 optional int32 hardware_location = 2;
1560
1561 /* failure_code is specific to the HardwareType of the failed hardware.
1562 * It should use the enum values defined below.
1563 */
1564 enum MicrophoneFailureCode {
1565 MICROPHONE_FAILURE_COMPLETE = 0;
1566 }
1567 enum CodecFailureCode {
1568 CODEC_FAILURE_COMPLETE = 0;
1569 }
1570 enum SpeakerFailureCode {
1571 SPEAKER_FAILURE_COMPLETE = 0;
1572 SPEAKER_FAILURE_HIGH_Z = 1;
1573 SPEAKER_FAILURE_SHORT = 2;
1574 }
1575 enum FingerprintFailureCode {
1576 FINGERPRINT_FAILURE_COMPLETE = 0;
1577 FINGERPRINT_SENSOR_BROKEN = 1;
1578 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1579 }
1580 optional int32 failure_code = 3;
1581}
1582
1583/**
1584 * Log an event when the device has been physically dropped.
1585 * Reported from the /vendor partition.
1586 */
1587message PhysicalDropDetected {
1588 // Confidence that the event was actually a drop, 0 -> 100
1589 optional int32 confidence_pctg = 1;
1590 // Peak acceleration of the drop, in 1/1000s of a g.
1591 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001592 // Duration of freefall in ms
1593 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001594}
1595
1596/**
1597 * Log bucketed battery charge cycles.
1598 *
1599 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001600 * a given charge point. For example, if 10 cycle buckets are
1601 * initialized, bucket 1 is the lowest 1/10th of the battery,
1602 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001603 *
1604 * Logged from:
1605 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1606 */
1607message ChargeCyclesReported {
1608 optional int32 cycle_bucket_1 = 1;
1609 optional int32 cycle_bucket_2 = 2;
1610 optional int32 cycle_bucket_3 = 3;
1611 optional int32 cycle_bucket_4 = 4;
1612 optional int32 cycle_bucket_5 = 5;
1613 optional int32 cycle_bucket_6 = 6;
1614 optional int32 cycle_bucket_7 = 7;
1615 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001616 optional int32 cycle_bucket_9 = 9;
1617 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001618}
1619
1620/**
Howard Roa46b6582018-09-18 16:45:02 -07001621 * Log battery health snapshot.
1622 *
1623 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1624 * are snapshotted periodically over 24hrs.
1625 */
1626message BatteryHealthSnapshot {
1627 enum BatterySnapshotType {
1628 UNKNOWN = 0;
1629 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1630 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1631 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1632 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1633 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1634 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1635 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1636 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1637 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1638 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1639 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1640 }
1641 optional BatterySnapshotType type = 1;
1642 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001643 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001644 // Voltage Battery Voltage, in microVolts.
1645 optional int32 voltage_micro_volt = 3;
1646 // Current Battery current, in microAmps.
1647 optional int32 current_micro_amps = 4;
1648 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1649 optional int32 open_circuit_micro_volt = 5;
1650 // Resistance Battery Resistance, in microOhms.
1651 optional int32 resistance_micro_ohm = 6;
1652 // Level Battery Level, as % of full.
1653 optional int32 level_percent = 7;
1654}
1655
1656/**
1657 * Log slow I/O operations on the primary storage.
1658 */
1659message SlowIo {
1660 // Classifications of IO Operations.
1661 enum IoOperation {
1662 UNKNOWN = 0;
1663 READ = 1;
1664 WRITE = 2;
1665 UNMAP = 3;
1666 SYNC = 4;
1667 }
1668 optional IoOperation operation = 1;
1669
1670 // The number of slow IO operations of this type over 24 hours.
1671 optional int32 count = 2;
1672}
1673
1674/**
1675 * Log battery caused shutdown with the last recorded voltage.
1676 */
1677message BatteryCausedShutdown {
1678 // The last recorded battery voltage prior to shutdown.
1679 optional int32 last_recorded_micro_volt = 1;
1680}
1681
1682/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001683 * Logs the duration of a davey (jank of >=700ms) when it occurs
1684 *
1685 * Logged from:
1686 * frameworks/base/libs/hwui/JankTracker.cpp
1687 */
1688message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001689 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001690 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001691
Tej Singhbb8554a2018-01-26 11:59:14 -08001692 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001693 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001694}
1695
1696/**
Bookatze5885242017-10-24 20:10:31 -07001697 * Logs phone signal strength changes.
1698 *
1699 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001700 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001701 */
1702message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001703 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1704 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001705}
1706
Yangster4ccebea2018-10-09 17:09:02 -07001707
1708/**
1709 * Logs when the phone state, sim state or signal strength changes
1710 *
1711 * Logged from:
1712 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1713 */
1714message PhoneServiceStateChanged {
1715 optional android.telephony.ServiceStateEnum state = 1;
1716 optional android.telephony.SimStateEnum sim_state = 2;
1717 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1718}
1719
1720/**
1721 * Logs when the phone becomes on or off.
1722 *
1723 * Logged from:
1724 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1725 */
1726message PhoneStateChanged {
1727 enum State {
1728 OFF = 0;
1729 ON = 1;
1730 }
1731 optional State state = 1;
1732}
1733
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001734message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001735 optional android.stats.launcher.LauncherAction action = 1;
1736 optional android.stats.launcher.LauncherState src_state = 2;
1737 optional android.stats.launcher.LauncherState dst_state = 3;
1738 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001739 optional bool is_swipe_up_enabled = 5;
1740}
1741
David Chenc28b2bb2017-10-24 12:52:52 -07001742/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001743 * Logs when Settings UI has changed.
1744 *
1745 * Logged from:
1746 * packages/apps/Settings
1747 */
1748message SettingsUIChanged {
1749 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001750 * Where this SettingsUIChange event comes from. For example, if
1751 * it's a PAGE_VISIBLE event, where the page is opened from.
1752 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001753 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001754
1755 /**
1756 * What the UI action is.
1757 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001758 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001759
1760 /**
1761 * Where the action is happening
1762 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001763 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001764
1765 /**
1766 * What preference changed in this event.
1767 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001768 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001769
1770 /**
1771 * The new value of the changed preference.
1772 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001773 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001774}
1775
1776/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08001777 * Logs basic timing information about touch events.
1778 * Reported at most every 5 minutes while device is being interacted with.
1779 *
1780 * Logged from:
1781 * frameworks/native/services/inputflinger
1782 */
1783message TouchEventReported {
1784 /**
1785 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
1786 * and the standard deviation of latency between the kernel and framework
1787 * for touchscreen events. The units are microseconds.
1788 *
1789 * The number is measured as the difference between the time at which
1790 * the input event was received in the evdev driver,
1791 * and the time at which the input event was received in EventHub.
1792 */
1793 // Minimum value
1794 optional float latency_min_micros = 1;
1795 // Maximum value
1796 optional float latency_max_micros = 2;
1797 // Average value
1798 optional float latency_mean_micros = 3;
1799 // Standard deviation
1800 optional float latency_stdev_micros = 4;
1801}
1802
1803/**
David Chenc28b2bb2017-10-24 12:52:52 -07001804 * Logs that a setting was updated.
1805 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001806 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001807 * The tag and is_default allow resetting of settings to default values based on the specified
1808 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1809 */
1810message SettingChanged {
1811 // The name of the setting.
1812 optional string setting = 1;
1813
1814 // The change being imposed on this setting. May represent a number, eg "3".
1815 optional string value = 2;
1816
1817 // The new value of this setting. For most settings, this is same as value. For some settings,
1818 // value is +X or -X where X represents an element in a set. For example, if the previous value
1819 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1820 // The +/- feature is currently only used for location_providers_allowed.
1821 optional string new_value = 3;
1822
1823 // The previous value of this setting.
1824 optional string prev_value = 4;
1825
1826 // The tag used with the is_default for resetting sets of settings. This is generally null.
1827 optional string tag = 5;
1828
Bookatz90867622018-01-31 15:05:57 -08001829 // True if this setting with tag should be resettable.
1830 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001831
David Chenbd789912018-03-16 17:19:55 -07001832 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001833 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001834
1835 enum ChangeReason {
1836 UPDATED = 1; // Updated can be an insertion or an update.
1837 DELETED = 2;
1838 }
1839 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001840}
Chenjie Yub3dda412017-10-24 13:41:59 -07001841
Chenjie Yu05013b32017-11-21 10:21:41 -08001842/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001843 * Logs activity going to foreground or background
1844 *
1845 * Logged from:
1846 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1847 */
1848message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001849 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001850 optional string pkg_name = 2;
1851 optional string class_name = 3;
1852
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001853 enum State {
1854 BACKGROUND = 0;
1855 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001856 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001857 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001858}
David Chenc8a43242017-10-17 16:23:28 -07001859
1860/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00001861 * Logs when a volume entered low Storage state.
1862 * Logged from:
1863 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
1864 */
1865message LowStorageStateChanged {
1866 // Volume that ran out of storage.
1867 optional string volume_description = 1;
1868
1869 enum State {
1870 UNKNOWN = 0;
1871 OFF = 1;
1872 ON = 2;
1873 }
1874 optional State state = 2;
1875}
1876
1877/**
1878 * Logs when an app is downgraded.
1879 * Logged from:
1880 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1881 */
1882message AppDowngraded {
1883 optional string package_name = 1;
1884 // Size of the package (all data) before being downgraded.
1885 optional int64 size_in_bytes_before = 2;
1886 // Size of the package (all data) after being downgraded.
1887 optional int64 size_in_bytes_after = 3;
1888
1889 optional bool aggressive = 4;
1890}
1891
1892/**
1893 * Logs when an app is optimized after being downgraded.
1894 * Logged from:
1895 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1896 */
1897message AppOptimizedAfterDowngraded {
1898 optional string package_name = 1;
1899}
1900
1901/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001902 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001903 * Logged from:
1904 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1905 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001906message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001907 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001908
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001909 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001910
1911 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001912 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001913 optional string process_name = 3;
1914
1915 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001916 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001917
1918 optional string package_name = 5;
1919
1920 enum InstantApp {
1921 UNAVAILABLE = 0;
1922 FALSE = 1;
1923 TRUE = 2;
1924 }
1925 optional InstantApp is_instant_app = 6;
1926
1927 enum ForegroundState {
1928 UNKNOWN = 0;
1929 BACKGROUND = 1;
1930 FOREGROUND = 2;
1931 }
1932 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001933
1934 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001935}
David Chen9e3808c2017-11-20 17:25:34 -08001936
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001937/**
1938 * Logs when a WTF (What a Terrible Failure) happened.
1939 * Logged from:
1940 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1941 */
1942message WTFOccurred {
1943 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001944
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001945 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001946
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001947 // The name of the process.
1948 // system_server if it is not by an app
1949 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001950
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001951 // The pid if available. -1 means not available.
1952 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001953
1954 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001955}
1956
1957/**
1958 * Logs when system server reports low memory.
1959 * Logged from:
1960 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1961 */
1962message LowMemReported {
1963}
1964
1965/**
1966 * Logs when an app ANR (App Not Responding) occurs.
1967 * Logged from:
1968 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1969 */
1970message ANROccurred {
1971 optional int32 uid = 1 [(is_uid) = true];
1972
1973 optional string process_name = 2;
1974
1975 optional string short_component_name = 3;
1976
1977 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001978
1979 enum InstantApp {
1980 UNAVAILABLE = 0;
1981 FALSE = 1;
1982 TRUE = 2;
1983 }
1984 optional InstantApp is_instant_app = 5;
1985
1986 enum ForegroundState {
1987 UNKNOWN = 0;
1988 BACKGROUND = 1;
1989 FOREGROUND = 2;
1990 }
1991 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001992
1993 optional android.server.ErrorSource error_source = 7;
1994
1995 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001996}
1997
Bookatza7020bd2018-08-28 16:29:35 -07001998/**
1999 * Logs when the vibrator state changes.
2000 * Logged from:
2001 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2002 */
2003message VibratorStateChanged {
2004 repeated AttributionNode attribution_node = 1;
2005
2006 enum State {
2007 OFF = 0;
2008 ON = 1;
2009 }
2010 optional State state = 2;
2011
2012 // Duration (in milliseconds) requested to keep the vibrator on.
2013 // Only applicable for State == ON.
2014 optional int64 duration_millis = 3;
2015}
2016
David Chen0a368b22017-12-06 16:28:16 -08002017/*
2018 * Allows other apps to push events into statsd.
2019 * Logged from:
2020 * frameworks/base/core/java/android/util/StatsLog.java
2021 */
David Chen0b5c90c2018-01-25 16:51:49 -08002022message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002023 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002024 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002025
2026 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2027 optional int32 label = 2;
2028
2029 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2030 // predicates for the metrics).
2031 enum State {
2032 UNKNOWN = 0;
2033 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2034 STOP = 2;
2035 START = 3;
2036 }
2037 optional State state = 3;
2038}
2039
David Chen9e3808c2017-11-20 17:25:34 -08002040/**
Bookatz7948c872018-09-04 12:58:33 -07002041 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2042 * For example, this could be due to the user manually changing the time.
2043 *
2044 * Logged from:
2045 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2046 */
2047message WallClockTimeShifted {
2048 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2049 optional int64 wall_clock_timestamp_millis = 1;
2050}
2051
2052/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002053 * Logs when statsd detects an anomaly.
2054 *
2055 * Logged from:
2056 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2057 */
2058message AnomalyDetected {
2059 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002060 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002061
Yangster-mac94e197c2018-01-02 16:03:03 -08002062 // Id of the config whose anomaly detection alert fired.
2063 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002064
Yangster-mac94e197c2018-01-02 16:03:03 -08002065 // Id of the alert (i.e. name of the anomaly that was detected).
2066 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002067}
2068
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002069message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002070 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002071 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002072
2073 // The app package name.
2074 optional string pkg_name = 2;
2075
2076 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002077 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002078 WARM = 1;
2079 HOT = 2;
2080 COLD = 3;
2081 }
2082 // The transition type.
2083 optional TransitionType type = 3;
2084
2085 // The activity name.
2086 optional string activity_name = 4;
2087
2088 // The name of the calling app. Empty if not set.
2089 optional string calling_pkg_name = 5;
2090
2091 // Whether the app is an instant app.
2092 optional bool is_instant_app = 6;
2093
2094 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002095 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002096
Bookatz80d11a02018-01-16 10:46:35 -08002097 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002098
David Chen0b5c90c2018-01-25 16:51:49 -08002099 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002100 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002101 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002102 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002103 optional int32 bind_application_delay_millis = 11;
2104 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002105
2106 // Empty if not set.
2107 optional string launch_token = 13;
2108
Calin Juravle759fbda2018-02-20 19:52:30 +00002109 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002110 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002111
2112 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002113 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002114}
2115
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002116message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002117 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002118 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002119
2120 // The app package name.
2121 optional string pkg_name = 2;
2122
2123 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002124 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002125 WARM = 1;
2126 HOT = 2;
2127 COLD = 3;
2128 }
2129 // The transition type.
2130 optional TransitionType type = 3;
2131
2132 // The activity name.
2133 optional string activity_name = 4;
2134}
2135
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002136message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002137 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002138 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002139
2140 // The app package name.
2141 optional string pkg_name = 2;
2142
2143 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002144 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002145 WITH_BUNDLE = 1;
2146 WITHOUT_BUNDLE = 2;
2147 }
2148 // The transition type.
2149 optional TransitionType type = 3;
2150
2151 // The activity name.
2152 optional string activity_name = 4;
2153
2154 optional bool transition_process_running = 5;
2155
2156 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002157 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002158}
2159
Bookatz8fcd09a2017-12-18 13:01:10 -08002160/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002161 * Logs a picture-in-picture action
2162 * Logged from:
2163 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2164 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2165 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2166 */
2167message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002168 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002169 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002170
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002171 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002172
Chenjie Yu52cacc62017-12-08 18:11:45 -08002173 enum State {
2174 ENTERED = 1;
2175 EXPANDED_TO_FULL_SCREEN = 2;
2176 MINIMIZED = 3;
2177 DISMISSED = 4;
2178 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002179 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002180}
2181
2182/**
Chenjie Yue8904192017-12-08 19:12:57 -08002183 * Logs overlay action
2184 * Logged from:
2185 * services/core/java/com/android/server/wm/Session.java
2186 */
2187message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002188 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002189
2190 optional string package_name = 2;
2191
2192 optional bool using_alert_window = 3;
2193
2194 enum State {
2195 ENTERED = 1;
2196 EXITED = 2;
2197 }
2198 optional State state = 4;
2199}
2200
Chenjie Yuccfe6452018-01-30 11:33:21 -08002201/*
2202 * Logs foreground service starts and stops.
2203 * Note that this is not when a service starts or stops, but when it is
2204 * considered foreground.
2205 * Logged from
2206 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2207 */
2208message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002209 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002210 // package_name + "/" + class_name
2211 optional string short_name = 2;
2212
2213 enum State {
2214 ENTER = 1;
2215 EXIT = 2;
2216 }
2217 optional State state = 3;
2218}
2219
Chenjie Yue8904192017-12-08 19:12:57 -08002220/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002221 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2222 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2223 * attributed back to the parent (host) uid. One example is Chrome.
2224 *
2225 * Logged from:
2226 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2227 */
2228message IsolatedUidChanged {
2229 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002230 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002231 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002232 optional int32 parent_uid = 1;
2233
2234 optional int32 isolated_uid = 2;
2235
2236 // We expect an isolated uid to be removed before if it's used for another parent uid.
2237 enum Event {
2238 REMOVED = 0;
2239 CREATED = 1;
2240 }
2241 optional Event event = 3;
2242}
2243
2244/*
2245 * Logs the reception of an incoming network packet causing the main system to wake up for
2246 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2247 * and processed by WakeupController.cpp.
2248 */
2249message PacketWakeupOccurred {
2250 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2251 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002252 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002253 // The interface name on which the packet was received.
2254 optional string iface = 2;
2255 // The ethertype value of the packet.
2256 optional int32 ethertype = 3;
2257 // String representation of the destination MAC address of the packet.
2258 optional string destination_hardware_address = 4;
2259 // String representation of the source address of the packet if this was an IP packet.
2260 optional string source_ip = 5;
2261 // String representation of the destination address of the packet if this was an IP packet.
2262 optional string destination_ip = 6;
2263 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2264 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2265 // families.
2266 optional int32 ip_next_header = 7;
2267 // The source port if this was a TCP or UDP packet.
2268 optional int32 source_port = 8;
2269 // The destination port if this was a TCP or UDP packet.
2270 optional int32 destination_port = 9;
2271}
2272
2273/*
2274 * Logs the memory stats for an app on startup.
2275 * Logged from:
2276 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2277 */
2278message AppStartMemoryStateCaptured {
2279 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002280 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002281
2282 // The process name.
2283 optional string process_name = 2;
2284
2285 // The activity name.
2286 optional string activity_name = 3;
2287
2288 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002289 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002290
2291 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002292 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002293
2294 // RSS
2295 optional int64 rss_in_bytes = 6;
2296
2297 // CACHE
2298 optional int64 cache_in_bytes = 7;
2299
2300 // SWAP
2301 optional int64 swap_in_bytes = 8;
2302}
2303
2304/*
2305 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2306 * for LMK event.
2307 * Logged from:
2308 * system/core/lmkd/lmkd.c
2309 */
2310message LmkStateChanged {
2311 enum State {
2312 UNKNOWN = 0;
2313 START = 1;
2314 STOP = 2;
2315 }
2316 optional State state = 1;
2317}
2318
2319/*
2320 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2321 * Logged from:
2322 * system/core/lmkd/lmkd.c
2323 */
2324message LmkKillOccurred {
2325 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002326 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002327
2328 // The process name.
2329 optional string process_name = 2;
2330
2331 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002332 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002333
2334 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002335 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002336
2337 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002338 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002339
2340 // RSS
2341 optional int64 rss_in_bytes = 6;
2342
2343 // CACHE
2344 optional int64 cache_in_bytes = 7;
2345
2346 // SWAP
2347 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002348
2349 // The elapsed real time of start of the process.
2350 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002351}
2352
Rajeev Kumar51b54602018-03-01 12:18:26 -08002353/*
2354 * Logs when the ActivityManagerService detects that an app died.
2355 *
2356 * Logged from:
2357 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2358 */
2359message AppDied {
2360 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002361 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002362}
2363
Howard Ro21a039c2018-08-06 14:55:47 -07002364/**
2365 * An atom for generic metrics logging. Available from Android Q.
2366 */
2367message GenericAtom {
2368 // The uid of the application that sent this custom atom.
2369 optional int32 uid = 1 [(is_uid) = true];
2370
2371 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002372 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002373}
2374
Tej Singhd6d6d772018-09-05 17:41:25 -07002375/**
2376 * Logs when a fingerprint acquire event occurs.
2377 *
2378 * Logged from:
2379 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2380 */
2381message FingerprintAcquired {
2382 // The associated user. Eg: 0 for owners, 10+ for others.
2383 // Defined in android/os/UserHandle.java
2384 optional int32 user = 1;
2385 // If this acquire is for a crypto fingerprint.
2386 // e.g. Secure purchases, unlock password storage.
2387 optional bool is_crypto = 2;
2388}
2389
2390/**
2391 * Logs when a fingerprint authentication event occurs.
2392 *
2393 * Logged from:
2394 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2395 */
2396message FingerprintAuthenticated {
2397 // The associated user. Eg: 0 for owners, 10+ for others.
2398 // Defined in android/os/UserHandle.java
2399 optional int32 user = 1;
2400 // If this authentication is for a crypto fingerprint.
2401 // e.g. Secure purchases, unlock password storage.
2402 optional bool is_crypto = 2;
2403 // Whether or not this authentication was successful.
2404 optional bool is_authenticated = 3;
2405}
2406
2407/**
2408 * Logs when a fingerprint error occurs.
2409 *
2410 * Logged from:
2411 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2412 */
2413message FingerprintErrorOccurred {
2414 // The associated user. Eg: 0 for owners, 10+ for others.
2415 // Defined in android/os/UserHandle.java
2416 optional int32 user = 1;
2417 // If this error is for a crypto fingerprint.
2418 // e.g. Secure purchases, unlock password storage.
2419 optional bool is_crypto = 2;
2420
2421 enum Error {
2422 UNKNOWN = 0;
2423 LOCKOUT = 1;
2424 PERMANENT_LOCKOUT = 2;
2425 }
2426 // The type of error.
2427 optional Error error = 3;
2428}
Howard Ro688ae182018-09-25 00:09:36 -07002429
2430message Notification {
2431
2432 // Type of notification event.
2433 enum Type {
2434 TYPE_UNKNOWN = 0;
2435 // Notification became visible to the user.
2436 TYPE_OPEN = 1;
2437 // Notification became hidden.
2438 TYPE_CLOSE = 2;
2439 // Notification switched to detail mode.
2440 TYPE_DETAIL = 3;
2441 // Notification was clicked.
2442 TYPE_ACTION = 4;
2443 // Notification was dismissed.
2444 TYPE_DISMISS = 5;
2445 // Notification switched to summary mode. The enum value of 14 is to
2446 // match that of metrics_constants.
2447 TYPE_COLLAPSE = 14;
2448 }
2449 optional Type type = 1;
2450
2451 // Package name associated with the notification.
2452 optional string package_name = 2;
2453
2454 // Tag associated with notification.
2455 optional string tag = 3;
2456
2457 // Application-supplied ID associated with the notification.
2458 optional int32 id = 4;
2459
2460 // Index of notification in the notification panel.
2461 optional int32 shade_index = 5;
2462
2463 // The number of notifications in the notification panel.
2464 optional int32 shade_count = 6;
2465
2466 // Importance for the notification.
2467 optional int32 importance = 7;
2468
2469 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002470 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002471
2472 // Importance for the notification channel.
2473 optional int32 channel_importance = 9;
2474
Howard Ro183c2bd2018-10-18 13:52:10 -07002475 // Application-supplied ID associated with the notifications group.
2476 optional string group_id = 10;
2477
Howard Ro688ae182018-09-25 00:09:36 -07002478 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002479 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002480
Howard Ro183c2bd2018-10-18 13:52:10 -07002481 // Reason for dismissal of a notification. This field is only meaningful for
2482 // TYPE_DISMISS events.
2483 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002484
Howard Ro183c2bd2018-10-18 13:52:10 -07002485 // The first post time of notification, stable across updates.
2486 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002487
Howard Ro183c2bd2018-10-18 13:52:10 -07002488 // The most recent interruption time, or the creation time if no updates.
2489 // Differs from update_millis because updates are filtered based on whether
2490 // they actually interrupted the user.
2491 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002492
Howard Ro183c2bd2018-10-18 13:52:10 -07002493 // The most recent update time, or the creation time if no updates.
2494 optional int64 update_millis = 15;
2495
2496 // The most recent visibility event.
2497 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002498}
2499
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002500/*
Yangster-macb89807e2018-11-15 21:10:57 -08002501 * Logs when a flag flip state changes.
2502 * Logged in P/h.
2503 */
2504message PhenotypeFlagStateChanged {
2505 // Mendel configuration name.
2506 optional string mendel_config_name = 1;
2507 // State
2508 enum State {
2509 STATE_UNKNOWN = 0;
2510 COMMITTED = 1;
2511 }
2512 optional State state = 2;
2513}
2514
2515/*
2516 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08002517 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08002518 */
2519message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08002520 // Name of the train.
2521 optional string train_name = 1;
2522 // Version code for a "train" of packages that need to be installed atomically
2523 optional int64 train_version_code = 2;
2524 // After installation of this package, device requires a restart.
2525 optional bool requires_staging = 3;
2526 // Rollback should be enabled for this install.
2527 optional bool rollback_enabled = 4;
2528 // Requires low latency monitoring if possible.
2529 optional bool requires_low_latency_monitor = 5;
2530
Yangster-macb89807e2018-11-15 21:10:57 -08002531 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08002532 UNKNOWN = 0;
2533 INSTALL_REQUESTED = 1;
2534 INSTALL_STARTED = 2;
2535 INSTALL_STAGED_NOT_READY = 3;
2536 INSTALL_STAGED_READY = 4;
2537 INSTALL_SUCCESS = 5;
2538 INSTALL_FAILURE = 6;
2539 INSTALL_CANCELLED = 7;
2540 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08002541 }
Chenjie Yu8366c712019-01-16 20:48:30 -08002542 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08002543}
2544
Maggie Whitefc1aa592018-11-28 21:55:23 -08002545/** Represents USB port overheat event. */
2546message UsbPortOverheatEvent {
2547 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
2548 optional int32 plug_temperature_deci_c = 1;
2549
2550 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
2551 optional int32 max_temperature_deci_c = 2;
2552
2553 /* Time between USB plug event and overheat threshold trip, in seconds. */
2554 optional int32 time_to_overheat_secs = 3;
2555
2556 /* Time between overheat threshold trip and hysteresis, in seconds. */
2557 optional int32 time_to_hysteresis_secs = 4;
2558
2559 /* Time between hysteresis and active mitigation ending, in seconds. */
2560 optional int32 time_to_inactive_secs = 5;
2561};
2562
Maggie White8735b852019-01-18 11:40:49 -08002563/**
2564 * Logs total effective full charge and discharge cycles on a battery.
2565 * Here are some examples of one effective cycle:
2566 * 1) the battery charges from 0% to 100% and drains back to 0%,
2567 * 2) charging from 50% to 100% and draining back to 50% twice.
2568 * Pulled from:
2569 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2570 */
2571message BatteryCycleCount {
2572 /* Number of total charge and discharge cycles on the system battery. */
2573 optional int32 cycle_count = 1;
2574}
2575
Yangster-macb89807e2018-11-15 21:10:57 -08002576/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002577 * Logs when a connection becomes available and lost.
2578 * Logged in StatsCompanionService.java
2579 */
2580message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002581 // Id of the network.
2582 optional int32 net_id = 1;
2583
2584 enum State {
2585 UNKNOWN = 0;
2586 CONNECTED = 1;
2587 DISCONNECTED = 2;
2588 }
2589 // Connected state of a network.
2590 optional State state = 2;
2591}
2592
2593/**
2594 * Logs when a service starts and stops.
2595 * Logged from:
2596 * services/core/java/com/android/server/am/ActiveServices.java
2597 */
2598message ServiceStateChanged {
2599
2600 optional int32 uid = 1 [(is_uid) = true];
2601
2602 optional string package_name = 2;
2603
2604 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002605
2606 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002607 START = 1;
2608 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002609 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002610
2611 optional State state = 4;
2612}
2613
2614/**
2615 * Logs when a service is launched.
2616 * Logged from:
2617 * services/core/java/com/android/server/am/ActiveServices.java
2618 */
2619message ServiceLaunchReported {
2620
2621 optional int32 uid = 1 [(is_uid) = true];
2622
2623 optional string package_name = 2;
2624
2625 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002626}
Howard Ro688ae182018-09-25 00:09:36 -07002627
Chenjie Yubbcbc602018-02-05 16:51:52 -08002628//////////////////////////////////////////////////////////////////////
2629// Pulled atoms below this line //
2630//////////////////////////////////////////////////////////////////////
2631
2632/**
David Chenc8a43242017-10-17 16:23:28 -07002633 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2634 *
2635 * Pulled from:
2636 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2637 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002638message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002639 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002640
2641 optional int64 rx_bytes = 2;
2642
2643 optional int64 rx_packets = 3;
2644
2645 optional int64 tx_bytes = 4;
2646
2647 optional int64 tx_packets = 5;
2648}
2649
2650/**
2651 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2652 *
2653 * Pulled from:
2654 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2655 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002656message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002657 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002658
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002659 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2660 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002661
2662 optional int64 rx_bytes = 3;
2663
2664 optional int64 rx_packets = 4;
2665
2666 optional int64 tx_bytes = 5;
2667
2668 optional int64 tx_packets = 6;
2669}
2670
2671/**
2672 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2673 *
2674 * Pulled from:
2675 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2676 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002677message MobileBytesTransfer {
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 mobile networks (separated by foreground and background usage).
2691 *
2692 * Pulled from:
2693 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2694 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002695message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002696 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002697
Yao Chenc40a19d2018-03-15 16:48:25 -07002698 // 1 denotes foreground and 0 denotes background. This is called Set in
2699 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002700 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002701
2702 optional int64 rx_bytes = 3;
2703
2704 optional int64 rx_packets = 4;
2705
2706 optional int64 tx_bytes = 5;
2707
2708 optional int64 tx_packets = 6;
2709}
2710
2711/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002712 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2713 *
2714 * Pulled from:
2715 * StatsCompanionService
2716 */
2717message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002718 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002719
2720 optional int64 rx_bytes = 2;
2721
2722 optional int64 tx_bytes = 3;
2723}
2724
2725/**
David Chenc8a43242017-10-17 16:23:28 -07002726 * Pulls the kernel wakelock durations. This atom is adapted from
2727 * android/internal/os/KernelWakelockStats.java
2728 *
2729 * Pulled from:
2730 * StatsCompanionService using KernelWakelockReader.
2731 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002732message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002733 optional string name = 1;
2734
2735 optional int32 count = 2;
2736
2737 optional int32 version = 3;
2738
Yangster-maca8a30442018-10-13 23:46:34 -07002739 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002740}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002741
Chenjie Yu05013b32017-11-21 10:21:41 -08002742/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002743 * Pulls low power state information. If power.stats HAL is not available, this
2744 * includes platform and subsystem sleep state information,
2745 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2746 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002747 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002748 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002749 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2750 * as defined in:
2751 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002752 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002753message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002754 // Subsystem name
2755 optional string subsystem_name = 1;
2756 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2757 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002758 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2759 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002760 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002761 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002762 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002763 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002764 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002765}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002766
Chenjie Yu05013b32017-11-21 10:21:41 -08002767/**
Bookatz92da2832018-11-01 18:10:03 -07002768 * Pulls on-device power measurement information.
2769 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2770 * Pulled from:
2771 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2772 */
2773message OnDevicePowerMeasurement {
2774 // Name of the subsystem (to which the rail belongs).
2775 optional string subsystem_name = 1;
2776
2777 // Rail name. The rail lies within the subsystem.
2778 optional string rail_name = 2;
2779
2780 // Time (in ms since boot) at which the rail energy value was measured.
2781 // This may differ slightly from the time that statsd logs this information.
2782 optional uint64 measurement_timestamp_millis = 3;
2783
2784 // Accumulated energy used via the rail since device boot in uWs.
2785 optional uint64 energy_microwatt_secs = 4;
2786}
2787
2788/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002789 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002790 * Pulls the time the cpu spend on the frequency index. Frequency index
2791 * starts from highest to lowest. The value should be monotonically
2792 * increasing since boot. However, if there is a cpu
2793 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002794 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002795message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002796 optional uint32 cluster = 1;
2797 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002798 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002799}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002800
Chenjie Yu05013b32017-11-21 10:21:41 -08002801/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002802 * Pulls Cpu Time Per Uid.
2803 * Note that isolated process uid time should be attributed to host uids.
2804 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002805message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002806 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002807 optional uint64 user_time_micros = 2;
2808 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002809}
2810
2811/**
2812 * Pulls Cpu Time Per Uid per frequency.
2813 * Note that isolated process uid time should be attributed to host uids.
2814 * For each uid, we order the time by descending frequencies.
2815 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002816message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002817 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002818 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002819 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002820}
Hugo Benichi884970e2017-11-14 22:42:46 +09002821
Chenjie Yu05013b32017-11-21 10:21:41 -08002822/**
2823 * Pulls Wifi Controller Activity Energy Info
2824 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002825message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002826 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002827 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002828 // stack reported state
2829 // TODO: replace this with proto enum
2830 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002831 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002832 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002833 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002834 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002835 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002836 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002837 // product of current(mA), voltage(V) and time(ms)
2838 optional uint64 controller_energy_used = 6;
2839}
2840
2841/**
2842 * Pulls Modem Activity Energy Info
2843 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002844message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002845 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002846 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002847 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002848 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002849 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002850 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002851 /**
2852 * Tx power index
2853 * index 0 = tx_power < 0dBm
2854 * index 1 = 0dBm < tx_power < 5dBm
2855 * index 2 = 5dBm < tx_power < 15dBm
2856 * index 3 = 15dBm < tx_power < 20dBm
2857 * index 4 = tx_power > 20dBm
2858 */
2859 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002860 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002861 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002862 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002863 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002864 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002865 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002866 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002867 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002868 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002869 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002870 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002871 // product of current(mA), voltage(V) and time(ms)
2872 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002873}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002874
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002875/**
2876 * Pulls Bluetooth Activity Energy Info
2877 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2878 */
2879message BluetoothActivityInfo {
2880 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002881 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002882 // bluetooth stack state
2883 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002884 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002885 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002886 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002887 optional uint64 controller_rx_time_millis = 4;
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 = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002890 // product of current(mA), voltage(V) and time(ms)
2891 optional uint64 energy_used = 6;
2892}
2893
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002894/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002895 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002896 *
2897 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002898 */
2899message ProcessMemoryState {
2900 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002901 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002902
2903 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002904 // Usually package name, "system" for system server.
2905 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002906 optional string process_name = 2;
2907
Rafal Slawikda51b932018-12-13 16:31:33 +00002908 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002909 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002910
2911 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002912 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002913
2914 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002915 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002916
Rajeev Kumar90235992018-01-29 11:06:48 -08002917 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002918 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2919 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002920 optional int64 rss_in_bytes = 6;
2921
2922 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002923 // Value is read from memory.stat, field total_cache if per-app memory
2924 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002925 optional int64 cache_in_bytes = 7;
2926
2927 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002928 // Value is read from memory.stat, field total_swap if per-app memory
2929 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002930 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002931
Rafal Slawikd03ae422018-11-20 11:27:45 +00002932 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002933 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002934
2935 // Elapsed real time when the process started.
2936 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2937 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002938}
2939
2940/*
Rafal Slawik08621582018-10-15 14:53:07 +01002941 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002942 *
2943 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002944 */
2945message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002946 // The uid if available. -1 means not available.
2947 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002948
Rafal Slawikbf67d072018-10-23 11:07:54 +01002949 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002950 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002951 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002952
Rafal Slawikbf67d072018-10-23 11:07:54 +01002953 // # of page-faults
2954 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002955
Rafal Slawikbf67d072018-10-23 11:07:54 +01002956 // # of major page-faults
2957 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002958
Rafal Slawikbf67d072018-10-23 11:07:54 +01002959 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002960 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002961 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002962
Rafal Slawikd03ae422018-11-20 11:27:45 +00002963 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002964 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002965
2966 // Elapsed real time when the process started.
2967 // Value is read from /proc/PID/stat, field 22.
2968 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002969}
2970
2971/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002972 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002973 *
2974 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
2975 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00002976 *
2977 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002978 */
2979message ProcessMemoryHighWaterMark {
2980 // The uid if available. -1 means not available.
2981 optional int32 uid = 1 [(is_uid) = true];
2982
Rafal Slawikda51b932018-12-13 16:31:33 +00002983 // The process name.
2984 // Usually package name or process cmdline.
2985 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002986 optional string process_name = 2;
2987
2988 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2989 // /proc/PID/status.
2990 optional int64 rss_high_water_mark_in_bytes = 3;
2991}
2992
2993/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002994 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002995 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002996message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002997 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002998}
2999
3000/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003001 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003002 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003003message SystemUptime {
3004 // Milliseconds since the system was booted.
3005 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3006 // for external input).
3007 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003008 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003009}
3010
3011/*
3012 * Reads from /proc/uid_concurrent_active_time which has the format:
3013 * active: X (X is # cores)
3014 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3015 * [uid1]: [time-0] [time-1] [time-2] ... ...
3016 * ...
3017 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3018 * The file contains a monotonically increasing count of time for a single boot.
3019 */
3020message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003021 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003022 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003023}
3024
3025/**
3026 * Reads from /proc/uid_concurrent_policy_time which has the format:
3027 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3028 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3029 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3030 * ...
3031 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3032 * The file contains a monotonically increasing count of time for a single boot.
3033 */
3034message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003035 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003036 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003037 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003038}
3039
3040/*
3041 * Pulls free disk space, for data, system partition and temporary directory.
3042 */
3043message DiskSpace {
3044 // available bytes in data partition
3045 optional uint64 data_available_bytes = 1;
3046 // available bytes in system partition
3047 optional uint64 system_available_bytes = 2;
3048 // available bytes in download cache or temp directories
3049 optional uint64 temp_available_bytes = 3;
3050}
Tej Singhbf972d92018-01-10 20:51:13 -08003051
3052/**
3053 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003054 *
3055 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003056 */
3057message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003058 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003059}
3060
3061/**
3062 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003063 * Pulled from:
3064 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003065 */
3066message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003067 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003068}
3069
3070/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003071 * Pulls battery voltage.
3072 * Pulled from:
3073 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3074 */
3075message BatteryVoltage {
3076 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003077 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003078}
3079
3080/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003081 * Pulls battery level (percent full, from 0 to 100).
3082 *
3083 * Pulled from:
3084 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3085 */
3086message BatteryLevel {
3087 // Battery level. Should be in [0, 100].
3088 optional int32 battery_level = 1;
3089}
3090
3091/**
Tej Singhd89137e2018-03-26 14:51:40 -07003092 * Pulls the temperature of various parts of the device.
3093 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003094 *
3095 * Pulled from:
3096 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3097 */
3098message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003099 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003100 optional android.os.TemperatureTypeEnum sensor_location = 1;
3101
3102 // The name of the temperature source. Eg. CPU0
3103 optional string sensor_name = 2;
3104
Tej Singhd89137e2018-03-26 14:51:40 -07003105 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003106 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003107 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003108}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003109
3110/**
3111 * Pulls the statistics of calls to Binder.
3112 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003113 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3114 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003115 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003116 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003117 */
3118message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003119 // UID of the process responsible for the binder transaction. It will be set if the process
3120 // executing the binder transaction attribute the transaction to another uid using
3121 // Binder.setThreadWorkSource().
3122 //
3123 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003124 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003125 // UID of the process executing the binder transaction.
3126 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003127 // Fully qualified class name of the API call.
3128 //
3129 // This is a system server class name.
3130 //
3131 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3132 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3133 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3134 // commonly used APIs.
3135 optional string service_class_name = 2;
3136 // Method name of the API call. It can also be a transaction code if we cannot
3137 // resolve it to a name. See Binder#getTransactionName.
3138 //
3139 // This is a system server method name.
3140 optional string service_method_name = 3;
3141 // Total number of API calls.
3142 optional int64 call_count = 4;
3143 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3144 optional bool screen_interactive = 13;
3145 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3146 // call_count will be equal to recorded_call_count.
3147 //
3148 // If recorded_call_count is different than call_count, it means data collection has been
3149 // sampled. All the fields below will be sampled in this case.
3150 optional int64 recorded_call_count = 12;
3151 // Number of exceptions thrown by the API.
3152 optional int64 recorded_exception_count = 5;
3153 // Total latency of all API calls.
3154 // Average can be computed using total_latency_micros / recorded_call_count.
3155 optional int64 recorded_total_latency_micros = 6;
3156 // Maximum latency of one API call.
3157 optional int64 recorded_max_latency_micros = 7;
3158 // Total CPU usage of all API calls.
3159 // Average can be computed using total_cpu_micros / recorded_call_count.
3160 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3161 optional int64 recorded_total_cpu_micros = 8;
3162 // Maximum CPU usage of one API call.
3163 optional int64 recorded_max_cpu_micros = 9;
3164 // Maximum parcel reply size of one API call.
3165 optional int64 recorded_max_reply_size_bytes = 10;
3166 // Maximum parcel request size of one API call.
3167 optional int64 recorded_max_request_size_bytes = 11;
3168}
3169
3170/**
3171 * Pulls the statistics of exceptions during calls to Binder.
3172 *
3173 * Binder stats are cumulative from boot unless somebody reset the data using
3174 * > adb shell dumpsys binder_calls_stats --reset
3175 */
3176message BinderCallsExceptions {
3177 // Exception class name, e.g. java.lang.IllegalArgumentException.
3178 //
3179 // This is an exception class name thrown by the system server.
3180 optional string exception_class_name = 1;
3181 // Total number of exceptions.
3182 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003183}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003184
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003185/**
3186 * Pulls the statistics of message dispatching on HandlerThreads.
3187 *
3188 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3189 * config on the device.
3190 *
3191 * Next tag: 11
3192 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003193message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003194 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003195 optional int32 uid = 1 [(is_uid) = true];
3196
3197 // Fully qualified class name of the handler target class.
3198 //
3199 // This field does not contain PII. This is a system server class name.
3200 optional string handler_class_name = 2;
3201
3202 // The name of the thread that runs the Looper.
3203 //
3204 // This field does not contain PII. This is a system server thread name.
3205 optional string looper_thread_name = 3;
3206
3207 // The name of the dispatched message.
3208 //
3209 // This field does not contain PII. This is a system server constant or class
3210 // name.
3211 optional string message_name = 4;
3212
3213 // Total number of successfully dispatched messages.
3214 optional int64 message_count = 5;
3215
3216 // Total number of messages that failed dispatching.
3217 optional int64 exception_count = 6;
3218
3219 // Total number of processed messages we have data recorded for. If we
3220 // collected data for all the messages, message_count will be equal to
3221 // recorded_message_count.
3222 //
3223 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003224 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003225 optional int64 recorded_message_count = 7;
3226
3227 // Total latency of all processed messages.
3228 // Average can be computed using recorded_total_latency_micros /
3229 // recorded_message_count.
3230 optional int64 recorded_total_latency_micros = 8;
3231
3232 // Total CPU usage of all processed message.
3233 // Average can be computed using recorded_total_cpu_micros /
3234 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003235 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003236 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003237
3238 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3239 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003240
3241 // Max recorded CPU usage of all processed messages.
3242 optional int64 recorded_max_cpu_micros = 11;
3243
3244 // Max recorded latency of all processed messages.
3245 optional int64 recorded_max_latency_micros = 12;
3246
3247 // Total number of messages we tracked the dispatching delay for. If we
3248 // collected data for all the messages, message_count will be equal to
3249 // recorded_delay_message_count.
3250 //
3251 // If recorded_delay_message_count is different than message_count, it means data
3252 // collection has been sampled or/and not all messages specified the target dispatch time.
3253 // The fields below will be sampled in this case.
3254 optional int64 recorded_delay_message_count = 13;
3255
3256 // Total dispatching delay of all processed messages.
3257 // Calculated as a difference between the target dispatching time (Message.when)
3258 // and the actual dispatching time.
3259 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3260 optional int64 recorded_total_delay_millis = 14;
3261
3262 // Max dispatching delay of all processed messages.
3263 // Calculated as a difference between the target dispatching time (Message.when)
3264 // and the actual dispatching time.
3265 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003266}
Tej Singh86dc9db2018-09-06 00:39:57 +00003267
3268/**
3269 * Pulls disk information, such as write speed and latency.
3270 */
3271message DiskStats {
3272 // Time taken to open, write 512B to, and close a file.
3273 // -1 if error performing the check.
3274 optional int64 data_write_latency_millis = 1;
3275
3276 optional bool file_based_encryption = 2;
3277
3278 // Recent disk write speed in kB/s.
3279 // -1 if error querying storageed.
3280 // 0 if data is unavailable.
3281 optional int32 recent_disk_write_speed = 3;
3282}
3283
3284
3285/**
3286 * Free and total bytes of the Data, Cache, and System partition.
3287 */
3288message DirectoryUsage {
3289 enum Directory {
3290 UNKNOWN = 0;
3291 DATA = 1;
3292 CACHE = 2;
3293 SYSTEM = 3;
3294 }
3295 optional Directory directory = 1;
3296 optional int64 free_bytes = 2;
3297 optional int64 total_bytes = 3;
3298}
3299
3300
3301/**
3302 * Size of an application: apk size, data size, and cache size.
3303 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3304 * Information is only reported for apps with the primary user (user 0).
3305 * Sizes are aggregated by package name.
3306 */
3307message AppSize {
3308 // Including uids will involve modifying diskstats logic.
3309 optional string package_name = 1;
3310 // App size in bytes. -1 if unavailable.
3311 optional int64 app_size_bytes = 2;
3312 // App data size in bytes. -1 if unavailable.
3313 optional int64 app_data_size_bytes = 3;
3314 // App cache size in bytes. -1 if unavailable.
3315 optional int64 app_cache_size_bytes = 4;
3316 // Time that the cache file was produced.
3317 // Uses System.currentTimeMillis(), which is wall clock time.
3318 optional int64 cache_time_millis = 5;
3319}
3320
3321
3322/**
3323 * Size of a particular category. Eg: photos, videos.
3324 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3325 */
3326message CategorySize {
3327 enum Category {
3328 UNKNOWN = 0;
3329 APP_SIZE = 1;
3330 APP_DATA_SIZE = 2;
3331 APP_CACHE_SIZE = 3;
3332 PHOTOS = 4;
3333 VIDEOS = 5;
3334 AUDIO = 6;
3335 DOWNLOADS = 7;
3336 SYSTEM = 8;
3337 OTHER = 9;
3338 }
3339 optional Category category = 1;
3340 // Category size in bytes.
3341 optional int64 size_bytes = 2;
3342 // Time that the cache file was produced.
3343 // Uses System.currentTimeMillis(), which is wall clock time.
3344 optional int64 cache_time_millis = 3;
3345}
Tej Singhd6d6d772018-09-05 17:41:25 -07003346
3347/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003348 * Pulls per uid I/O stats. The stats are cumulative since boot.
3349 *
3350 * Read/write bytes are I/O events from a storage device
3351 * Read/write chars are data requested by read/write syscalls, and can be
3352 * satisfied by caching.
3353 *
3354 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3355 */
3356message DiskIo {
3357 optional int32 uid = 1 [(is_uid) = true];
3358 optional int64 fg_chars_read = 2;
3359 optional int64 fg_chars_write = 3;
3360 optional int64 fg_bytes_read = 4;
3361 optional int64 fg_bytes_write = 5;
3362 optional int64 bg_chars_read = 6;
3363 optional int64 bg_chars_write = 7;
3364 optional int64 bg_bytes_read = 8;
3365 optional int64 bg_bytes_write = 9;
3366 optional int64 fg_fsync = 10;
3367 optional int64 bg_fsync= 11;
3368}
3369
3370
3371/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003372 * Pulls the number of fingerprints for each user.
3373 *
3374 * Pulled from StatsCompanionService, which queries FingerprintManager.
3375 */
3376message NumFingerprints {
3377 // The associated user. Eg: 0 for owners, 10+ for others.
3378 // Defined in android/os/UserHandle.java
3379 optional int32 user = 1;
3380 // Number of fingerprints registered to that user.
3381 optional int32 num_fingerprints = 2;
3382}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003383
Yangsteraf9aee72018-10-12 09:26:16 -07003384message AggStats {
3385 optional int64 min = 1;
3386
3387 optional int64 average = 2;
3388
3389 optional int64 max = 3;
3390}
3391
3392message ProcessStatsStateProto {
3393 optional android.service.procstats.ScreenState screen_state = 1;
3394
3395 optional android.service.procstats.MemoryState memory_state = 2;
3396
3397 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3398 // and not frameworks/base/core/java/android/app/ActivityManager.java
3399 optional android.service.procstats.ProcessState process_state = 3;
3400
3401 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003402 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003403
3404 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003405 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003406
3407 // # of samples taken
3408 optional int32 sample_size = 5;
3409
3410 // PSS is memory reserved for this process
3411 optional AggStats pss = 6;
3412
3413 // USS is memory shared between processes, divided evenly for accounting
3414 optional AggStats uss = 7;
3415
3416 // RSS is memory resident for this process
3417 optional AggStats rss = 8;
3418}
3419
3420// Next Tag: 7
3421message ProcessStatsProto {
3422 // Name of process.
3423 optional string process = 1;
3424
3425 // Uid of the process.
3426 optional int32 uid = 2;
3427
3428 // Information about how often kills occurred
3429 message Kill {
3430 // Count of excessive CPU kills
3431 optional int32 cpu = 1;
3432
3433 // Count of kills when cached
3434 optional int32 cached = 2;
3435
3436 // PSS stats during cached kill
3437 optional AggStats cached_pss = 3;
3438 }
3439 optional Kill kill = 3;
3440
3441 // Time and memory spent in various states.
3442 repeated ProcessStatsStateProto states = 5;
3443
3444 // Total time process has been running... screen_state, memory_state, and process_state
3445 // will not be set.
3446 optional ProcessStatsStateProto total_running_state = 6;
3447}
3448
3449message PackageServiceOperationStatsProto {
3450 // Operate enum: Started, Foreground, Bound, Executing
3451 optional android.service.procstats.ServiceOperationState operation = 1;
3452
3453 // Number of times the service was in this operation.
3454 optional int32 count = 2;
3455
3456 // Information about a state the service can be in.
3457 message StateStats {
3458 // Screen state enum.
3459 optional android.service.procstats.ScreenState screen_state = 1;
3460 // Memory state enum.
3461 optional android.service.procstats.MemoryState memory_state = 2;
3462
3463 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003464 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003465 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003466 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003467 }
3468 repeated StateStats state_stats = 3;
3469}
3470
3471message PackageServiceStatsProto {
3472 // Name of service component.
3473 optional string service_name = 1;
3474
3475 // The operation stats.
3476 // The package_name, package_uid, package_version, service_name will not be set to save space.
3477 repeated PackageServiceOperationStatsProto operation_stats = 2;
3478}
3479
3480message PackageAssociationSourceProcessStatsProto {
3481 // Uid of the process.
3482 optional int32 process_uid = 1;
3483 // Process name.
3484 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08003485 // Package name.
3486 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07003487 // Total count of the times this association appeared.
3488 optional int32 total_count = 3;
3489
3490 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003491 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003492
3493 // Total count of the times this association became actively impacting its target process.
3494 optional int32 active_count = 5;
3495
3496 // Information on one source in this association.
3497 message StateStats {
3498 // Process state enum.
3499 optional android.service.procstats.ProcessState process_state = 1;
3500 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003501 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003502 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003503 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003504 }
3505 repeated StateStats active_state_stats = 6;
3506}
3507
3508message PackageAssociationProcessStatsProto {
3509 // Name of the target component.
3510 optional string component_name = 1;
3511 // Information on one source in this association.
3512 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3513}
3514
3515
3516message ProcessStatsPackageProto {
3517 // Name of package.
3518 optional string package = 1;
3519
3520 // Uid of the package.
3521 optional int32 uid = 2;
3522
3523 // Version of the package.
3524 optional int64 version = 3;
3525
3526 // Stats for each process running with the package loaded in to it.
3527 repeated ProcessStatsProto process_stats = 4;
3528
3529 // Stats for each of the package's services.
3530 repeated PackageServiceStatsProto service_stats = 5;
3531
3532 // Stats for each association with the package.
3533 repeated PackageAssociationProcessStatsProto association_stats = 6;
3534}
3535
3536message ProcessStatsSectionProto {
3537 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003538 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003539
3540 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003541 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003542
3543 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003544 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003545
3546 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003547 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003548
3549 // System runtime library. e.g. "libdvm.so", "libart.so".
3550 optional string runtime = 5;
3551
3552 // whether kernel reports swapped pss.
3553 optional bool has_swapped_pss = 6;
3554
3555 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3556 enum Status {
3557 STATUS_UNKNOWN = 0;
3558 STATUS_COMPLETE = 1;
3559 STATUS_PARTIAL = 2;
3560 STATUS_SHUTDOWN = 3;
3561 STATUS_SYSPROPS = 4;
3562 }
3563 repeated Status status = 7;
3564
Chenjie Yub2ecc792019-01-17 10:27:26 -08003565 // Number of pages available of various types and sizes, representation fragmentation.
3566 repeated ProcessStatsAvailablePagesProto available_pages = 10;
3567
Yangsteraf9aee72018-10-12 09:26:16 -07003568 // Stats for each process.
3569 repeated ProcessStatsProto process_stats = 8;
3570
3571 // Stats for each package.
3572 repeated ProcessStatsPackageProto package_stats = 9;
3573}
3574
Chenjie Yub2ecc792019-01-17 10:27:26 -08003575message ProcessStatsAvailablePagesProto {
3576 // Node these pages are in (as per /proc/pagetypeinfo)
3577 optional int32 node = 1;
3578
3579 // Zone these pages are in (as per /proc/pagetypeinfo)
3580 optional string zone = 2;
3581
3582 // Label for the type of these pages (as per /proc/pagetypeinfo)
3583 optional string label = 3;
3584
3585 // Distribution of number of pages available by order size. First entry in array is
3586 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
3587 repeated int32 pages_per_order = 4;
3588}
3589
Chenjie Yu12e5e672018-09-14 15:54:59 -07003590/**
3591 * Pulled from ProcessStatsService.java
3592 */
3593message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003594 optional ProcessStatsSectionProto proc_stats_section = 1;
3595}
3596
Chenjie Yuf910b7802019-01-11 16:08:20 -08003597/**
3598 * Pulled from ProcessStatsService.java
3599 */
3600message ProcStatsPkgProc {
3601 optional ProcessStatsSectionProto proc_stats_section = 1;
3602}
3603
Yangsteraf9aee72018-10-12 09:26:16 -07003604message PowerProfileProto {
3605 optional double cpu_suspend = 1;
3606
3607 optional double cpu_idle = 2;
3608
3609 optional double cpu_active = 3;
3610
3611 message CpuCluster {
3612 optional int32 id = 1;
3613 optional double cluster_power = 2;
3614 optional int32 cores = 3;
3615 repeated int64 speed = 4;
3616 repeated double core_power = 5;
3617 }
3618
3619 repeated CpuCluster cpu_cluster = 40;
3620
3621 optional double wifi_scan = 4;
3622
3623 optional double wifi_on = 5;
3624
3625 optional double wifi_active = 6;
3626
3627 optional double wifi_controller_idle = 7;
3628
3629 optional double wifi_controller_rx = 8;
3630
3631 optional double wifi_controller_tx = 9;
3632
3633 repeated double wifi_controller_tx_levels = 10;
3634
3635 optional double wifi_controller_operating_voltage = 11;
3636
3637 optional double bluetooth_controller_idle = 12;
3638
3639 optional double bluetooth_controller_rx = 13;
3640
3641 optional double bluetooth_controller_tx = 14;
3642
3643 optional double bluetooth_controller_operating_voltage = 15;
3644
3645 optional double modem_controller_sleep = 16;
3646
3647 optional double modem_controller_idle = 17;
3648
3649 optional double modem_controller_rx = 18;
3650
3651 repeated double modem_controller_tx = 19;
3652
3653 optional double modem_controller_operating_voltage = 20;
3654
3655 optional double gps_on = 21;
3656
3657 repeated double gps_signal_quality_based = 22;
3658
3659 optional double gps_operating_voltage = 23;
3660
3661 optional double bluetooth_on = 24;
3662
3663 optional double bluetooth_active = 25;
3664
3665 optional double bluetooth_at_cmd = 26;
3666
3667 optional double ambient_display = 27;
3668
3669 optional double screen_on = 28;
3670
3671 optional double radio_on = 29;
3672
3673 optional double radio_scanning = 30;
3674
3675 optional double radio_active = 31;
3676
3677 optional double screen_full = 32;
3678
3679 optional double audio = 33;
3680
3681 optional double video = 34;
3682
3683 optional double flashlight = 35;
3684
3685 optional double memory = 36;
3686
3687 optional double camera = 37;
3688
3689 optional double wifi_batched_scan = 38;
3690
3691 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003692}
Chenjie Yuab530202018-09-26 12:39:20 -07003693
3694/**
3695 * power_profile.xml and other constants for power model calculations.
3696 * Pulled from PowerProfile.java
3697 */
3698message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003699 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003700}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003701
3702/**
arangelovd5db50e2018-10-12 20:24:39 +01003703 * Logs when a user restriction was added or removed.
3704 *
3705 * Logged from:
3706 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3707 */
3708message UserRestrictionChanged {
3709 // The raw string of the user restriction as defined in UserManager.
3710 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3711 optional string restriction = 1;
3712 // Whether the restriction is enabled or disabled.
3713 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003714}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003715
3716/**
3717 * Pulls process user time and system time. Puller takes a snapshot of all pids
3718 * in the system and returns cpu stats for those that are working at the time.
3719 * Dead pids will be dropped. Kernel processes are excluded.
3720 * Min cool-down is 5 sec.
3721 */
3722message ProcessCpuTime {
3723 optional int32 uid = 1 [(is_uid) = true];
3724
3725 optional string process_name = 2;
3726 // Process cpu time in user space, cumulative from boot/process start
3727 optional int64 user_time_millis = 3;
3728 // Process cpu time in system space, cumulative from boot/process start
3729 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003730}
Misha Wagner5a51e002018-10-03 15:04:09 +01003731
3732/**
3733 * Pulls the CPU usage for each thread.
3734 *
3735 * Read from /proc/$PID/task/$TID/time_in_state files.
3736 *
3737 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3738 * time_in_state files not being present on some phones, have not been addressed. These should be
3739 * considered before a public release.
3740 */
3741message CpuTimePerThreadFreq {
3742 // UID that owns the process.
3743 optional int32 uid = 1 [(is_uid) = true];
3744 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003745 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003746 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003747 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003748 // Name of the process taken from `/proc/$PID/cmdline`.
3749 optional string process_name = 4;
3750 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3751 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003752
3753 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3754 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3755 // frequencies are given here as the alternative is sending eight separate atoms. This method
3756 // significantly reduces the amount of data created
3757 optional int32 frequency1_khz = 6;
3758 optional int32 time1_millis = 7;
3759 optional int32 frequency2_khz = 8;
3760 optional int32 time2_millis = 9;
3761 optional int32 frequency3_khz = 10;
3762 optional int32 time3_millis = 11;
3763 optional int32 frequency4_khz = 12;
3764 optional int32 time4_millis = 13;
3765 optional int32 frequency5_khz = 14;
3766 optional int32 time5_millis = 15;
3767 optional int32 frequency6_khz = 16;
3768 optional int32 time6_millis = 17;
3769 optional int32 frequency7_khz = 18;
3770 optional int32 time7_millis = 19;
3771 optional int32 frequency8_khz = 20;
3772 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003773}
Bookatz75ee6042018-11-09 12:27:37 -08003774
3775/**
Bookatz366a4432018-11-20 09:42:33 -08003776 * Pulls information about the device's build.
3777 */
3778message BuildInformation {
3779 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3780 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3781 optional string fingerprint = 1;
3782
3783 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3784 optional string brand = 2;
3785
3786 // Build.PRODUCT. The name of the overall product.
3787 optional string product = 3;
3788
3789 // Build.DEVICE. The name of the industrial design.
3790 optional string device = 4;
3791
3792 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3793 optional string version_release = 5;
3794
3795 // Build.ID. E.g. a label like "M4-rc20".
3796 optional string id = 6;
3797
3798 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3799 // represent this build.
3800 optional string version_incremental = 7;
3801
3802 // Build.TYPE. The type of build, like "user" or "eng".
3803 optional string type = 8;
3804
3805 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3806 optional string tags = 9;
3807}
3808
3809/**
Bookatz75ee6042018-11-09 12:27:37 -08003810 * Pulls on-device BatteryStats power use calculations for the overall device.
3811 */
3812message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08003813 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3814 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3815 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3816 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08003817}
3818
3819/**
3820 * Pulls on-device BatteryStats power use calculations broken down by uid.
3821 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3822 * that is attributed to non-uid items. They must all be included to get the total power use.
3823 */
3824message DeviceCalculatedPowerBlameUid {
3825 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3826 optional int32 uid = 1 [(is_uid) = true];
3827
Bookatz3dbc13a2018-12-21 12:16:51 -08003828 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3829 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3830 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08003831}
3832
3833/**
3834 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3835 * drain type.
3836 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3837 * is attributed uids. They must all be included to get the total power use.
3838 */
3839message DeviceCalculatedPowerBlameOther {
3840 // The type of item whose power use is being reported.
3841 enum DrainType {
3842 AMBIENT_DISPLAY = 0;
3843 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3844 BLUETOOTH = 2;
3845 CAMERA = 3;
3846 // Cell-standby
3847 CELL = 4;
3848 FLASHLIGHT = 5;
3849 IDLE = 6;
3850 MEMORY = 7;
3851 // Amount that total computed drain exceeded the drain estimated using the
3852 // battery level changes and capacity.
3853 OVERCOUNTED = 8;
3854 PHONE = 9;
3855 SCREEN = 10;
3856 // Amount that total computed drain was below the drain estimated using the
3857 // battery level changes and capacity.
3858 UNACCOUNTED = 11;
3859 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3860 WIFI = 13;
3861 }
3862 optional DrainType drain_type = 1;
3863
Bookatz3dbc13a2018-12-21 12:16:51 -08003864 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3865 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3866 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003867}
arangelov4e994062018-11-13 16:12:38 +00003868
3869/**
3870 * Logs device policy features.
3871 *
3872 * Logged from:
3873 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3874 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3875 */
3876message DevicePolicyEvent {
3877 // The event id - unique for each event.
3878 optional android.stats.devicepolicy.EventId event_id = 1;
3879 // The admin package name.
3880 optional string admin_package_name = 2;
3881 // A generic integer parameter.
3882 optional int32 integer_value = 3;
3883 // A generic boolean parameter.
3884 optional bool boolean_value = 4;
3885 // A parameter specifying a time period in milliseconds.
3886 optional uint64 time_period_millis = 5;
3887 // A parameter specifying a list of package names, bundle extras or string parameters.
3888 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3889}
shawnlinea5b66b2018-11-13 15:05:29 +08003890
3891/**
3892 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3893 *
3894 * Logged from:
3895 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3896 */
3897message DocsUILaunchReported {
3898 optional android.stats.docsui.LaunchAction launch_action = 1;
3899 optional bool has_initial_uri = 2;
3900 optional android.stats.docsui.MimeType mime_type = 3;
3901 optional android.stats.docsui.Root initial_root = 4;
3902}
3903
3904/**
3905 * Logs root/app visited event in file managers/picker. Call this when the user
3906 * taps on root/app in hamburger menu.
3907 *
3908 * Logged from:
3909 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3910 */
3911message DocsUIRootVisitedReported {
3912 optional android.stats.docsui.ContextScope scope = 1;
3913 optional android.stats.docsui.Root root = 2;
3914}
3915
3916/**
3917 * Logs file operation stats. Call this when a file operation has completed.
3918 *
3919 * Logged from:
3920 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3921 */
3922message DocsUIFileOperationReported {
3923 optional android.stats.docsui.Provider provider = 1;
3924 optional android.stats.docsui.FileOperation file_op = 2;
3925}
3926
3927/**
3928 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3929 * mode.
3930 *
3931 * Logged from:
3932 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3933 */
3934message DocsUIFileOperationCopyMoveModeReported {
3935 optional android.stats.docsui.FileOperation file_op = 1;
3936 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3937}
3938
3939
3940/**
3941 * Logs file sub operation stats. Call this when a file operation has failed.
3942 *
3943 * Logged from:
3944 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3945 */
3946message DocsUIFileOperationFailureReported {
3947 optional android.stats.docsui.Authority authority = 1;
3948 optional android.stats.docsui.SubFileOperation sub_op = 2;
3949}
3950
3951/**
3952* Logs the cancellation of a file operation. Call this when a job is canceled
3953*
3954* Logged from:
3955* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3956*/
3957message DocsUIFileOperationCanceledReported {
3958 optional android.stats.docsui.FileOperation file_op = 1;
3959}
3960
3961/**
3962 * Logs startup time in milliseconds.
3963 *
3964 * Logged from:
3965 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3966 */
3967message DocsUIStartupMsReported {
3968 optional int32 startup_millis = 1;
3969}
3970
3971/**
3972 * Logs the action that was started by user.
3973 *
3974 * Logged from:
3975 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3976 */
3977message DocsUIUserActionReported {
3978 optional android.stats.docsui.UserAction action = 1;
3979}
3980
3981/**
3982 * Logs the invalid type when invalid scoped access is requested.
3983 *
3984 * Logged from:
3985 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
3986 */
3987message DocsUIInvalidScopedAccessRequestReported {
3988 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00003989}
Ben Murdochbab399f2018-12-06 11:01:38 +00003990
3991/**
shawnlina75e82d2019-01-07 10:31:12 +08003992 * Logs the package name that launches docsui picker mode.
3993 *
3994 * Logged from:
3995 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3996 */
3997message DocsUIPickerLaunchedFromReported {
3998 optional string package_name = 1;
3999}
4000
4001/**
4002 * Logs the search type.
4003 *
4004 * Logged from:
4005 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4006 */
4007message DocsUISearchTypeReported {
4008 optional android.stats.docsui.SearchType search_type = 1;
4009}
4010
4011/**
4012 * Logs the search mode.
4013 *
4014 * Logged from:
4015 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4016 */
4017message DocsUISearchModeReported {
4018 optional android.stats.docsui.SearchMode search_mode = 1;
4019}
4020
4021/**
4022 * Logs the pick result information.
4023 *
4024 * Logged from:
4025 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4026 */
4027message DocsUIPickResultReported {
4028 optional int32 total_action_count = 1;
4029 optional int64 duration_millis = 2;
4030 optional int32 file_count= 3;
4031 optional bool is_searching = 4;
4032 optional android.stats.docsui.Root picked_from = 5;
4033 optional android.stats.docsui.MimeType mime_type = 6;
4034 optional int32 repeatedly_pick_times = 7;
4035}
4036
4037/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004038 * Logs when an app's memory is compacted.
4039 *
4040 * Logged from:
4041 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4042 */
4043message AppCompacted {
4044 // The pid of the process being compacted.
4045 optional int32 pid = 1;
4046
4047 // The name of the process being compacted.
4048 optional string process_name = 2;
4049
4050 // The type of compaction.
4051 enum Action {
4052 UNKNOWN = 0;
4053 SOME = 1;
4054 FULL = 2;
4055 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004056 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004057
4058 // Total RSS in kilobytes consumed by the process prior to compaction.
4059 optional int64 before_rss_total_kilobytes = 4;
4060
4061 // File RSS in kilobytes consumed by the process prior to compaction.
4062 optional int64 before_rss_file_kilobytes = 5;
4063
4064 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4065 optional int64 before_rss_anon_kilobytes = 6;
4066
4067 // Swap in kilobytes consumed by the process prior to compaction.
4068 optional int64 before_swap_kilobytes = 7;
4069
4070 // Total RSS in kilobytes consumed by the process after compaction.
4071 optional int64 after_rss_total_kilobytes = 8;
4072
4073 // File RSS in kilobytes consumed by the process after compaction.
4074 optional int64 after_rss_file_kilobytes = 9;
4075
4076 // Anonymous RSS in kilobytes consumed by the process after compaction.
4077 optional int64 after_rss_anon_kilobytes = 10;
4078
4079 // Swap in kilobytes consumed by the process after compaction.
4080 optional int64 after_swap_kilobytes = 11;
4081
4082 // The time taken to perform compaction in milliseconds.
4083 optional int64 time_to_compact_millis = 12;
4084
4085 // The last compaction action performed for this app.
4086 optional Action last_action = 13;
4087
Ben Murdoch01720b82018-12-19 18:03:44 +00004088 // The last time that compaction was attempted on this process in milliseconds
4089 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4090 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004091
Ben Murdoch01720b82018-12-19 18:03:44 +00004092 // The oom_score_adj at the time of compaction.
4093 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004094
4095 // The process state at the time of compaction.
4096 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4097}
lifr157fc552018-12-12 16:38:04 +08004098
4099/**
4100 * Logs the latency period(in microseconds) and the return code of
4101 * the DNS(Domain Name System) lookups.
4102 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4103 * to get info(address or hostname) from DNS server(or DNS cache).
4104 * Logged from:
4105 * /system/netd/server/DnsProxyListener.cpp
4106 */
4107message NetworkDnsEventReported {
4108 // The types of the DNS lookups, as defined in
4109 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4110 enum EventType {
4111 EVENT_UNKNOWN = 0;
4112 EVENT_GETADDRINFO = 1;
4113 EVENT_GETHOSTBYNAME = 2;
4114 EVENT_GETHOSTBYADDR = 3;
4115 EVENT_RES_NSEND = 4;
4116 }
4117 optional EventType event_type = 1;
4118
4119 // The return value of the DNS resolver for each DNS lookups.
4120 //bionic/libc/include/netdb.h
4121 //system/netd/resolv/include/netd_resolv/resolv.h
4122 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004123 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004124 EAI_ADDRFAMILY = 1;
4125 EAI_AGAIN = 2;
4126 EAI_BADFLAGS = 3;
4127 EAI_FAIL = 4;
4128 EAI_FAMILY = 5;
4129 EAI_MEMORY = 6;
4130 EAI_NODATA = 7;
4131 EAI_NONAME = 8;
4132 EAI_SERVICE = 9;
4133 EAI_SOCKTYPE = 10;
4134 EAI_SYSTEM = 11;
4135 EAI_BADHINTS = 12;
4136 EAI_PROTOCOL = 13;
4137 EAI_OVERFLOW = 14;
4138 RESOLV_TIMEOUT = 255;
4139 EAI_MAX = 256;
4140 }
4141 optional ReturnCode return_code = 2;
4142
4143 // The latency period(in microseconds) it took for this DNS lookup to complete.
4144 optional int32 latency_micros = 3;
4145}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004146
4147/**
4148 * Logs when a data stall event occurs.
4149 *
4150 * Log from:
4151 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4152 */
4153message DataStallEvent {
4154 // Data stall evaluation type.
4155 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4156 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4157 optional int32 evaluation_type = 1;
4158 // See definition in data_stall_event.proto.
4159 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4160 // See definition in data_stall_event.proto.
4161 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4162 // See definition in data_stall_event.proto.
4163 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4164 // See definition in data_stall_event.proto.
4165 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4166 // See definition in data_stall_event.proto.
4167 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4168}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004169
4170/*
4171 * Logs when RescueParty resets some set of experiment flags.
4172 *
4173 * Logged from:
4174 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4175 */
4176message RescuePartyResetReported {
4177 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4178 optional int32 rescue_level = 1;
4179}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004180
4181/**
4182 * Logs when signed config is received from an APK, and if that config was applied successfully.
4183 * Logged from:
4184 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4185 */
4186message SignedConfigReported {
4187 enum Type {
4188 UNKNOWN_TYPE = 0;
4189 GLOBAL_SETTINGS = 1;
4190 }
4191 optional Type type = 1;
4192
4193 // The final status of the signed config received.
4194 enum Status {
4195 UNKNOWN_STATUS = 0;
4196 APPLIED = 1;
4197 BASE64_FAILURE_CONFIG = 2;
4198 BASE64_FAILURE_SIGNATURE = 3;
4199 SECURITY_EXCEPTION = 4;
4200 INVALID_CONFIG = 5;
4201 OLD_CONFIG = 6;
4202 SIGNATURE_CHECK_FAILED = 7;
4203 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004204 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004205 }
4206 optional Status status = 2;
4207
4208 // The version of the signed config processed.
4209 optional int32 version = 3;
4210
4211 // The package name that the config was extracted from.
4212 optional string from_package = 4;
4213
4214 enum Key {
4215 NO_KEY = 0;
4216 DEBUG = 1;
4217 PRODUCTION = 2;
4218 }
4219 // Which key was used to verify the config.
4220 optional Key verified_with = 5;
4221}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004222
4223/*
4224 * Logs GNSS Network-Initiated (NI) location events.
4225 *
4226 * Logged from:
4227 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4228 */
4229message GnssNiEventReported {
4230 // The type of GnssNiEvent.
4231 enum EventType {
4232 UNKNOWN = 0;
4233 NI_REQUEST = 1;
4234 NI_RESPONSE = 2;
4235 }
4236 optional EventType event_type = 1;
4237
4238 // An ID generated by HAL to associate NI notifications and UI responses.
4239 optional int32 notification_id = 2;
4240
4241 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004242 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004243
4244 // NI requires notification.
4245 optional bool need_notify = 4;
4246
4247 // NI requires verification.
4248 optional bool need_verify = 5;
4249
4250 // NI requires privacy override, no notification/minimal trace.
4251 optional bool privacy_override = 6;
4252
4253 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4254 // seconds.
4255 optional int32 timeout = 7;
4256
4257 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004258 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004259
4260 // String representing the requester of the network inititated location request.
4261 optional string requestor_id = 9;
4262
4263 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4264 // network initiated location request.
4265 optional string text = 10;
4266
4267 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004268 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004269
4270 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004271 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004272
4273 // True if SUPL ES is enabled.
4274 optional bool is_supl_es_enabled = 13;
4275
4276 // True if GNSS location is enabled.
4277 optional bool is_location_enabled = 14;
4278
4279 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004280 optional android.server.location.GnssUserResponseType user_response = 15;
4281}
4282
4283/**
4284 * Logs GNSS non-framework (NFW) location notification.
4285 *
4286 * Logged from:
4287 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4288 */
4289message GnssNfwNotificationReported {
4290 // Package name of the Android proxy application representing the non-framework entity that
4291 // requested location. Set to empty string if unknown.
4292 optional string proxy_app_package_name = 1;
4293
4294 // Protocol stack that initiated the non-framework location request.
4295 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4296
4297 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4298 // set to empty string. This field is opaque to the framework and used for logging purposes.
4299 optional string other_protocol_stack_name = 3;
4300
4301 // Source initiating/receiving the location information.
4302 optional android.server.location.NfwRequestor requestor = 4;
4303
4304 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4305 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4306 // and used for logging purposes.
4307 optional string requestor_id = 5;
4308
4309 // Indicates whether location information was provided for this request.
4310 optional android.server.location.NfwResponseType response_type = 6;
4311
4312 // True if the device is in user initiated emergency session.
4313 optional bool in_emergency_mode = 7;
4314
4315 // True if cached location is provided.
4316 optional bool is_cached_location = 8;
4317
4318 // True if proxy app permission mismatch between framework and GNSS HAL.
4319 optional bool is_permission_mismatched = 9;
4320}
4321
4322/**
4323 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4324 *
4325 * Logged from:
4326 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4327 */
4328message GnssConfigurationReported {
4329 // SUPL host name.
4330 optional string supl_host = 1;
4331
4332 // SUPL port number.
4333 optional int32 supl_port = 2;
4334
4335 // C2K host name.
4336 optional string c2k_host = 3;
4337
4338 // C2K port number.
4339 optional int32 c2k_port = 4;
4340
4341 // The SUPL version requested by Carrier.
4342 optional int32 supl_ver = 5;
4343
4344 // The SUPL mode.
4345 optional android.server.location.SuplMode supl_mode = 6;
4346
4347 // True if NI emergency SUPL restrictions is enabled.
4348 optional bool supl_es = 7;
4349
4350 // LTE Positioning Profile settings
4351 optional android.server.location.LppProfile lpp_profile = 8;
4352
4353 // Positioning protocol on A-Glonass system.
4354 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4355
4356 // True if emergency PDN is used. Otherwise, regular PDN is used.
4357 optional bool use_emergency_pdn_for_emergency_supl= 10;
4358
4359 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4360 optional android.server.location.GpsLock gps_lock = 11;
4361
4362 // Number of seconds to extend the emergency session duration post emergency call.
4363 optional int32 es_extension_sec = 12;
4364
4365 // The full list of package names of proxy Android applications representing the non-framework
4366 // location access entities (on/off the device) for which the framework user has granted
4367 // non-framework location access permission. The package names are concatenated in one string
4368 // with spaces as separators.
4369 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004370}
Jack Yu95b64f32018-12-13 18:26:11 +08004371
4372/**
4373 * Logs when a NFC device's error occurred.
4374 * Logged from:
4375 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4376 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
4377 */
4378message NfcErrorOccurred {
4379 enum Type {
4380 UNKNOWN = 0;
4381 CMD_TIMEOUT = 1;
4382 ERROR_NOTIFICATION = 2;
4383 AID_OVERFLOW = 3;
4384 }
4385 optional Type type = 1;
4386 // If it's nci cmd timeout, log the timeout command.
4387 optional uint32 nci_cmd = 2;
4388
4389 optional uint32 error_ntf_status_code = 3;
4390}
4391
4392/**
4393 * Logs when a NFC device's state changed event
4394 * Logged from:
4395 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
4396 */
4397message NfcStateChanged {
4398 enum State {
4399 UNKNOWN = 0;
4400 OFF = 1;
4401 ON = 2;
4402 ON_LOCKED = 3; // Secure Nfc enabled.
4403 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
4404 }
4405 optional State state = 1;
4406}
4407
4408/**
4409 * Logs when a NFC Beam Transaction occurred.
4410 * Logged from:
4411 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
4412 */
4413message NfcBeamOccurred {
4414 enum Operation {
4415 UNKNOWN = 0;
4416 SEND = 1;
4417 RECEIVE = 2;
4418 }
4419 optional Operation operation = 1;
4420}
4421
4422/**
4423 * Logs when a NFC Card Emulation Transaction occurred.
4424 * Logged from:
4425 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
4426 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
4427 */
4428message NfcCardemulationOccurred {
4429 enum Category {
4430 UNKNOWN = 0;
4431 HCE_PAYMENT = 1;
4432 HCE_OTHER = 2;
4433 OFFHOST = 3;
4434 }
4435 // Transaction belongs to HCE payment or HCE other category, or offhost.
4436 optional Category category = 1;
4437 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
4438 optional string se_name = 2;
4439}
4440
4441/**
4442 * Logs when a NFC Tag event occurred.
4443 * Logged from:
4444 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
4445 */
4446message NfcTagOccurred {
4447 enum Type {
4448 UNKNOWN = 0;
4449 URL = 1;
4450 BT_PAIRING = 2;
4451 PROVISION = 3;
4452 WIFI_CONNECT = 4;
4453 APP_LAUNCH = 5;
4454 OTHERS = 6;
4455 }
4456 optional Type type = 1;
4457}
4458
4459/**
4460 * Logs when Hce transaction triggered
4461 * Logged from:
4462 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4463 */
4464message NfcHceTransactionOccurred {
4465 // The latency period(in microseconds) it took for the first HCE data
4466 // exchange.
4467 optional uint32 latency_micros = 1;
4468}
4469
4470/**
4471 * Logs when SecureElement state event changed
4472 * Logged from:
4473 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4474 */
4475message SeStateChanged {
4476 enum State {
4477 UNKNOWN = 0;
4478 INITIALIZED = 1;
4479 DISCONNECTED = 2;
4480 CONNECTED = 3;
4481 HALCRASH = 4;
4482 }
4483 optional State state = 1;
4484
4485 optional string state_change_reason = 2;
4486 // SIMx or eSEx.
4487 optional string terminal = 3;
4488}
4489
4490/**
4491 * Logs when Omapi API used
4492 * Logged from:
4493 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4494 */
4495message SeOmapiReported {
4496 enum Operation {
4497 UNKNOWN = 0;
4498 OPEN_CHANNEL = 1;
4499 }
4500 optional Operation operation = 1;
4501 // SIMx or eSEx.
4502 optional string terminal = 2;
4503
Jack Yu4bb90eb2019-01-23 15:13:41 +08004504 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08004505}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004506
4507/**
Alex Saloa060aee2019-01-21 14:36:41 -08004508 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
4509 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004510 * Logged from:
4511 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
4512 */
4513message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08004514 optional int64 dispatch_latency_millis = 1;
4515}
4516
4517/**
4518 * Logs AttentionManagerService attention check result.
4519 *
4520 * Logged from:
4521 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
4522 */
4523message AttentionManagerServiceResultReported {
4524 // See core/java/android/service/attention/AttentionService.java
4525 enum AttentionCheckResult {
4526 UNKNOWN = 20;
4527 ATTENTION_SUCCESS_ABSENT = 0;
4528 ATTENTION_SUCCESS_PRESENT = 1;
4529 ATTENTION_FAILURE_PREEMPTED = 2;
4530 ATTENTION_FAILURE_TIMED_OUT = 3;
4531 ATTENTION_FAILURE_UNKNOWN = 4;
4532 }
4533 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004534}
Michael Groover9e7b06e2018-12-28 19:55:51 -08004535
4536/**
4537 * Logs when an adb connection changes state.
4538 *
4539 * Logged from:
4540 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
4541 */
4542message AdbConnectionChanged {
4543 // The last time this system connected via adb, or 0 if the 'always allow' option was not
4544 // previously selected for this system.
4545 optional int64 last_connection_time_millis = 1;
4546
4547 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
4548 // to reconnect via adb without user interaction.
4549 optional int64 auth_window_millis = 2;
4550
4551 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
4552 optional android.debug.AdbConnectionStateEnum state = 3;
4553
4554 // True if the 'always allow' option was selected for this system.
4555 optional bool always_allow = 4;
4556}
Carter Hsub8fd1e92019-01-11 15:24:45 +08004557
4558/*
4559 * Logs the reported speech DSP status.
4560 *
4561 * Logged from:
4562 * Vendor audio implementation.
4563 */
4564message SpeechDspStatReported {
4565 // The total Speech DSP uptime in milliseconds.
4566 optional int32 total_uptime_millis = 1;
4567 // The total Speech DSP downtime in milliseconds.
4568 optional int32 total_downtime_millis = 2;
4569 optional int32 total_crash_count = 3;
4570 optional int32 total_recover_count = 4;
4571}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08004572
4573/**
4574 * Logs USB connector contaminant status.
4575 *
4576 * Logged from: USB Service.
4577 */
4578message UsbContaminantReported {
4579 optional string id = 1;
4580 optional android.service.usb.ContaminantPresenceStatus status = 2;
4581}
Olivier Gaillard18d452202019-01-22 15:03:41 +00004582
4583/**
4584 * This atom is for debugging purpose.
4585 */
4586message DebugElapsedClock {
4587 // Monotically increasing value for each pull.
4588 optional int64 pull_count = 1;
4589 // Time from System.elapsedRealtime.
4590 optional int64 elapsed_clock_millis = 2;
4591 // Time from System.elapsedRealtime.
4592 optional int64 same_elapsed_clock_millis = 3;
4593 // Diff between current elapsed time and elapsed time from previous pull.
4594 optional int64 elapsed_clock_diff_millis = 4;
4595
4596 enum Type {
4597 TYPE_UNKNOWN = 0;
4598 ALWAYS_PRESENT = 1;
4599 PRESENT_ON_ODD_PULLS = 2;
4600 }
4601 // Type of behavior for the pulled data.
4602 optional Type type = 5;
4603}
4604
4605/**
4606 * This atom is for debugging purpose.
4607 */
4608message DebugFailingElapsedClock {
4609 // Monotically increasing value for each pull.
4610 optional int64 pull_count = 1;
4611 // Time from System.elapsedRealtime.
4612 optional int64 elapsed_clock_millis = 2;
4613 // Time from System.elapsedRealtime.
4614 optional int64 same_elapsed_clock_millis = 3;
4615 // Diff between current elapsed time and elapsed time from previous pull.
4616 optional int64 elapsed_clock_diff_millis = 4;
4617}