blob: 5a6c08dc63ad45bf7c505ae2471f1d11579d3e61 [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";
37import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080038import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070039import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080040import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080041import "frameworks/base/core/proto/android/telephony/enums.proto";
42import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000043import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
44import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080045
Yao Chend54f9dd2017-10-17 17:37:48 +000046/**
Stefan Lafonae2df012017-11-14 09:17:21 -080047 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000048 * raw stats log events from the Android system, also known as "atoms."
49 *
50 * This field contains a single oneof with all of the available messages.
51 * The stats-log-api-gen tool runs as part of the Android build and
52 * generates the android.util.StatsLog class, which contains the constants
53 * and methods that Android uses to log.
54 *
Stefan Lafonae2df012017-11-14 09:17:21 -080055 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000056 * Instead, statsd on Android constructs these messages synthetically,
57 * in the format defined here and in stats_log.proto.
58 */
Stefan Lafonae2df012017-11-14 09:17:21 -080059message Atom {
60 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070061 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070062 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
63 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070064 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070065 BleScanResultReceived ble_scan_result_received = 4;
66 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080067 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070068 SyncStateChanged sync_state_changed = 7;
69 ScheduledJobStateChanged scheduled_job_state_changed = 8;
70 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070071 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080072 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
73 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
74 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070075 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
76 MemoryFactorStateChanged memory_factor_state_changed = 15;
77 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
78 CachedKillReported cached_kill_reported = 17;
79 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070080 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080081 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
82 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
83 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070084 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080085 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070086 CameraStateChanged camera_state_changed = 25;
87 FlashlightStateChanged flashlight_state_changed = 26;
88 UidProcessStateChanged uid_process_state_changed = 27;
89 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
90 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070091 BatteryLevelChanged battery_level_changed = 30;
92 ChargingStateChanged charging_state_changed = 31;
93 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070094 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -080095 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -070096 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
97 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070098 WifiLockStateChanged wifi_lock_state_changed = 37;
99 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
100 WifiScanStateChanged wifi_scan_state_changed = 39;
101 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700102 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700103 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700104 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900105 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700106 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800107 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800108 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800109 AppStartOccurred app_start_occurred = 48;
110 AppStartCanceled app_start_canceled = 49;
111 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800112 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800113 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800114 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800115 LmkStateChanged lmk_state_changed = 54;
116 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800117 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800118 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800119 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800120 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800121 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800122 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800123 KeyguardStateChanged keyguard_state_changed = 62;
124 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
125 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800126 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800127 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800128 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
129 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800130 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700131 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800132 SpeakerImpedanceReported speaker_impedance_reported = 71;
133 HardwareFailed hardware_failed = 72;
134 PhysicalDropDetected physical_drop_detected = 73;
135 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800136 MobileConnectionStateChanged mobile_connection_state_changed = 75;
137 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700138 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800139 AppCrashOccurred app_crash_occurred = 78;
140 ANROccurred anr_occurred = 79;
141 WTFOccurred wtf_occurred = 80;
142 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700143 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700144 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700145 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700146 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700147 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700148 FingerprintAcquired fingerprint_acquired = 87;
149 FingerprintAuthenticated fingerprint_authenticated = 88;
150 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700151 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700152 BatteryHealthSnapshot battery_health_snapshot = 91;
153 SlowIo slow_io = 92;
154 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700155 PhoneServiceStateChanged phone_service_state_changed = 94;
156 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100157 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700158 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700159 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700160 // TODO: service state change is very noisy shortly after boot, as well
161 // as at other transitions - coming out of doze, device plugged in, etc.
162 // Consider removing this if it becomes a problem
163 ServiceStateChanged service_state_changed = 99;
164 ServiceLaunchReported service_launch_reported = 100;
Yangster-macb89807e2018-11-15 21:10:57 -0800165 PhenotypeFlagStateChanged phenotype_flag_state_changed = 101;
166 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000167 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800168 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
169 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
170 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
171 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
172 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
173 DocsUILaunchReported docs_ui_launch_reported = 109;
174 DocsUIRootVisitedReported docs_ui_root_visited = 110;
175 DocsUIStartupMsReported docs_ui_startup_ms = 111;
176 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800177 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
178 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000179 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800180 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800181 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
182 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
183 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
184 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800185 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000186 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000187 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800188 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800189 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800190 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
191 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000192 AppDowngraded app_downgraded = 128;
193 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
194 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800195 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
196 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800197 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800198 NfcErrorOccurred nfc_error_occurred = 134;
199 NfcStateChanged nfc_state_changed = 135;
200 NfcBeamOccurred nfc_beam_occurred = 136;
201 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
202 NfcTagOccurred nfc_tag_occurred = 138;
203 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
204 SeStateChanged se_state_changed = 140;
205 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800206 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800207 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800208 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800209 SpeechDspStatReported speech_dsp_stat_reported = 145;
Yao Chend54f9dd2017-10-17 17:37:48 +0000210 }
David Chenc8a43242017-10-17 16:23:28 -0700211
David Chen6e3e6cb2018-01-03 16:14:06 -0800212 // Pulled events will start at field 10000.
Rafal Slawik3bea8952018-11-15 12:39:33 +0000213 // Next: 10043
David Chenc8a43242017-10-17 16:23:28 -0700214 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800215 WifiBytesTransfer wifi_bytes_transfer = 10000;
216 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
217 MobileBytesTransfer mobile_bytes_transfer = 10002;
218 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800219 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800220 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800221 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800222 CpuTimePerFreq cpu_time_per_freq = 10008;
223 CpuTimePerUid cpu_time_per_uid = 10009;
224 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800225 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800226 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800227 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800228 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800229 SystemElapsedRealtime system_elapsed_realtime = 10014;
230 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800231 CpuActiveTime cpu_active_time = 10016;
232 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000233 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800234 RemainingBatteryCapacity remaining_battery_capacity = 10019;
235 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800236 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100237 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100238 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100239 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000240 DiskStats disk_stats = 10025;
241 DirectoryUsage directory_usage = 10026;
242 AppSize app_size = 10027;
243 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700244 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700245 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700246 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700247 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700248 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800249 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700250 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100251 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100252 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700253 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800254 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
255 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
256 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000257 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800258 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800259 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800260 BatteryCycleCount battery_cycle_count = 10045;
David Chenc8a43242017-10-17 16:23:28 -0700261 }
yroa1fe77c2018-02-26 14:22:54 -0800262
Bookatz76aafcf2018-09-17 16:17:10 -0700263 // DO NOT USE field numbers above 100,000 in AOSP.
264 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
265 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700266}
267
Yao Chend54f9dd2017-10-17 17:37:48 +0000268/**
Yangster-mac20877162017-12-22 17:19:39 -0800269 * This proto represents a node of an attribution chain.
270 * Note: All attribution chains are represented as a repeated field of type
271 * AttributionNode. It is understood that in such arrays, the order is that
272 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000273 */
Yangster-mac20877162017-12-22 17:19:39 -0800274message AttributionNode {
275 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800276 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800277
Yangster-mac20877162017-12-22 17:19:39 -0800278 // The (optional) string tag for an element in the attribution chain. If the
279 // element has no tag, it is encoded as an empty string.
280 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700281}
282
Yangster-mac48b3d622018-08-18 12:38:11 -0700283message KeyValuePair {
284 optional int32 key = 1;
285 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700286 int32 value_int = 2;
287 int64 value_long = 3;
288 string value_str = 4;
289 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700290 }
291}
292
293message KeyValuePairsAtom {
294 optional int32 uid = 1;
295 repeated KeyValuePair pairs = 2;
296}
297
Yao Chend54f9dd2017-10-17 17:37:48 +0000298/*
299 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800300 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000301 *
302 * RULES:
303 * - The field ids for each atom must start at 1, and count upwards by 1.
304 * Skipping field ids is not allowed.
305 * - These form an API, so renaming, renumbering or removing fields is
306 * not allowed between android releases. (This is not currently enforced,
307 * but there will be a tool to enforce this restriction).
308 * - The types must be built-in protocol buffer types, namely, no sub-messages
309 * are allowed (yet). The bytes type is also not allowed.
310 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800311 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000312 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800313 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000314 * - A field that is a uid should be a string field, tagged with the [xxx]
315 * annotation. The generated code on android will be represented by UIDs,
316 * and those UIDs will be translated in xxx to those strings.
317 *
318 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700319 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000320 * - If there is a UID, it goes first. Think in an object-oriented fashion.
321 * *****************************************************************************
322 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700323
Yao Chend54f9dd2017-10-17 17:37:48 +0000324/**
Yangster-mace16189a2018-08-26 12:20:16 -0700325 * Logs when the Thermal service HAL notifies the throttling start/stop events.
326 *
327 * Logged from:
328 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
329 */
330message ThermalThrottlingStateChanged {
331 optional android.os.TemperatureTypeEnum sensor_type = 1;
332
333 enum State {
334 UNKNOWN = 0;
335 START = 1;
336 STOP = 2;
337 }
338
339 optional State state = 2;
340
341 optional float temperature = 3;
342}
343
344/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000345 * Logs when the screen state changes.
346 *
347 * Logged from:
348 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
349 */
350message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800351 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700352 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700353}
Yao Chend54f9dd2017-10-17 17:37:48 +0000354
355/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700356 * Logs that the process state of the uid, as determined by ActivityManager
357 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000358 *
359 * Logged from:
360 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
361 */
Bookatzc1a050a2017-10-10 15:49:28 -0700362message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700363 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000364
Bookatzdb026a22018-01-10 19:01:56 -0800365 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700366 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000367}
368
369/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700370 * Logs process state change of a process, as per the activity manager.
371 *
372 * Logged from:
373 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
374 */
375message ProcessStateChanged {
376 optional int32 uid = 1;
377 optional string process_name = 2;
378 optional string package_name = 3;
379 // TODO: remove this when validation is done
380 optional int64 version = 5;
381 // The state, from frameworks/base/core/proto/android/app/enums.proto.
382 optional android.app.ProcessStateEnum state = 4;
383}
384
385/**
386 * Logs when ActivityManagerService sleep state is changed.
387 *
388 * Logged from:
389 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
390 */
391message ActivityManagerSleepStateChanged {
392 // TODO: import frameworks proto
393 enum State {
394 UNKNOWN = 0;
395 ASLEEP = 1;
396 AWAKE = 2;
397 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700398 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700399}
400
401/**
402 * Logs when system memory state changes.
403 *
404 * Logged from:
405 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
406 */
407message MemoryFactorStateChanged {
408 // TODO: import frameworks proto
409 enum State {
410 MEMORY_UNKNOWN = 0;
411 NORMAL = 1; // normal.
412 MODERATE = 2; // moderate memory pressure.
413 LOW = 3; // low memory.
414 CRITICAL = 4; // critical memory.
415
416 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700417 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700418}
419
420/**
421 * Logs when app is using too much cpu, according to ActivityManagerService.
422 *
423 * Logged from:
424 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
425 */
426message ExcessiveCpuUsageReported {
427 optional int32 uid = 1;
428 optional string process_name = 2;
429 optional string package_name = 3;
430 // package version. TODO: remove this when validation is done
431 optional int64 version = 4;
432}
433
434/**
435 * Logs when a cached process is killed, along with its pss.
436 *
437 * Logged from:
438 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
439 */
440message CachedKillReported {
441 optional int32 uid = 1;
442 optional string process_name = 2;
443 optional string package_name = 3;
444 // TODO: remove this when validation is done
445 optional int64 version = 5;
446 optional int64 pss = 4;
447}
448
449/**
450 * Logs when memory stats of a process is reported.
451 *
452 * Logged from:
453 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
454 */
455message ProcessMemoryStatReported {
456 optional int32 uid = 1;
457 optional string process_name = 2;
458 optional string package_name = 3;
459 //TODO: remove this when validation is done
460 optional int64 version = 9;
461 optional int64 pss = 4;
462 optional int64 uss = 5;
463 optional int64 rss = 6;
464 enum Type {
465 ADD_PSS_INTERNAL_SINGLE = 0;
466 ADD_PSS_INTERNAL_ALL_MEM = 1;
467 ADD_PSS_INTERNAL_ALL_POLL = 2;
468 ADD_PSS_EXTERNAL = 3;
469 ADD_PSS_EXTERNAL_SLOW = 4;
470 }
471 optional Type type = 7;
472 optional int64 duration = 8;
473}
474
475/**
Bookatzc1a050a2017-10-10 15:49:28 -0700476 * Logs that a process started, finished, crashed, or ANRed.
477 *
478 * Logged from:
479 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
480 */
481message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700482 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700483
David Chen0b5c90c2018-01-25 16:51:49 -0800484 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800485 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700486
Bookatzddccf0a2017-11-28 16:48:14 -0800487 // What lifecycle state the process changed to.
488 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800489 enum State {
490 FINISHED = 0;
491 STARTED = 1;
492 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800493 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800494 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700495}
496
Bookatzc1a050a2017-10-10 15:49:28 -0700497/**
498 * Logs when the ble scan state changes.
499 *
500 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700501 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700502 */
503message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800504 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700505
506 enum State {
507 OFF = 0;
508 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700509 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
510 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700511 }
512 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700513
Bookatze5ec0b42018-03-26 13:34:56 -0700514 // Does the scan have a filter.
515 optional bool is_filtered = 3;
516 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
517 optional bool is_first_match = 4;
518 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
519 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700520}
521
522/**
523 * Logs reporting of a ble scan finding results.
524 *
525 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700526 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700527 */
Bookatzae6738e2018-09-13 11:38:56 -0700528// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700529message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800530 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700531
532 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800533 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700534}
535
536/**
537 * Logs when a sensor state changes.
538 *
539 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700540 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700541 */
542message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800543 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700544
Bookatzc1a050a2017-10-10 15:49:28 -0700545 // The id (int) of the sensor.
546 optional int32 sensor_id = 2;
547
548 enum State {
549 OFF = 0;
550 ON = 1;
551 }
552 optional State state = 3;
553}
554
Bookatzc1a050a2017-10-10 15:49:28 -0700555/**
556 * Logs when GPS state changes.
557 *
558 * Logged from:
559 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
560 */
561message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800562 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700563
564 enum State {
565 OFF = 0;
566 ON = 1;
567 }
568 optional State state = 2;
569}
570
Bookatz48d362e2018-11-06 15:49:08 -0800571/**
572 * Logs when GPS signal quality.
573 *
574 * Logged from:
575 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
576 */
577message GpsSignalQualityChanged {
578 optional android.server.location.GpsSignalQualityEnum level = 1;
579}
580
Bookatzc1a050a2017-10-10 15:49:28 -0700581
582/**
583 * Logs when a sync manager sync state changes.
584 *
585 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700586 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700587 */
588message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800589 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700590
David Chen0b5c90c2018-01-25 16:51:49 -0800591 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800592 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700593
594 enum State {
595 OFF = 0;
596 ON = 1;
597 }
598 optional State state = 3;
599}
600
Yangster-mac96353002018-09-05 11:18:55 -0700601/*
602 * Deferred job stats.
603 *
604 * Logged from:
605 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
606*/
607message DeferredJobStatsReported {
608 repeated AttributionNode attribution_node = 1;
609
610 // Number of jobs deferred.
611 optional int32 num_jobs_deferred = 2;
612
613 // Time since the last job runs.
614 optional int64 time_since_last_job_millis = 3;
615}
616
Bookatzc1a050a2017-10-10 15:49:28 -0700617/**
618 * Logs when a job scheduler job state changes.
619 *
620 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700621 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700622 */
623message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800624 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700625
626 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800627 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700628
629 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800630 FINISHED = 0;
631 STARTED = 1;
632 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700633 }
634 optional State state = 3;
635
Tej Singh33a412b2018-03-16 18:43:59 -0700636 // The reason a job has stopped.
637 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700638 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700639 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700640}
641
642/**
643 * Logs when the audio state changes.
644 *
645 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700646 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700647 */
648message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800649 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700650
651 enum State {
652 OFF = 0;
653 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700654 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
655 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700656 }
657 optional State state = 2;
658}
659
660/**
661 * Logs when the video codec state changes.
662 *
663 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700664 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700665 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800666message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800667 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700668
669 enum State {
670 OFF = 0;
671 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700672 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
673 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700674 }
675 optional State state = 2;
676}
677
678/**
679 * Logs when the flashlight state changes.
680 *
681 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700682 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700683 */
684message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800685 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700686
687 enum State {
688 OFF = 0;
689 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700690 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
691 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700692 }
693 optional State state = 2;
694}
695
696/**
697 * Logs when the camera state changes.
698 *
699 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700700 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700701 */
702message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800703 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700704
705 enum State {
706 OFF = 0;
707 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700708 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
709 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700710 }
711 optional State state = 2;
712}
713
714/**
715 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000716 *
717 * Logged from:
718 * TODO
719 */
Bookatzd6746242017-10-24 18:39:35 -0700720message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800721 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000722
Bookatz1a1b0462018-01-12 11:47:03 -0800723 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
724 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700725 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700726
727 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
728 optional string tag = 3;
729
730 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800731 RELEASE = 0;
732 ACQUIRE = 1;
733 CHANGE_RELEASE = 2;
734 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700735 }
736 optional State state = 4;
737}
738
739/**
Bookatzc1a050a2017-10-10 15:49:28 -0700740 * Logs when a partial wakelock is considered 'long' (over 1 min).
741 *
742 * Logged from:
743 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
744 */
745message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800746 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700747
Yao Chend54f9dd2017-10-17 17:37:48 +0000748 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
749 optional string tag = 2;
750
Bookatzc1a050a2017-10-10 15:49:28 -0700751 // TODO: I have no idea what this is.
752 optional string history_tag = 3;
753
754 enum State {
755 OFF = 0;
756 ON = 1;
757 }
758 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000759}
760
Bookatzc1a050a2017-10-10 15:49:28 -0700761/**
Bookatza66083f2018-09-20 17:24:00 -0700762 * Logs when the device is interactive, according to the PowerManager Notifier.
763 *
764 * Logged from:
765 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
766 */
767message InteractiveStateChanged {
768 enum State {
769 OFF = 0;
770 ON = 1;
771 }
772 optional State state = 1;
773}
774
775/**
Bookatzc1a050a2017-10-10 15:49:28 -0700776 * Logs Battery Saver state change.
777 *
778 * Logged from:
779 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
780 */
781message BatterySaverModeStateChanged {
782 enum State {
783 OFF = 0;
784 ON = 1;
785 }
786 optional State state = 1;
787}
788
789/**
790 * Logs Doze mode state change.
791 *
792 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800793 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700794 */
795message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800796 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800797}
798
799
800/**
801 * Logs state change of Doze mode including maintenance windows.
802 *
803 * Logged from:
804 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
805 */
806message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800807 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700808}
809
810/**
811 * Logs screen brightness level.
812 *
813 * Logged from:
814 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
815 */
816message ScreenBrightnessChanged {
817 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
818 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700819}
820
821/**
822 * Logs battery level (percent full, from 0 to 100).
823 *
824 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700825 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700826 */
827message BatteryLevelChanged {
828 // Battery level. Should be in [0, 100].
829 optional int32 battery_level = 1;
830}
831
832/**
833 * Logs change in charging status of the device.
834 *
835 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700836 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700837 */
838message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800839 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
840 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700841}
842
843/**
844 * Logs whether the device is plugged in, and what power source it is using.
845 *
846 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700847 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700848 */
849message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800850 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
851 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700852}
853
Bookatz8c6571b2017-10-24 15:04:41 -0700854/**
855 * Logs when an app's wakeup alarm fires.
856 *
857 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700858 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700859 */
860message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800861 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800862
863 // Name of the wakeup alarm.
864 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700865
866 // Name of source package (for historical reasons, since BatteryStats tracked it).
867 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800868}
869
870/**
871 * Logs when an an app causes the mobile radio to change state.
872 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
873 *
874 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700875 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800876 */
877message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800878 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800879
Bookatz1a1b0462018-01-12 11:47:03 -0800880 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
881 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800882}
883
884/**
885 * Logs when an an app causes the wifi radio to change state.
886 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
887 *
888 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700889 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800890 */
891message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800892 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800893
Bookatz1a1b0462018-01-12 11:47:03 -0800894 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
895 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700896}
897
898/**
899 * Logs kernel wakeup reasons and aborts.
900 *
901 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700902 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700903 */
904message KernelWakeupReported {
905 // Name of the kernel wakeup reason (or abort).
906 optional string wakeup_reason_name = 1;
907
908 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800909 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700910}
911
912/**
Bookatzda1798c2018-12-13 14:16:00 -0800913 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800914 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800915 *
916 * Logged from:
917 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
918 */
919message WifiEnabledStateChanged {
920 enum State {
921 OFF = 0;
922 ON = 1;
923 }
924 optional State state = 1;
925}
926
927/**
928 * 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 -0800929 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
930 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800931 *
932 * Logged from:
933 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
934 */
935message WifiRunningStateChanged {
936 repeated AttributionNode attribution_node = 1;
937
938 enum State {
939 OFF = 0;
940 ON = 1;
941 }
942 optional State state = 2;
943}
944
945/**
Bookatze5885242017-10-24 20:10:31 -0700946 * Logs wifi locks held by an app.
947 *
948 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700949 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700950 */
951message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800952 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700953
954 enum State {
955 OFF = 0;
956 ON = 1;
957 }
958 optional State state = 2;
959}
960
961/**
962 * Logs wifi signal strength changes.
963 *
964 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800965 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700966 */
967message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800968 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
969 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700970}
971
972/**
973 * Logs wifi scans performed by an app.
974 *
975 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800976 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700977 */
978message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800979 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700980
981 enum State {
982 OFF = 0;
983 ON = 1;
984 }
985 optional State state = 2;
986}
987
988/**
Tej Singh4503e102018-01-04 14:35:01 -0800989 * Logs wifi multicast locks held by an app
990 *
991 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800992 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -0800993 */
994message WifiMulticastLockStateChanged {
995 repeated AttributionNode attribution_node = 1;
996
997 enum State {
998 OFF = 0;
999 ON = 1;
1000 }
1001 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001002
1003 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001004}
1005
1006/**
Tej Singh1ea42892018-01-19 09:27:00 -08001007 * Logs shutdown reason and duration on next boot.
1008 *
1009 * Logged from:
1010 * frameworks/base/core/java/com/android/server/BootReceiver.java
1011 */
1012message ShutdownSequenceReported {
1013 // True if shutdown is for a reboot. Default: false if we do not know.
1014 optional bool reboot = 1;
1015
1016 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1017 optional string reason = 2;
1018
1019 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1020 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001021 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001022
1023 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001024 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001025}
1026
Tej Singh6483ea42018-01-25 17:45:49 -08001027
1028/**
1029 * Logs boot reason and duration.
1030 *
1031 * Logged from:
1032 * system/core/bootstat/bootstat.cpp
1033 */
1034message BootSequenceReported {
1035 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1036 // Default: "<EMPTY>" if not available.
1037 optional string bootloader_reason = 1;
1038
1039 // Reason for system boot. Eg. bootloader, reboot,userrequested
1040 // Default: "<EMPTY>" if not available.
1041 optional string system_reason = 2;
1042
1043 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001044 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001045
1046 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001047 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001048
1049 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001050 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001051
1052 // Time since last boot in ms. Default: 0 if not available.
1053 optional int64 time_since_last_boot = 6;
1054}
1055
Tej Singhc477d9c2018-02-05 18:31:39 -08001056
1057/**
1058 * Logs call state and disconnect cause (if applicable).
1059 *
1060 * Logged from:
1061 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1062 */
1063message CallStateChanged {
1064 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1065 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1066 optional android.telecom.CallStateEnum call_state = 1;
1067
1068 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1069 // This value is only applicable when the call_state is DISCONNECTED, and
1070 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1071 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1072 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1073
1074 // True if the call is self-managed, which are apps that use the
1075 // telecom infrastructure to make their own calls.
1076 optional bool self_managed = 3;
1077
1078 // True if call is external. External calls are calls on connected Wear
1079 // devices but show up in Telecom so the user can pull them onto the device.
1080 optional bool external_call = 4;
1081}
1082
Tej Singh1ea42892018-01-19 09:27:00 -08001083/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001084 * Logs keyguard state. The keyguard is the lock screen.
1085 *
1086 * Logged from:
1087 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1088 */
1089message KeyguardStateChanged {
1090 enum State {
1091 UNKNOWN = 0;
1092 // The keyguard is hidden when the phone is unlocked.
1093 HIDDEN = 1;
1094 // The keyguard is shown when the phone is locked (screen turns off).
1095 SHOWN= 2;
1096 // The keyguard is occluded when something is overlaying the keyguard.
1097 // Eg. Opening the camera while on the lock screen.
1098 OCCLUDED = 3;
1099 }
1100 optional State state = 1;
1101}
1102
1103/**
1104 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1105 * prompts the user to enter a password (pattern, pin, etc).
1106 *
1107 * Logged from:
1108 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1109 */
1110
1111message KeyguardBouncerStateChanged {
1112 enum State {
1113 UNKNOWN = 0;
1114 // Bouncer is hidden, either as a result of successfully entering the
1115 // password, screen timing out, or user going back to lock screen.
1116 HIDDEN = 1;
1117 // This is when the user is being prompted to enter the password.
1118 SHOWN = 2;
1119 }
1120 optional State state = 1;
1121}
1122
1123/**
1124 * Logs the result of entering a password into the keyguard bouncer.
1125 *
1126 * Logged from:
1127 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1128 */
1129message KeyguardBouncerPasswordEntered {
1130 enum BouncerResult {
1131 UNKNOWN = 0;
1132 // The password entered was incorrect.
1133 FAILURE = 1;
1134 // The password entered was correct.
1135 SUCCESS = 2;
1136 }
1137 optional BouncerResult result = 1;
1138}
1139
Tej Singha883b372018-02-15 11:30:01 -08001140/*
1141 * Logs changes to the configuration of the device. The configuration is defined
1142 * in frameworks/base/core/java/android/content/res/Configuration.java
1143 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1144 * Please go there to interpret the possible values each field can be.
1145 *
1146 * Logged from:
1147 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1148 */
1149message ResourceConfigurationChanged {
1150 // Bit mask of color capabilities of the screen.
1151 // Contains information about the color gamut and hdr mode of the screen.
1152 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001153 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001154
1155 // The target screen density being rendered to.
1156 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001157 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001158
1159 // Current user preference for the scaling factor for fonts,
1160 // relative to the base density scaling.
1161 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001162 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001163
1164 // Flag indicating whether the hard keyboard is hidden.
1165 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001166 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001167
1168 // The type of keyboard attached to the device.
1169 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1170 optional int32 keyboard = 5;
1171
1172 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1173 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001174 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001175
1176 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1177 // 0 if undefined.
1178 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1179 optional int32 mcc = 7;
1180
1181 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1182 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1183 // MNC_ZERO symbol defined in Configuration.java.
1184 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1185 optional int32 mnc = 8;
1186
1187 // The kind of navigation available on the device.
1188 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1189 optional int32 navigation = 9;
1190
1191 // Flag indicating whether the navigation is available.
1192 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001193 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001194
1195 // Overall orientation of the screen.
1196 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1197 optional int32 orientation = 11;
1198
1199 // The current height of the available screen space, in dp units.
1200 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001201 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001202
1203 // Bit mask of overall layout of the screen.
1204 // Contains information about screen size, whether the screen is wider/taller
1205 // than normal, whether the screen layout is right-tl-left or left-to-right,
1206 // and whether the screen has a rounded shape.
1207 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001208 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001209
1210 // Current width of the available screen space, in dp units.
1211 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001212 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001213
1214 // The smallest screen size an application will see in normal operation.
1215 // This is the smallest value of both screenWidthDp and screenHeightDp
1216 // in portrait and landscape.
1217 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001218 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001219
1220 // The type of touch screen attached to the device.
1221 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1222 optional int32 touchscreen = 16;
1223
1224 // Bit mask of the ui mode.
1225 // Contains information about the overall ui mode of the device.
1226 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1227 // Also contains information about whether the device is in night mode.
1228 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001229 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001230}
1231
Tej Singheee317b2018-03-07 19:28:05 -08001232
1233/**
1234 * Logs changes in the connection state of the mobile radio.
1235 *
1236 * Logged from:
1237 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1238 */
1239message MobileConnectionStateChanged {
1240 // States are from the state machine DataConnection.java.
1241 enum State {
1242 UNKNOWN = 0;
1243 // The connection is inactive, or disconnected.
1244 INACTIVE = 1;
1245 // The connection is being activated, or connecting.
1246 ACTIVATING = 2;
1247 // The connection is active, or connected.
1248 ACTIVE = 3;
1249 // The connection is disconnecting.
1250 DISCONNECTING = 4;
1251 // The connection is disconnecting after creating a connection.
1252 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1253 }
1254 optional State state = 1;
1255 // For multi-sim phones, this distinguishes between the sim cards.
1256 optional int32 sim_slot_index = 2;
1257 // Used to identify the connection. Starts at 0 and increments by 1 for
1258 // every new network created. Resets whenever the device reboots.
1259 optional int32 data_connection_id = 3;
1260 // A bitmask for the capabilities of this connection.
1261 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1262 // Default value (if we have no information): 0
1263 optional int64 capabilities = 4;
1264 // If this connection has internet.
1265 // This just checks if the DEFAULT bit of capabilities is set.
1266 optional bool has_internet = 5;
1267}
1268
1269/**
1270 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1271 *
1272 * Logged from:
1273 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1274 */
1275message MobileRadioTechnologyChanged {
1276 optional android.telephony.NetworkTypeEnum state = 1;
1277 // For multi-sim phones, this distinguishes between the sim cards.
1278 optional int32 sim_slot_index = 2;
1279}
1280
Andrew Chantb56388b2018-03-22 21:07:33 -07001281/**
1282 * Logs the VID and PID of any connected USB devices.
1283 *
1284 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1285 *
1286 * Logged by Vendor.
1287 */
1288message UsbDeviceAttached {
1289 optional int32 vid = 1;
1290 optional int32 pid = 2;
1291 optional bool has_audio = 3;
1292 optional bool has_hid = 4;
1293 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001294 enum State {
1295 STATE_DISCONNECTED = 0;
1296 STATE_CONNECTED = 1;
1297 }
1298 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001299 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001300}
1301
Tej Singheee317b2018-03-07 19:28:05 -08001302
Tej Singhdd7bd352018-02-09 19:33:15 -08001303/**
Tej Singh5d991e12018-03-09 19:48:11 -08001304 * Logs when Bluetooth is enabled and disabled.
1305 *
1306 * Logged from:
1307 * services/core/java/com/android/server/BluetoothManagerService.java
1308 */
1309message BluetoothEnabledStateChanged {
1310 repeated AttributionNode attribution_node = 1;
1311 // Whether or not bluetooth is enabled on the device.
1312 enum State {
1313 UNKNOWN = 0;
1314 ENABLED = 1;
1315 DISABLED = 2;
1316 }
1317 optional State state = 2;
1318 // The reason for being enabled/disabled.
1319 // Eg. Airplane mode, crash, application request.
1320 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1321 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001322 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001323}
1324
1325/**
Jack Hed9837c82019-01-09 01:19:13 -08001326 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001327 *
1328 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001329 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1330 *
1331 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001332 */
1333message BluetoothConnectionStateChanged {
1334 // The state of the connection.
1335 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1336 optional android.bluetooth.ConnectionStateEnum state = 1;
1337 // An identifier that can be used to match connect and disconnect events.
1338 // Currently is last two bytes of a hash of a device level ID and
1339 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001340 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1341 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001342 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1343 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001344 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001345 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001346 // An identifier that can be used to match events for this device.
1347 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1348 // Salt: Randomly generated 256 bit value
1349 // Hash algorithm: HMAC-SHA256
1350 // Size: 32 byte
1351 // Default: null or empty if the device identifier is not known
1352 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1353}
1354
1355/**
1356 * Logs when a Bluetooth device connects and disconnects over ACL
1357 *
1358 * Logged from:
1359 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1360 *
1361 * Next Tag: 3
1362 */
1363message BluetoothAclConnectionStateChanged {
1364 // An identifier that can be used to match events for this device.
1365 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1366 // Salt: Randomly generated 256 bit value
1367 // Hash algorithm: HMAC-SHA256
1368 // Size: 32 byte
1369 // Default: null or empty if the device identifier is not known
1370 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1371 // The state of the connection.
1372 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1373 optional android.bluetooth.ConnectionStateEnum state = 2;
1374}
1375
1376/**
1377 * Logs when a Bluetooth device connects and disconnects over SCO
1378 *
1379 * Logged from:
1380 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1381 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1382 *
1383 * Next Tag: 4
1384 */
1385message BluetoothScoConnectionStateChanged {
1386 // An identifier that can be used to match events for this device.
1387 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1388 // Salt: Randomly generated 256 bit value
1389 // Hash algorithm: HMAC-SHA256
1390 // Size: 32 byte
1391 // Default: null or empty if the device identifier is not known
1392 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1393 // The state of the connection.
1394 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1395 optional android.bluetooth.ConnectionStateEnum state = 2;
1396 // Codec used for this SCO connection
1397 // Default: UNKNOWN
1398 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001399}
1400
Jack Heab86dbd22018-12-18 15:43:27 -08001401// Logs when there is an event affecting Bluetooth device's link layer connection.
1402// - This event is triggered when there is a related HCI command or event
1403// - Users of this metrics can deduce Bluetooth device's connection state from these events
1404// - HCI commands are logged before the command is sent, after receiving command status, and after
1405// receiving command complete
1406// - HCI events are logged when they arrive
1407//
1408// Low level log from system/bt
1409//
1410// Bluetooth classic commands:
1411// - CMD_CREATE_CONNECTION
1412// - CMD_DISCONNECT
1413// - CMD_CREATE_CONNECTION_CANCEL
1414// - CMD_ACCEPT_CONNECTION_REQUEST
1415// - CMD_REJECT_CONNECTION_REQUEST
1416// - CMD_SETUP_ESCO_CONNECTION
1417// - CMD_ACCEPT_ESCO_CONNECTION
1418// - CMD_REJECT_ESCO_CONNECTION
1419// - CMD_ENH_SETUP_ESCO_CONNECTION
1420// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1421//
1422// Bluetooth low energy commands:
1423// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1424// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1425// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1426// - CMD_BLE_CLEAR_WHITE_LIST
1427// - CMD_BLE_ADD_WHITE_LIST
1428// - CMD_BLE_REMOVE_WHITE_LIST
1429//
1430// Bluetooth classic events:
1431// - EVT_CONNECTION_COMP
1432// - EVT_CONNECTION_REQUEST
1433// - EVT_DISCONNECTION_COMP
1434// - EVT_ESCO_CONNECTION_COMP
1435// - EVT_ESCO_CONNECTION_CHANGED
1436//
1437// Bluetooth low energy meta events:
1438// - BLE_EVT_CONN_COMPLETE_EVT
1439// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1440//
1441// Next tag: 10
1442message BluetoothLinkLayerConnectionEvent {
1443 // An identifier that can be used to match events for this device.
1444 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1445 // Salt: Randomly generated 256 bit value
1446 // Hash algorithm: HMAC-SHA256
1447 // Size: 32 byte
1448 // Default: null or empty if the device identifier is not known
1449 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1450 // Connection handle of this connection if available
1451 // Range: 0x0000 - 0x0EFF (12 bits)
1452 // Default: 0xFFFF if the handle is unknown
1453 optional int32 connection_handle = 2;
1454 // Direction of the link
1455 // Default: DIRECTION_UNKNOWN
1456 optional android.bluetooth.DirectionEnum direction = 3;
1457 // Type of this link
1458 // Default: LINK_TYPE_UNKNOWN
1459 optional android.bluetooth.LinkTypeEnum type = 4;
1460
1461 // Reason metadata for this link layer connection event, rules for interpretation:
1462 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1463 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1464 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1465 // set and valid, ignore hci_ble_event
1466
1467 // HCI command associated with this event
1468 // Default: CMD_UNKNOWN
1469 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1470 // HCI event associated with this event
1471 // Default: EVT_UNKNOWN
1472 optional android.bluetooth.hci.EventEnum hci_event = 6;
1473 // HCI BLE meta event associated with this event
1474 // Default: BLE_EVT_UNKNOWN
1475 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1476 // HCI command status code if this is triggerred by hci_cmd
1477 // Default: STATUS_UNKNOWN
1478 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1479 // HCI reason code associated with this event
1480 // Default: STATUS_UNKNOWN
1481 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1482}
1483
1484
Tej Singh5d991e12018-03-09 19:48:11 -08001485/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001486 * Logs when something is plugged into or removed from the USB-C connector.
1487 *
1488 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001489 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001490 */
1491message UsbConnectorStateChanged {
1492 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001493 STATE_DISCONNECTED = 0;
1494 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001495 }
1496 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001497 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001498 // Last active session in ms.
1499 // 0 when the port is in connected state.
1500 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001501}
1502
1503/**
1504 * Logs the reported speaker impedance.
1505 *
1506 * Logged from:
1507 * Vendor audio implementation.
1508 */
1509message SpeakerImpedanceReported {
1510 optional int32 speaker_location = 1;
1511 optional int32 impedance = 2;
1512}
1513
1514/**
1515 * Logs the report of a failed hardware.
1516 *
1517 * Logged from:
1518 * Vendor HALs.
1519 *
1520 */
1521message HardwareFailed {
1522 enum HardwareType {
1523 HARDWARE_FAILED_UNKNOWN = 0;
1524 HARDWARE_FAILED_MICROPHONE = 1;
1525 HARDWARE_FAILED_CODEC = 2;
1526 HARDWARE_FAILED_SPEAKER = 3;
1527 HARDWARE_FAILED_FINGERPRINT = 4;
1528 }
1529 optional HardwareType hardware_type = 1;
1530
1531 /* hardware_location allows vendors to differentiate between multiple instances of
1532 * the same hardware_type. The specific locations are vendor defined integers,
1533 * referring to board-specific numbering schemes.
1534 */
1535 optional int32 hardware_location = 2;
1536
1537 /* failure_code is specific to the HardwareType of the failed hardware.
1538 * It should use the enum values defined below.
1539 */
1540 enum MicrophoneFailureCode {
1541 MICROPHONE_FAILURE_COMPLETE = 0;
1542 }
1543 enum CodecFailureCode {
1544 CODEC_FAILURE_COMPLETE = 0;
1545 }
1546 enum SpeakerFailureCode {
1547 SPEAKER_FAILURE_COMPLETE = 0;
1548 SPEAKER_FAILURE_HIGH_Z = 1;
1549 SPEAKER_FAILURE_SHORT = 2;
1550 }
1551 enum FingerprintFailureCode {
1552 FINGERPRINT_FAILURE_COMPLETE = 0;
1553 FINGERPRINT_SENSOR_BROKEN = 1;
1554 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1555 }
1556 optional int32 failure_code = 3;
1557}
1558
1559/**
1560 * Log an event when the device has been physically dropped.
1561 * Reported from the /vendor partition.
1562 */
1563message PhysicalDropDetected {
1564 // Confidence that the event was actually a drop, 0 -> 100
1565 optional int32 confidence_pctg = 1;
1566 // Peak acceleration of the drop, in 1/1000s of a g.
1567 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001568 // Duration of freefall in ms
1569 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001570}
1571
1572/**
1573 * Log bucketed battery charge cycles.
1574 *
1575 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001576 * a given charge point. For example, if 10 cycle buckets are
1577 * initialized, bucket 1 is the lowest 1/10th of the battery,
1578 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001579 *
1580 * Logged from:
1581 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1582 */
1583message ChargeCyclesReported {
1584 optional int32 cycle_bucket_1 = 1;
1585 optional int32 cycle_bucket_2 = 2;
1586 optional int32 cycle_bucket_3 = 3;
1587 optional int32 cycle_bucket_4 = 4;
1588 optional int32 cycle_bucket_5 = 5;
1589 optional int32 cycle_bucket_6 = 6;
1590 optional int32 cycle_bucket_7 = 7;
1591 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001592 optional int32 cycle_bucket_9 = 9;
1593 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001594}
1595
1596/**
Howard Roa46b6582018-09-18 16:45:02 -07001597 * Log battery health snapshot.
1598 *
1599 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1600 * are snapshotted periodically over 24hrs.
1601 */
1602message BatteryHealthSnapshot {
1603 enum BatterySnapshotType {
1604 UNKNOWN = 0;
1605 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1606 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1607 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1608 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1609 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1610 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1611 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1612 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1613 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1614 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1615 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1616 }
1617 optional BatterySnapshotType type = 1;
1618 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001619 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001620 // Voltage Battery Voltage, in microVolts.
1621 optional int32 voltage_micro_volt = 3;
1622 // Current Battery current, in microAmps.
1623 optional int32 current_micro_amps = 4;
1624 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1625 optional int32 open_circuit_micro_volt = 5;
1626 // Resistance Battery Resistance, in microOhms.
1627 optional int32 resistance_micro_ohm = 6;
1628 // Level Battery Level, as % of full.
1629 optional int32 level_percent = 7;
1630}
1631
1632/**
1633 * Log slow I/O operations on the primary storage.
1634 */
1635message SlowIo {
1636 // Classifications of IO Operations.
1637 enum IoOperation {
1638 UNKNOWN = 0;
1639 READ = 1;
1640 WRITE = 2;
1641 UNMAP = 3;
1642 SYNC = 4;
1643 }
1644 optional IoOperation operation = 1;
1645
1646 // The number of slow IO operations of this type over 24 hours.
1647 optional int32 count = 2;
1648}
1649
1650/**
1651 * Log battery caused shutdown with the last recorded voltage.
1652 */
1653message BatteryCausedShutdown {
1654 // The last recorded battery voltage prior to shutdown.
1655 optional int32 last_recorded_micro_volt = 1;
1656}
1657
1658/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001659 * Logs the duration of a davey (jank of >=700ms) when it occurs
1660 *
1661 * Logged from:
1662 * frameworks/base/libs/hwui/JankTracker.cpp
1663 */
1664message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001665 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001666 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001667
Tej Singhbb8554a2018-01-26 11:59:14 -08001668 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001669 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001670}
1671
1672/**
Bookatze5885242017-10-24 20:10:31 -07001673 * Logs phone signal strength changes.
1674 *
1675 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001676 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001677 */
1678message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001679 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1680 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001681}
1682
Yangster4ccebea2018-10-09 17:09:02 -07001683
1684/**
1685 * Logs when the phone state, sim state or signal strength changes
1686 *
1687 * Logged from:
1688 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1689 */
1690message PhoneServiceStateChanged {
1691 optional android.telephony.ServiceStateEnum state = 1;
1692 optional android.telephony.SimStateEnum sim_state = 2;
1693 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1694}
1695
1696/**
1697 * Logs when the phone becomes on or off.
1698 *
1699 * Logged from:
1700 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1701 */
1702message PhoneStateChanged {
1703 enum State {
1704 OFF = 0;
1705 ON = 1;
1706 }
1707 optional State state = 1;
1708}
1709
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001710message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001711 optional android.stats.launcher.LauncherAction action = 1;
1712 optional android.stats.launcher.LauncherState src_state = 2;
1713 optional android.stats.launcher.LauncherState dst_state = 3;
1714 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001715 optional bool is_swipe_up_enabled = 5;
1716}
1717
David Chenc28b2bb2017-10-24 12:52:52 -07001718/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001719 * Logs when Settings UI has changed.
1720 *
1721 * Logged from:
1722 * packages/apps/Settings
1723 */
1724message SettingsUIChanged {
1725 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001726 * Where this SettingsUIChange event comes from. For example, if
1727 * it's a PAGE_VISIBLE event, where the page is opened from.
1728 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001729 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001730
1731 /**
1732 * What the UI action is.
1733 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001734 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001735
1736 /**
1737 * Where the action is happening
1738 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001739 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001740
1741 /**
1742 * What preference changed in this event.
1743 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001744 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001745
1746 /**
1747 * The new value of the changed preference.
1748 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001749 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001750}
1751
1752/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08001753 * Logs basic timing information about touch events.
1754 * Reported at most every 5 minutes while device is being interacted with.
1755 *
1756 * Logged from:
1757 * frameworks/native/services/inputflinger
1758 */
1759message TouchEventReported {
1760 /**
1761 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
1762 * and the standard deviation of latency between the kernel and framework
1763 * for touchscreen events. The units are microseconds.
1764 *
1765 * The number is measured as the difference between the time at which
1766 * the input event was received in the evdev driver,
1767 * and the time at which the input event was received in EventHub.
1768 */
1769 // Minimum value
1770 optional float latency_min_micros = 1;
1771 // Maximum value
1772 optional float latency_max_micros = 2;
1773 // Average value
1774 optional float latency_mean_micros = 3;
1775 // Standard deviation
1776 optional float latency_stdev_micros = 4;
1777}
1778
1779/**
David Chenc28b2bb2017-10-24 12:52:52 -07001780 * Logs that a setting was updated.
1781 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001782 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001783 * The tag and is_default allow resetting of settings to default values based on the specified
1784 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1785 */
1786message SettingChanged {
1787 // The name of the setting.
1788 optional string setting = 1;
1789
1790 // The change being imposed on this setting. May represent a number, eg "3".
1791 optional string value = 2;
1792
1793 // The new value of this setting. For most settings, this is same as value. For some settings,
1794 // value is +X or -X where X represents an element in a set. For example, if the previous value
1795 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1796 // The +/- feature is currently only used for location_providers_allowed.
1797 optional string new_value = 3;
1798
1799 // The previous value of this setting.
1800 optional string prev_value = 4;
1801
1802 // The tag used with the is_default for resetting sets of settings. This is generally null.
1803 optional string tag = 5;
1804
Bookatz90867622018-01-31 15:05:57 -08001805 // True if this setting with tag should be resettable.
1806 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001807
David Chenbd789912018-03-16 17:19:55 -07001808 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001809 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001810
1811 enum ChangeReason {
1812 UPDATED = 1; // Updated can be an insertion or an update.
1813 DELETED = 2;
1814 }
1815 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001816}
Chenjie Yub3dda412017-10-24 13:41:59 -07001817
Chenjie Yu05013b32017-11-21 10:21:41 -08001818/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001819 * Logs activity going to foreground or background
1820 *
1821 * Logged from:
1822 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1823 */
1824message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001825 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001826 optional string pkg_name = 2;
1827 optional string class_name = 3;
1828
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001829 enum State {
1830 BACKGROUND = 0;
1831 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001832 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001833 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001834}
David Chenc8a43242017-10-17 16:23:28 -07001835
1836/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00001837 * Logs when a volume entered low Storage state.
1838 * Logged from:
1839 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
1840 */
1841message LowStorageStateChanged {
1842 // Volume that ran out of storage.
1843 optional string volume_description = 1;
1844
1845 enum State {
1846 UNKNOWN = 0;
1847 OFF = 1;
1848 ON = 2;
1849 }
1850 optional State state = 2;
1851}
1852
1853/**
1854 * Logs when an app is downgraded.
1855 * Logged from:
1856 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1857 */
1858message AppDowngraded {
1859 optional string package_name = 1;
1860 // Size of the package (all data) before being downgraded.
1861 optional int64 size_in_bytes_before = 2;
1862 // Size of the package (all data) after being downgraded.
1863 optional int64 size_in_bytes_after = 3;
1864
1865 optional bool aggressive = 4;
1866}
1867
1868/**
1869 * Logs when an app is optimized after being downgraded.
1870 * Logged from:
1871 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1872 */
1873message AppOptimizedAfterDowngraded {
1874 optional string package_name = 1;
1875}
1876
1877/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001878 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001879 * Logged from:
1880 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1881 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001882message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001883 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001884
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001885 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001886
1887 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001888 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001889 optional string process_name = 3;
1890
1891 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001892 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001893
1894 optional string package_name = 5;
1895
1896 enum InstantApp {
1897 UNAVAILABLE = 0;
1898 FALSE = 1;
1899 TRUE = 2;
1900 }
1901 optional InstantApp is_instant_app = 6;
1902
1903 enum ForegroundState {
1904 UNKNOWN = 0;
1905 BACKGROUND = 1;
1906 FOREGROUND = 2;
1907 }
1908 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001909
1910 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001911}
David Chen9e3808c2017-11-20 17:25:34 -08001912
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001913/**
1914 * Logs when a WTF (What a Terrible Failure) happened.
1915 * Logged from:
1916 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1917 */
1918message WTFOccurred {
1919 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001920
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001921 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001922
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001923 // The name of the process.
1924 // system_server if it is not by an app
1925 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001926
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001927 // The pid if available. -1 means not available.
1928 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001929
1930 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001931}
1932
1933/**
1934 * Logs when system server reports low memory.
1935 * Logged from:
1936 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1937 */
1938message LowMemReported {
1939}
1940
1941/**
1942 * Logs when an app ANR (App Not Responding) occurs.
1943 * Logged from:
1944 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1945 */
1946message ANROccurred {
1947 optional int32 uid = 1 [(is_uid) = true];
1948
1949 optional string process_name = 2;
1950
1951 optional string short_component_name = 3;
1952
1953 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001954
1955 enum InstantApp {
1956 UNAVAILABLE = 0;
1957 FALSE = 1;
1958 TRUE = 2;
1959 }
1960 optional InstantApp is_instant_app = 5;
1961
1962 enum ForegroundState {
1963 UNKNOWN = 0;
1964 BACKGROUND = 1;
1965 FOREGROUND = 2;
1966 }
1967 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001968
1969 optional android.server.ErrorSource error_source = 7;
1970
1971 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001972}
1973
Bookatza7020bd2018-08-28 16:29:35 -07001974/**
1975 * Logs when the vibrator state changes.
1976 * Logged from:
1977 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1978 */
1979message VibratorStateChanged {
1980 repeated AttributionNode attribution_node = 1;
1981
1982 enum State {
1983 OFF = 0;
1984 ON = 1;
1985 }
1986 optional State state = 2;
1987
1988 // Duration (in milliseconds) requested to keep the vibrator on.
1989 // Only applicable for State == ON.
1990 optional int64 duration_millis = 3;
1991}
1992
David Chen0a368b22017-12-06 16:28:16 -08001993/*
1994 * Allows other apps to push events into statsd.
1995 * Logged from:
1996 * frameworks/base/core/java/android/util/StatsLog.java
1997 */
David Chen0b5c90c2018-01-25 16:51:49 -08001998message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001999 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002000 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002001
2002 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2003 optional int32 label = 2;
2004
2005 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2006 // predicates for the metrics).
2007 enum State {
2008 UNKNOWN = 0;
2009 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2010 STOP = 2;
2011 START = 3;
2012 }
2013 optional State state = 3;
2014}
2015
David Chen9e3808c2017-11-20 17:25:34 -08002016/**
Bookatz7948c872018-09-04 12:58:33 -07002017 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2018 * For example, this could be due to the user manually changing the time.
2019 *
2020 * Logged from:
2021 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2022 */
2023message WallClockTimeShifted {
2024 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2025 optional int64 wall_clock_timestamp_millis = 1;
2026}
2027
2028/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002029 * Logs when statsd detects an anomaly.
2030 *
2031 * Logged from:
2032 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2033 */
2034message AnomalyDetected {
2035 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002036 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002037
Yangster-mac94e197c2018-01-02 16:03:03 -08002038 // Id of the config whose anomaly detection alert fired.
2039 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002040
Yangster-mac94e197c2018-01-02 16:03:03 -08002041 // Id of the alert (i.e. name of the anomaly that was detected).
2042 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002043}
2044
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002045message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002046 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002047 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002048
2049 // The app package name.
2050 optional string pkg_name = 2;
2051
2052 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002053 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002054 WARM = 1;
2055 HOT = 2;
2056 COLD = 3;
2057 }
2058 // The transition type.
2059 optional TransitionType type = 3;
2060
2061 // The activity name.
2062 optional string activity_name = 4;
2063
2064 // The name of the calling app. Empty if not set.
2065 optional string calling_pkg_name = 5;
2066
2067 // Whether the app is an instant app.
2068 optional bool is_instant_app = 6;
2069
2070 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002071 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002072
Bookatz80d11a02018-01-16 10:46:35 -08002073 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002074
David Chen0b5c90c2018-01-25 16:51:49 -08002075 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002076 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002077 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002078 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002079 optional int32 bind_application_delay_millis = 11;
2080 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002081
2082 // Empty if not set.
2083 optional string launch_token = 13;
2084
Calin Juravle759fbda2018-02-20 19:52:30 +00002085 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002086 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002087
2088 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002089 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002090}
2091
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002092message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002093 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002094 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002095
2096 // The app package name.
2097 optional string pkg_name = 2;
2098
2099 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002100 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002101 WARM = 1;
2102 HOT = 2;
2103 COLD = 3;
2104 }
2105 // The transition type.
2106 optional TransitionType type = 3;
2107
2108 // The activity name.
2109 optional string activity_name = 4;
2110}
2111
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002112message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002113 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002114 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002115
2116 // The app package name.
2117 optional string pkg_name = 2;
2118
2119 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002120 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002121 WITH_BUNDLE = 1;
2122 WITHOUT_BUNDLE = 2;
2123 }
2124 // The transition type.
2125 optional TransitionType type = 3;
2126
2127 // The activity name.
2128 optional string activity_name = 4;
2129
2130 optional bool transition_process_running = 5;
2131
2132 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002133 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002134}
2135
Bookatz8fcd09a2017-12-18 13:01:10 -08002136/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002137 * Logs a picture-in-picture action
2138 * Logged from:
2139 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2140 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2141 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2142 */
2143message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002144 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002145 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002146
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002147 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002148
Chenjie Yu52cacc62017-12-08 18:11:45 -08002149 enum State {
2150 ENTERED = 1;
2151 EXPANDED_TO_FULL_SCREEN = 2;
2152 MINIMIZED = 3;
2153 DISMISSED = 4;
2154 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002155 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002156}
2157
2158/**
Chenjie Yue8904192017-12-08 19:12:57 -08002159 * Logs overlay action
2160 * Logged from:
2161 * services/core/java/com/android/server/wm/Session.java
2162 */
2163message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002164 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002165
2166 optional string package_name = 2;
2167
2168 optional bool using_alert_window = 3;
2169
2170 enum State {
2171 ENTERED = 1;
2172 EXITED = 2;
2173 }
2174 optional State state = 4;
2175}
2176
Chenjie Yuccfe6452018-01-30 11:33:21 -08002177/*
2178 * Logs foreground service starts and stops.
2179 * Note that this is not when a service starts or stops, but when it is
2180 * considered foreground.
2181 * Logged from
2182 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2183 */
2184message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002185 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002186 // package_name + "/" + class_name
2187 optional string short_name = 2;
2188
2189 enum State {
2190 ENTER = 1;
2191 EXIT = 2;
2192 }
2193 optional State state = 3;
2194}
2195
Chenjie Yue8904192017-12-08 19:12:57 -08002196/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002197 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2198 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2199 * attributed back to the parent (host) uid. One example is Chrome.
2200 *
2201 * Logged from:
2202 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2203 */
2204message IsolatedUidChanged {
2205 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002206 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002207 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002208 optional int32 parent_uid = 1;
2209
2210 optional int32 isolated_uid = 2;
2211
2212 // We expect an isolated uid to be removed before if it's used for another parent uid.
2213 enum Event {
2214 REMOVED = 0;
2215 CREATED = 1;
2216 }
2217 optional Event event = 3;
2218}
2219
2220/*
2221 * Logs the reception of an incoming network packet causing the main system to wake up for
2222 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2223 * and processed by WakeupController.cpp.
2224 */
2225message PacketWakeupOccurred {
2226 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2227 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002228 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002229 // The interface name on which the packet was received.
2230 optional string iface = 2;
2231 // The ethertype value of the packet.
2232 optional int32 ethertype = 3;
2233 // String representation of the destination MAC address of the packet.
2234 optional string destination_hardware_address = 4;
2235 // String representation of the source address of the packet if this was an IP packet.
2236 optional string source_ip = 5;
2237 // String representation of the destination address of the packet if this was an IP packet.
2238 optional string destination_ip = 6;
2239 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2240 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2241 // families.
2242 optional int32 ip_next_header = 7;
2243 // The source port if this was a TCP or UDP packet.
2244 optional int32 source_port = 8;
2245 // The destination port if this was a TCP or UDP packet.
2246 optional int32 destination_port = 9;
2247}
2248
2249/*
2250 * Logs the memory stats for an app on startup.
2251 * Logged from:
2252 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2253 */
2254message AppStartMemoryStateCaptured {
2255 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002256 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002257
2258 // The process name.
2259 optional string process_name = 2;
2260
2261 // The activity name.
2262 optional string activity_name = 3;
2263
2264 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002265 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002266
2267 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002268 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002269
2270 // RSS
2271 optional int64 rss_in_bytes = 6;
2272
2273 // CACHE
2274 optional int64 cache_in_bytes = 7;
2275
2276 // SWAP
2277 optional int64 swap_in_bytes = 8;
2278}
2279
2280/*
2281 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2282 * for LMK event.
2283 * Logged from:
2284 * system/core/lmkd/lmkd.c
2285 */
2286message LmkStateChanged {
2287 enum State {
2288 UNKNOWN = 0;
2289 START = 1;
2290 STOP = 2;
2291 }
2292 optional State state = 1;
2293}
2294
2295/*
2296 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2297 * Logged from:
2298 * system/core/lmkd/lmkd.c
2299 */
2300message LmkKillOccurred {
2301 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002302 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002303
2304 // The process name.
2305 optional string process_name = 2;
2306
2307 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002308 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002309
2310 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002311 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002312
2313 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002314 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002315
2316 // RSS
2317 optional int64 rss_in_bytes = 6;
2318
2319 // CACHE
2320 optional int64 cache_in_bytes = 7;
2321
2322 // SWAP
2323 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002324
2325 // The elapsed real time of start of the process.
2326 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002327}
2328
Rajeev Kumar51b54602018-03-01 12:18:26 -08002329/*
2330 * Logs when the ActivityManagerService detects that an app died.
2331 *
2332 * Logged from:
2333 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2334 */
2335message AppDied {
2336 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002337 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002338}
2339
Howard Ro21a039c2018-08-06 14:55:47 -07002340/**
2341 * An atom for generic metrics logging. Available from Android Q.
2342 */
2343message GenericAtom {
2344 // The uid of the application that sent this custom atom.
2345 optional int32 uid = 1 [(is_uid) = true];
2346
2347 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002348 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002349}
2350
Tej Singhd6d6d772018-09-05 17:41:25 -07002351/**
2352 * Logs when a fingerprint acquire event occurs.
2353 *
2354 * Logged from:
2355 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2356 */
2357message FingerprintAcquired {
2358 // The associated user. Eg: 0 for owners, 10+ for others.
2359 // Defined in android/os/UserHandle.java
2360 optional int32 user = 1;
2361 // If this acquire is for a crypto fingerprint.
2362 // e.g. Secure purchases, unlock password storage.
2363 optional bool is_crypto = 2;
2364}
2365
2366/**
2367 * Logs when a fingerprint authentication event occurs.
2368 *
2369 * Logged from:
2370 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2371 */
2372message FingerprintAuthenticated {
2373 // The associated user. Eg: 0 for owners, 10+ for others.
2374 // Defined in android/os/UserHandle.java
2375 optional int32 user = 1;
2376 // If this authentication is for a crypto fingerprint.
2377 // e.g. Secure purchases, unlock password storage.
2378 optional bool is_crypto = 2;
2379 // Whether or not this authentication was successful.
2380 optional bool is_authenticated = 3;
2381}
2382
2383/**
2384 * Logs when a fingerprint error occurs.
2385 *
2386 * Logged from:
2387 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2388 */
2389message FingerprintErrorOccurred {
2390 // The associated user. Eg: 0 for owners, 10+ for others.
2391 // Defined in android/os/UserHandle.java
2392 optional int32 user = 1;
2393 // If this error is for a crypto fingerprint.
2394 // e.g. Secure purchases, unlock password storage.
2395 optional bool is_crypto = 2;
2396
2397 enum Error {
2398 UNKNOWN = 0;
2399 LOCKOUT = 1;
2400 PERMANENT_LOCKOUT = 2;
2401 }
2402 // The type of error.
2403 optional Error error = 3;
2404}
Howard Ro688ae182018-09-25 00:09:36 -07002405
2406message Notification {
2407
2408 // Type of notification event.
2409 enum Type {
2410 TYPE_UNKNOWN = 0;
2411 // Notification became visible to the user.
2412 TYPE_OPEN = 1;
2413 // Notification became hidden.
2414 TYPE_CLOSE = 2;
2415 // Notification switched to detail mode.
2416 TYPE_DETAIL = 3;
2417 // Notification was clicked.
2418 TYPE_ACTION = 4;
2419 // Notification was dismissed.
2420 TYPE_DISMISS = 5;
2421 // Notification switched to summary mode. The enum value of 14 is to
2422 // match that of metrics_constants.
2423 TYPE_COLLAPSE = 14;
2424 }
2425 optional Type type = 1;
2426
2427 // Package name associated with the notification.
2428 optional string package_name = 2;
2429
2430 // Tag associated with notification.
2431 optional string tag = 3;
2432
2433 // Application-supplied ID associated with the notification.
2434 optional int32 id = 4;
2435
2436 // Index of notification in the notification panel.
2437 optional int32 shade_index = 5;
2438
2439 // The number of notifications in the notification panel.
2440 optional int32 shade_count = 6;
2441
2442 // Importance for the notification.
2443 optional int32 importance = 7;
2444
2445 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002446 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002447
2448 // Importance for the notification channel.
2449 optional int32 channel_importance = 9;
2450
Howard Ro183c2bd2018-10-18 13:52:10 -07002451 // Application-supplied ID associated with the notifications group.
2452 optional string group_id = 10;
2453
Howard Ro688ae182018-09-25 00:09:36 -07002454 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002455 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002456
Howard Ro183c2bd2018-10-18 13:52:10 -07002457 // Reason for dismissal of a notification. This field is only meaningful for
2458 // TYPE_DISMISS events.
2459 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002460
Howard Ro183c2bd2018-10-18 13:52:10 -07002461 // The first post time of notification, stable across updates.
2462 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002463
Howard Ro183c2bd2018-10-18 13:52:10 -07002464 // The most recent interruption time, or the creation time if no updates.
2465 // Differs from update_millis because updates are filtered based on whether
2466 // they actually interrupted the user.
2467 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002468
Howard Ro183c2bd2018-10-18 13:52:10 -07002469 // The most recent update time, or the creation time if no updates.
2470 optional int64 update_millis = 15;
2471
2472 // The most recent visibility event.
2473 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002474}
2475
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002476/*
Yangster-macb89807e2018-11-15 21:10:57 -08002477 * Logs when a flag flip state changes.
2478 * Logged in P/h.
2479 */
2480message PhenotypeFlagStateChanged {
2481 // Mendel configuration name.
2482 optional string mendel_config_name = 1;
2483 // State
2484 enum State {
2485 STATE_UNKNOWN = 0;
2486 COMMITTED = 1;
2487 }
2488 optional State state = 2;
2489}
2490
2491/*
2492 * Logs when a binary push state changes.
2493 * Logged in Play store
2494 */
2495message BinaryPushStateChanged {
2496 // Binary package name.
2497 optional string binary_name = 1;
2498 // Version code.
2499 optional int64 version = 2;
2500 // State
2501 enum State {
2502 STATE_UNKNOWN = 0;
2503 DOWNLOAD_START = 1;
2504 DOWNLOAD_DONE = 2;
2505 INSTALL_START = 3;
2506 INSTALL_DONE = 4;
2507 REBOOT_START = 5;
2508 REBOOT_DONE = 6;
2509 }
2510 optional State state = 3;
2511}
2512
Maggie Whitefc1aa592018-11-28 21:55:23 -08002513/** Represents USB port overheat event. */
2514message UsbPortOverheatEvent {
2515 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
2516 optional int32 plug_temperature_deci_c = 1;
2517
2518 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
2519 optional int32 max_temperature_deci_c = 2;
2520
2521 /* Time between USB plug event and overheat threshold trip, in seconds. */
2522 optional int32 time_to_overheat_secs = 3;
2523
2524 /* Time between overheat threshold trip and hysteresis, in seconds. */
2525 optional int32 time_to_hysteresis_secs = 4;
2526
2527 /* Time between hysteresis and active mitigation ending, in seconds. */
2528 optional int32 time_to_inactive_secs = 5;
2529};
2530
Maggie White8735b852019-01-18 11:40:49 -08002531/**
2532 * Logs total effective full charge and discharge cycles on a battery.
2533 * Here are some examples of one effective cycle:
2534 * 1) the battery charges from 0% to 100% and drains back to 0%,
2535 * 2) charging from 50% to 100% and draining back to 50% twice.
2536 * Pulled from:
2537 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2538 */
2539message BatteryCycleCount {
2540 /* Number of total charge and discharge cycles on the system battery. */
2541 optional int32 cycle_count = 1;
2542}
2543
Yangster-macb89807e2018-11-15 21:10:57 -08002544/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002545 * Logs when a connection becomes available and lost.
2546 * Logged in StatsCompanionService.java
2547 */
2548message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002549 // Id of the network.
2550 optional int32 net_id = 1;
2551
2552 enum State {
2553 UNKNOWN = 0;
2554 CONNECTED = 1;
2555 DISCONNECTED = 2;
2556 }
2557 // Connected state of a network.
2558 optional State state = 2;
2559}
2560
2561/**
2562 * Logs when a service starts and stops.
2563 * Logged from:
2564 * services/core/java/com/android/server/am/ActiveServices.java
2565 */
2566message ServiceStateChanged {
2567
2568 optional int32 uid = 1 [(is_uid) = true];
2569
2570 optional string package_name = 2;
2571
2572 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002573
2574 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002575 START = 1;
2576 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002577 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002578
2579 optional State state = 4;
2580}
2581
2582/**
2583 * Logs when a service is launched.
2584 * Logged from:
2585 * services/core/java/com/android/server/am/ActiveServices.java
2586 */
2587message ServiceLaunchReported {
2588
2589 optional int32 uid = 1 [(is_uid) = true];
2590
2591 optional string package_name = 2;
2592
2593 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002594}
Howard Ro688ae182018-09-25 00:09:36 -07002595
Chenjie Yubbcbc602018-02-05 16:51:52 -08002596//////////////////////////////////////////////////////////////////////
2597// Pulled atoms below this line //
2598//////////////////////////////////////////////////////////////////////
2599
2600/**
David Chenc8a43242017-10-17 16:23:28 -07002601 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2602 *
2603 * Pulled from:
2604 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2605 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002606message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002607 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002608
2609 optional int64 rx_bytes = 2;
2610
2611 optional int64 rx_packets = 3;
2612
2613 optional int64 tx_bytes = 4;
2614
2615 optional int64 tx_packets = 5;
2616}
2617
2618/**
2619 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2620 *
2621 * Pulled from:
2622 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2623 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002624message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002625 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002626
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002627 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2628 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002629
2630 optional int64 rx_bytes = 3;
2631
2632 optional int64 rx_packets = 4;
2633
2634 optional int64 tx_bytes = 5;
2635
2636 optional int64 tx_packets = 6;
2637}
2638
2639/**
2640 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2641 *
2642 * Pulled from:
2643 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2644 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002645message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002646 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002647
2648 optional int64 rx_bytes = 2;
2649
2650 optional int64 rx_packets = 3;
2651
2652 optional int64 tx_bytes = 4;
2653
2654 optional int64 tx_packets = 5;
2655}
2656
2657/**
2658 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2659 *
2660 * Pulled from:
2661 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2662 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002663message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002664 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002665
Yao Chenc40a19d2018-03-15 16:48:25 -07002666 // 1 denotes foreground and 0 denotes background. This is called Set in
2667 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002668 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002669
2670 optional int64 rx_bytes = 3;
2671
2672 optional int64 rx_packets = 4;
2673
2674 optional int64 tx_bytes = 5;
2675
2676 optional int64 tx_packets = 6;
2677}
2678
2679/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002680 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2681 *
2682 * Pulled from:
2683 * StatsCompanionService
2684 */
2685message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002686 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002687
2688 optional int64 rx_bytes = 2;
2689
2690 optional int64 tx_bytes = 3;
2691}
2692
2693/**
David Chenc8a43242017-10-17 16:23:28 -07002694 * Pulls the kernel wakelock durations. This atom is adapted from
2695 * android/internal/os/KernelWakelockStats.java
2696 *
2697 * Pulled from:
2698 * StatsCompanionService using KernelWakelockReader.
2699 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002700message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002701 optional string name = 1;
2702
2703 optional int32 count = 2;
2704
2705 optional int32 version = 3;
2706
Yangster-maca8a30442018-10-13 23:46:34 -07002707 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002708}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002709
Chenjie Yu05013b32017-11-21 10:21:41 -08002710/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002711 * Pulls low power state information. If power.stats HAL is not available, this
2712 * includes platform and subsystem sleep state information,
2713 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2714 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002715 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002716 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002717 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2718 * as defined in:
2719 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002720 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002721message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002722 // Subsystem name
2723 optional string subsystem_name = 1;
2724 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2725 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002726 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2727 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002728 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002729 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002730 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002731 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002732 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002733}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002734
Chenjie Yu05013b32017-11-21 10:21:41 -08002735/**
Bookatz92da2832018-11-01 18:10:03 -07002736 * Pulls on-device power measurement information.
2737 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2738 * Pulled from:
2739 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2740 */
2741message OnDevicePowerMeasurement {
2742 // Name of the subsystem (to which the rail belongs).
2743 optional string subsystem_name = 1;
2744
2745 // Rail name. The rail lies within the subsystem.
2746 optional string rail_name = 2;
2747
2748 // Time (in ms since boot) at which the rail energy value was measured.
2749 // This may differ slightly from the time that statsd logs this information.
2750 optional uint64 measurement_timestamp_millis = 3;
2751
2752 // Accumulated energy used via the rail since device boot in uWs.
2753 optional uint64 energy_microwatt_secs = 4;
2754}
2755
2756/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002757 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002758 * Pulls the time the cpu spend on the frequency index. Frequency index
2759 * starts from highest to lowest. The value should be monotonically
2760 * increasing since boot. However, if there is a cpu
2761 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002762 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002763message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002764 optional uint32 cluster = 1;
2765 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002766 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002767}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002768
Chenjie Yu05013b32017-11-21 10:21:41 -08002769/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002770 * Pulls Cpu Time Per Uid.
2771 * Note that isolated process uid time should be attributed to host uids.
2772 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002773message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002774 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002775 optional uint64 user_time_micros = 2;
2776 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002777}
2778
2779/**
2780 * Pulls Cpu Time Per Uid per frequency.
2781 * Note that isolated process uid time should be attributed to host uids.
2782 * For each uid, we order the time by descending frequencies.
2783 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002784message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002785 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002786 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002787 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002788}
Hugo Benichi884970e2017-11-14 22:42:46 +09002789
Chenjie Yu05013b32017-11-21 10:21:41 -08002790/**
2791 * Pulls Wifi Controller Activity Energy Info
2792 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002793message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002794 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002795 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002796 // stack reported state
2797 // TODO: replace this with proto enum
2798 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002799 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002800 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002801 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002802 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002803 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002804 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002805 // product of current(mA), voltage(V) and time(ms)
2806 optional uint64 controller_energy_used = 6;
2807}
2808
2809/**
2810 * Pulls Modem Activity Energy Info
2811 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002812message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002813 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002814 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002815 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002816 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002817 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002818 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002819 /**
2820 * Tx power index
2821 * index 0 = tx_power < 0dBm
2822 * index 1 = 0dBm < tx_power < 5dBm
2823 * index 2 = 5dBm < tx_power < 15dBm
2824 * index 3 = 15dBm < tx_power < 20dBm
2825 * index 4 = tx_power > 20dBm
2826 */
2827 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002828 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002829 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002830 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002831 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002832 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002833 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002834 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002835 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002836 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002837 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002838 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002839 // product of current(mA), voltage(V) and time(ms)
2840 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002841}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002842
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002843/**
2844 * Pulls Bluetooth Activity Energy Info
2845 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2846 */
2847message BluetoothActivityInfo {
2848 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002849 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002850 // bluetooth stack state
2851 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002852 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002853 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002854 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002855 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002856 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002857 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002858 // product of current(mA), voltage(V) and time(ms)
2859 optional uint64 energy_used = 6;
2860}
2861
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002862/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002863 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002864 *
2865 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002866 */
2867message ProcessMemoryState {
2868 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002869 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002870
2871 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002872 // Usually package name, "system" for system server.
2873 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002874 optional string process_name = 2;
2875
Rafal Slawikda51b932018-12-13 16:31:33 +00002876 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002877 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002878
2879 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002880 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002881
2882 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002883 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002884
Rajeev Kumar90235992018-01-29 11:06:48 -08002885 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002886 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2887 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002888 optional int64 rss_in_bytes = 6;
2889
2890 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002891 // Value is read from memory.stat, field total_cache if per-app memory
2892 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002893 optional int64 cache_in_bytes = 7;
2894
2895 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002896 // Value is read from memory.stat, field total_swap if per-app memory
2897 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002898 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002899
Rafal Slawikd03ae422018-11-20 11:27:45 +00002900 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002901 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002902
2903 // Elapsed real time when the process started.
2904 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2905 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002906}
2907
2908/*
Rafal Slawik08621582018-10-15 14:53:07 +01002909 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002910 *
2911 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002912 */
2913message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002914 // The uid if available. -1 means not available.
2915 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002916
Rafal Slawikbf67d072018-10-23 11:07:54 +01002917 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002918 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002919 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002920
Rafal Slawikbf67d072018-10-23 11:07:54 +01002921 // # of page-faults
2922 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002923
Rafal Slawikbf67d072018-10-23 11:07:54 +01002924 // # of major page-faults
2925 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002926
Rafal Slawikbf67d072018-10-23 11:07:54 +01002927 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002928 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002929 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002930
Rafal Slawikd03ae422018-11-20 11:27:45 +00002931 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002932 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002933
2934 // Elapsed real time when the process started.
2935 // Value is read from /proc/PID/stat, field 22.
2936 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002937}
2938
2939/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002940 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002941 *
2942 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
2943 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00002944 *
2945 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002946 */
2947message ProcessMemoryHighWaterMark {
2948 // The uid if available. -1 means not available.
2949 optional int32 uid = 1 [(is_uid) = true];
2950
Rafal Slawikda51b932018-12-13 16:31:33 +00002951 // The process name.
2952 // Usually package name or process cmdline.
2953 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002954 optional string process_name = 2;
2955
2956 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2957 // /proc/PID/status.
2958 optional int64 rss_high_water_mark_in_bytes = 3;
2959}
2960
2961/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002962 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002963 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002964message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002965 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002966}
2967
2968/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002969 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002970 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002971message SystemUptime {
2972 // Milliseconds since the system was booted.
2973 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2974 // for external input).
2975 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002976 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002977}
2978
2979/*
2980 * Reads from /proc/uid_concurrent_active_time which has the format:
2981 * active: X (X is # cores)
2982 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2983 * [uid1]: [time-0] [time-1] [time-2] ... ...
2984 * ...
2985 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2986 * The file contains a monotonically increasing count of time for a single boot.
2987 */
2988message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002989 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002990 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002991}
2992
2993/**
2994 * Reads from /proc/uid_concurrent_policy_time which has the format:
2995 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2996 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2997 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2998 * ...
2999 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3000 * The file contains a monotonically increasing count of time for a single boot.
3001 */
3002message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003003 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003004 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003005 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003006}
3007
3008/*
3009 * Pulls free disk space, for data, system partition and temporary directory.
3010 */
3011message DiskSpace {
3012 // available bytes in data partition
3013 optional uint64 data_available_bytes = 1;
3014 // available bytes in system partition
3015 optional uint64 system_available_bytes = 2;
3016 // available bytes in download cache or temp directories
3017 optional uint64 temp_available_bytes = 3;
3018}
Tej Singhbf972d92018-01-10 20:51:13 -08003019
3020/**
3021 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003022 * Pulled from:
3023 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003024 */
3025message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003026 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003027}
3028
3029/**
3030 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003031 * Pulled from:
3032 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003033 */
3034message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003035 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003036}
3037
3038/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003039 * Pulls battery voltage.
3040 * Pulled from:
3041 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3042 */
3043message BatteryVoltage {
3044 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003045 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003046}
3047
3048/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003049 * Pulls battery level (percent full, from 0 to 100).
3050 *
3051 * Pulled from:
3052 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3053 */
3054message BatteryLevel {
3055 // Battery level. Should be in [0, 100].
3056 optional int32 battery_level = 1;
3057}
3058
3059/**
Tej Singhd89137e2018-03-26 14:51:40 -07003060 * Pulls the temperature of various parts of the device.
3061 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003062 *
3063 * Pulled from:
3064 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3065 */
3066message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003067 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003068 optional android.os.TemperatureTypeEnum sensor_location = 1;
3069
3070 // The name of the temperature source. Eg. CPU0
3071 optional string sensor_name = 2;
3072
Tej Singhd89137e2018-03-26 14:51:40 -07003073 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003074 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003075 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003076}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003077
3078/**
3079 * Pulls the statistics of calls to Binder.
3080 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003081 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3082 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003083 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003084 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003085 */
3086message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003087 // UID of the process responsible for the binder transaction. It will be set if the process
3088 // executing the binder transaction attribute the transaction to another uid using
3089 // Binder.setThreadWorkSource().
3090 //
3091 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003092 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003093 // UID of the process executing the binder transaction.
3094 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003095 // Fully qualified class name of the API call.
3096 //
3097 // This is a system server class name.
3098 //
3099 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3100 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3101 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3102 // commonly used APIs.
3103 optional string service_class_name = 2;
3104 // Method name of the API call. It can also be a transaction code if we cannot
3105 // resolve it to a name. See Binder#getTransactionName.
3106 //
3107 // This is a system server method name.
3108 optional string service_method_name = 3;
3109 // Total number of API calls.
3110 optional int64 call_count = 4;
3111 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3112 optional bool screen_interactive = 13;
3113 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3114 // call_count will be equal to recorded_call_count.
3115 //
3116 // If recorded_call_count is different than call_count, it means data collection has been
3117 // sampled. All the fields below will be sampled in this case.
3118 optional int64 recorded_call_count = 12;
3119 // Number of exceptions thrown by the API.
3120 optional int64 recorded_exception_count = 5;
3121 // Total latency of all API calls.
3122 // Average can be computed using total_latency_micros / recorded_call_count.
3123 optional int64 recorded_total_latency_micros = 6;
3124 // Maximum latency of one API call.
3125 optional int64 recorded_max_latency_micros = 7;
3126 // Total CPU usage of all API calls.
3127 // Average can be computed using total_cpu_micros / recorded_call_count.
3128 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3129 optional int64 recorded_total_cpu_micros = 8;
3130 // Maximum CPU usage of one API call.
3131 optional int64 recorded_max_cpu_micros = 9;
3132 // Maximum parcel reply size of one API call.
3133 optional int64 recorded_max_reply_size_bytes = 10;
3134 // Maximum parcel request size of one API call.
3135 optional int64 recorded_max_request_size_bytes = 11;
3136}
3137
3138/**
3139 * Pulls the statistics of exceptions during calls to Binder.
3140 *
3141 * Binder stats are cumulative from boot unless somebody reset the data using
3142 * > adb shell dumpsys binder_calls_stats --reset
3143 */
3144message BinderCallsExceptions {
3145 // Exception class name, e.g. java.lang.IllegalArgumentException.
3146 //
3147 // This is an exception class name thrown by the system server.
3148 optional string exception_class_name = 1;
3149 // Total number of exceptions.
3150 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003151}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003152
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003153/**
3154 * Pulls the statistics of message dispatching on HandlerThreads.
3155 *
3156 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3157 * config on the device.
3158 *
3159 * Next tag: 11
3160 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003161message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003162 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003163 optional int32 uid = 1 [(is_uid) = true];
3164
3165 // Fully qualified class name of the handler target class.
3166 //
3167 // This field does not contain PII. This is a system server class name.
3168 optional string handler_class_name = 2;
3169
3170 // The name of the thread that runs the Looper.
3171 //
3172 // This field does not contain PII. This is a system server thread name.
3173 optional string looper_thread_name = 3;
3174
3175 // The name of the dispatched message.
3176 //
3177 // This field does not contain PII. This is a system server constant or class
3178 // name.
3179 optional string message_name = 4;
3180
3181 // Total number of successfully dispatched messages.
3182 optional int64 message_count = 5;
3183
3184 // Total number of messages that failed dispatching.
3185 optional int64 exception_count = 6;
3186
3187 // Total number of processed messages we have data recorded for. If we
3188 // collected data for all the messages, message_count will be equal to
3189 // recorded_message_count.
3190 //
3191 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003192 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003193 optional int64 recorded_message_count = 7;
3194
3195 // Total latency of all processed messages.
3196 // Average can be computed using recorded_total_latency_micros /
3197 // recorded_message_count.
3198 optional int64 recorded_total_latency_micros = 8;
3199
3200 // Total CPU usage of all processed message.
3201 // Average can be computed using recorded_total_cpu_micros /
3202 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003203 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003204 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003205
3206 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3207 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003208
3209 // Max recorded CPU usage of all processed messages.
3210 optional int64 recorded_max_cpu_micros = 11;
3211
3212 // Max recorded latency of all processed messages.
3213 optional int64 recorded_max_latency_micros = 12;
3214
3215 // Total number of messages we tracked the dispatching delay for. If we
3216 // collected data for all the messages, message_count will be equal to
3217 // recorded_delay_message_count.
3218 //
3219 // If recorded_delay_message_count is different than message_count, it means data
3220 // collection has been sampled or/and not all messages specified the target dispatch time.
3221 // The fields below will be sampled in this case.
3222 optional int64 recorded_delay_message_count = 13;
3223
3224 // Total dispatching delay of all processed messages.
3225 // Calculated as a difference between the target dispatching time (Message.when)
3226 // and the actual dispatching time.
3227 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3228 optional int64 recorded_total_delay_millis = 14;
3229
3230 // Max dispatching delay of all processed messages.
3231 // Calculated as a difference between the target dispatching time (Message.when)
3232 // and the actual dispatching time.
3233 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003234}
Tej Singh86dc9db2018-09-06 00:39:57 +00003235
3236/**
3237 * Pulls disk information, such as write speed and latency.
3238 */
3239message DiskStats {
3240 // Time taken to open, write 512B to, and close a file.
3241 // -1 if error performing the check.
3242 optional int64 data_write_latency_millis = 1;
3243
3244 optional bool file_based_encryption = 2;
3245
3246 // Recent disk write speed in kB/s.
3247 // -1 if error querying storageed.
3248 // 0 if data is unavailable.
3249 optional int32 recent_disk_write_speed = 3;
3250}
3251
3252
3253/**
3254 * Free and total bytes of the Data, Cache, and System partition.
3255 */
3256message DirectoryUsage {
3257 enum Directory {
3258 UNKNOWN = 0;
3259 DATA = 1;
3260 CACHE = 2;
3261 SYSTEM = 3;
3262 }
3263 optional Directory directory = 1;
3264 optional int64 free_bytes = 2;
3265 optional int64 total_bytes = 3;
3266}
3267
3268
3269/**
3270 * Size of an application: apk size, data size, and cache size.
3271 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3272 * Information is only reported for apps with the primary user (user 0).
3273 * Sizes are aggregated by package name.
3274 */
3275message AppSize {
3276 // Including uids will involve modifying diskstats logic.
3277 optional string package_name = 1;
3278 // App size in bytes. -1 if unavailable.
3279 optional int64 app_size_bytes = 2;
3280 // App data size in bytes. -1 if unavailable.
3281 optional int64 app_data_size_bytes = 3;
3282 // App cache size in bytes. -1 if unavailable.
3283 optional int64 app_cache_size_bytes = 4;
3284 // Time that the cache file was produced.
3285 // Uses System.currentTimeMillis(), which is wall clock time.
3286 optional int64 cache_time_millis = 5;
3287}
3288
3289
3290/**
3291 * Size of a particular category. Eg: photos, videos.
3292 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3293 */
3294message CategorySize {
3295 enum Category {
3296 UNKNOWN = 0;
3297 APP_SIZE = 1;
3298 APP_DATA_SIZE = 2;
3299 APP_CACHE_SIZE = 3;
3300 PHOTOS = 4;
3301 VIDEOS = 5;
3302 AUDIO = 6;
3303 DOWNLOADS = 7;
3304 SYSTEM = 8;
3305 OTHER = 9;
3306 }
3307 optional Category category = 1;
3308 // Category size in bytes.
3309 optional int64 size_bytes = 2;
3310 // Time that the cache file was produced.
3311 // Uses System.currentTimeMillis(), which is wall clock time.
3312 optional int64 cache_time_millis = 3;
3313}
Tej Singhd6d6d772018-09-05 17:41:25 -07003314
3315/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003316 * Pulls per uid I/O stats. The stats are cumulative since boot.
3317 *
3318 * Read/write bytes are I/O events from a storage device
3319 * Read/write chars are data requested by read/write syscalls, and can be
3320 * satisfied by caching.
3321 *
3322 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3323 */
3324message DiskIo {
3325 optional int32 uid = 1 [(is_uid) = true];
3326 optional int64 fg_chars_read = 2;
3327 optional int64 fg_chars_write = 3;
3328 optional int64 fg_bytes_read = 4;
3329 optional int64 fg_bytes_write = 5;
3330 optional int64 bg_chars_read = 6;
3331 optional int64 bg_chars_write = 7;
3332 optional int64 bg_bytes_read = 8;
3333 optional int64 bg_bytes_write = 9;
3334 optional int64 fg_fsync = 10;
3335 optional int64 bg_fsync= 11;
3336}
3337
3338
3339/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003340 * Pulls the number of fingerprints for each user.
3341 *
3342 * Pulled from StatsCompanionService, which queries FingerprintManager.
3343 */
3344message NumFingerprints {
3345 // The associated user. Eg: 0 for owners, 10+ for others.
3346 // Defined in android/os/UserHandle.java
3347 optional int32 user = 1;
3348 // Number of fingerprints registered to that user.
3349 optional int32 num_fingerprints = 2;
3350}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003351
Yangsteraf9aee72018-10-12 09:26:16 -07003352message AggStats {
3353 optional int64 min = 1;
3354
3355 optional int64 average = 2;
3356
3357 optional int64 max = 3;
3358}
3359
3360message ProcessStatsStateProto {
3361 optional android.service.procstats.ScreenState screen_state = 1;
3362
3363 optional android.service.procstats.MemoryState memory_state = 2;
3364
3365 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3366 // and not frameworks/base/core/java/android/app/ActivityManager.java
3367 optional android.service.procstats.ProcessState process_state = 3;
3368
3369 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003370 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003371
3372 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003373 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003374
3375 // # of samples taken
3376 optional int32 sample_size = 5;
3377
3378 // PSS is memory reserved for this process
3379 optional AggStats pss = 6;
3380
3381 // USS is memory shared between processes, divided evenly for accounting
3382 optional AggStats uss = 7;
3383
3384 // RSS is memory resident for this process
3385 optional AggStats rss = 8;
3386}
3387
3388// Next Tag: 7
3389message ProcessStatsProto {
3390 // Name of process.
3391 optional string process = 1;
3392
3393 // Uid of the process.
3394 optional int32 uid = 2;
3395
3396 // Information about how often kills occurred
3397 message Kill {
3398 // Count of excessive CPU kills
3399 optional int32 cpu = 1;
3400
3401 // Count of kills when cached
3402 optional int32 cached = 2;
3403
3404 // PSS stats during cached kill
3405 optional AggStats cached_pss = 3;
3406 }
3407 optional Kill kill = 3;
3408
3409 // Time and memory spent in various states.
3410 repeated ProcessStatsStateProto states = 5;
3411
3412 // Total time process has been running... screen_state, memory_state, and process_state
3413 // will not be set.
3414 optional ProcessStatsStateProto total_running_state = 6;
3415}
3416
3417message PackageServiceOperationStatsProto {
3418 // Operate enum: Started, Foreground, Bound, Executing
3419 optional android.service.procstats.ServiceOperationState operation = 1;
3420
3421 // Number of times the service was in this operation.
3422 optional int32 count = 2;
3423
3424 // Information about a state the service can be in.
3425 message StateStats {
3426 // Screen state enum.
3427 optional android.service.procstats.ScreenState screen_state = 1;
3428 // Memory state enum.
3429 optional android.service.procstats.MemoryState memory_state = 2;
3430
3431 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003432 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003433 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003434 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003435 }
3436 repeated StateStats state_stats = 3;
3437}
3438
3439message PackageServiceStatsProto {
3440 // Name of service component.
3441 optional string service_name = 1;
3442
3443 // The operation stats.
3444 // The package_name, package_uid, package_version, service_name will not be set to save space.
3445 repeated PackageServiceOperationStatsProto operation_stats = 2;
3446}
3447
3448message PackageAssociationSourceProcessStatsProto {
3449 // Uid of the process.
3450 optional int32 process_uid = 1;
3451 // Process name.
3452 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08003453 // Package name.
3454 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07003455 // Total count of the times this association appeared.
3456 optional int32 total_count = 3;
3457
3458 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003459 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003460
3461 // Total count of the times this association became actively impacting its target process.
3462 optional int32 active_count = 5;
3463
3464 // Information on one source in this association.
3465 message StateStats {
3466 // Process state enum.
3467 optional android.service.procstats.ProcessState process_state = 1;
3468 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003469 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003470 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003471 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003472 }
3473 repeated StateStats active_state_stats = 6;
3474}
3475
3476message PackageAssociationProcessStatsProto {
3477 // Name of the target component.
3478 optional string component_name = 1;
3479 // Information on one source in this association.
3480 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3481}
3482
3483
3484message ProcessStatsPackageProto {
3485 // Name of package.
3486 optional string package = 1;
3487
3488 // Uid of the package.
3489 optional int32 uid = 2;
3490
3491 // Version of the package.
3492 optional int64 version = 3;
3493
3494 // Stats for each process running with the package loaded in to it.
3495 repeated ProcessStatsProto process_stats = 4;
3496
3497 // Stats for each of the package's services.
3498 repeated PackageServiceStatsProto service_stats = 5;
3499
3500 // Stats for each association with the package.
3501 repeated PackageAssociationProcessStatsProto association_stats = 6;
3502}
3503
3504message ProcessStatsSectionProto {
3505 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003506 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003507
3508 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003509 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003510
3511 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003512 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003513
3514 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003515 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003516
3517 // System runtime library. e.g. "libdvm.so", "libart.so".
3518 optional string runtime = 5;
3519
3520 // whether kernel reports swapped pss.
3521 optional bool has_swapped_pss = 6;
3522
3523 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3524 enum Status {
3525 STATUS_UNKNOWN = 0;
3526 STATUS_COMPLETE = 1;
3527 STATUS_PARTIAL = 2;
3528 STATUS_SHUTDOWN = 3;
3529 STATUS_SYSPROPS = 4;
3530 }
3531 repeated Status status = 7;
3532
Chenjie Yub2ecc792019-01-17 10:27:26 -08003533 // Number of pages available of various types and sizes, representation fragmentation.
3534 repeated ProcessStatsAvailablePagesProto available_pages = 10;
3535
Yangsteraf9aee72018-10-12 09:26:16 -07003536 // Stats for each process.
3537 repeated ProcessStatsProto process_stats = 8;
3538
3539 // Stats for each package.
3540 repeated ProcessStatsPackageProto package_stats = 9;
3541}
3542
Chenjie Yub2ecc792019-01-17 10:27:26 -08003543message ProcessStatsAvailablePagesProto {
3544 // Node these pages are in (as per /proc/pagetypeinfo)
3545 optional int32 node = 1;
3546
3547 // Zone these pages are in (as per /proc/pagetypeinfo)
3548 optional string zone = 2;
3549
3550 // Label for the type of these pages (as per /proc/pagetypeinfo)
3551 optional string label = 3;
3552
3553 // Distribution of number of pages available by order size. First entry in array is
3554 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
3555 repeated int32 pages_per_order = 4;
3556}
3557
Chenjie Yu12e5e672018-09-14 15:54:59 -07003558/**
3559 * Pulled from ProcessStatsService.java
3560 */
3561message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003562 optional ProcessStatsSectionProto proc_stats_section = 1;
3563}
3564
Chenjie Yuf910b7802019-01-11 16:08:20 -08003565/**
3566 * Pulled from ProcessStatsService.java
3567 */
3568message ProcStatsPkgProc {
3569 optional ProcessStatsSectionProto proc_stats_section = 1;
3570}
3571
Yangsteraf9aee72018-10-12 09:26:16 -07003572message PowerProfileProto {
3573 optional double cpu_suspend = 1;
3574
3575 optional double cpu_idle = 2;
3576
3577 optional double cpu_active = 3;
3578
3579 message CpuCluster {
3580 optional int32 id = 1;
3581 optional double cluster_power = 2;
3582 optional int32 cores = 3;
3583 repeated int64 speed = 4;
3584 repeated double core_power = 5;
3585 }
3586
3587 repeated CpuCluster cpu_cluster = 40;
3588
3589 optional double wifi_scan = 4;
3590
3591 optional double wifi_on = 5;
3592
3593 optional double wifi_active = 6;
3594
3595 optional double wifi_controller_idle = 7;
3596
3597 optional double wifi_controller_rx = 8;
3598
3599 optional double wifi_controller_tx = 9;
3600
3601 repeated double wifi_controller_tx_levels = 10;
3602
3603 optional double wifi_controller_operating_voltage = 11;
3604
3605 optional double bluetooth_controller_idle = 12;
3606
3607 optional double bluetooth_controller_rx = 13;
3608
3609 optional double bluetooth_controller_tx = 14;
3610
3611 optional double bluetooth_controller_operating_voltage = 15;
3612
3613 optional double modem_controller_sleep = 16;
3614
3615 optional double modem_controller_idle = 17;
3616
3617 optional double modem_controller_rx = 18;
3618
3619 repeated double modem_controller_tx = 19;
3620
3621 optional double modem_controller_operating_voltage = 20;
3622
3623 optional double gps_on = 21;
3624
3625 repeated double gps_signal_quality_based = 22;
3626
3627 optional double gps_operating_voltage = 23;
3628
3629 optional double bluetooth_on = 24;
3630
3631 optional double bluetooth_active = 25;
3632
3633 optional double bluetooth_at_cmd = 26;
3634
3635 optional double ambient_display = 27;
3636
3637 optional double screen_on = 28;
3638
3639 optional double radio_on = 29;
3640
3641 optional double radio_scanning = 30;
3642
3643 optional double radio_active = 31;
3644
3645 optional double screen_full = 32;
3646
3647 optional double audio = 33;
3648
3649 optional double video = 34;
3650
3651 optional double flashlight = 35;
3652
3653 optional double memory = 36;
3654
3655 optional double camera = 37;
3656
3657 optional double wifi_batched_scan = 38;
3658
3659 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003660}
Chenjie Yuab530202018-09-26 12:39:20 -07003661
3662/**
3663 * power_profile.xml and other constants for power model calculations.
3664 * Pulled from PowerProfile.java
3665 */
3666message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003667 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003668}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003669
3670/**
arangelovd5db50e2018-10-12 20:24:39 +01003671 * Logs when a user restriction was added or removed.
3672 *
3673 * Logged from:
3674 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3675 */
3676message UserRestrictionChanged {
3677 // The raw string of the user restriction as defined in UserManager.
3678 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3679 optional string restriction = 1;
3680 // Whether the restriction is enabled or disabled.
3681 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003682}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003683
3684/**
3685 * Pulls process user time and system time. Puller takes a snapshot of all pids
3686 * in the system and returns cpu stats for those that are working at the time.
3687 * Dead pids will be dropped. Kernel processes are excluded.
3688 * Min cool-down is 5 sec.
3689 */
3690message ProcessCpuTime {
3691 optional int32 uid = 1 [(is_uid) = true];
3692
3693 optional string process_name = 2;
3694 // Process cpu time in user space, cumulative from boot/process start
3695 optional int64 user_time_millis = 3;
3696 // Process cpu time in system space, cumulative from boot/process start
3697 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003698}
Misha Wagner5a51e002018-10-03 15:04:09 +01003699
3700/**
3701 * Pulls the CPU usage for each thread.
3702 *
3703 * Read from /proc/$PID/task/$TID/time_in_state files.
3704 *
3705 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3706 * time_in_state files not being present on some phones, have not been addressed. These should be
3707 * considered before a public release.
3708 */
3709message CpuTimePerThreadFreq {
3710 // UID that owns the process.
3711 optional int32 uid = 1 [(is_uid) = true];
3712 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003713 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003714 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003715 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003716 // Name of the process taken from `/proc/$PID/cmdline`.
3717 optional string process_name = 4;
3718 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3719 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003720
3721 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3722 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3723 // frequencies are given here as the alternative is sending eight separate atoms. This method
3724 // significantly reduces the amount of data created
3725 optional int32 frequency1_khz = 6;
3726 optional int32 time1_millis = 7;
3727 optional int32 frequency2_khz = 8;
3728 optional int32 time2_millis = 9;
3729 optional int32 frequency3_khz = 10;
3730 optional int32 time3_millis = 11;
3731 optional int32 frequency4_khz = 12;
3732 optional int32 time4_millis = 13;
3733 optional int32 frequency5_khz = 14;
3734 optional int32 time5_millis = 15;
3735 optional int32 frequency6_khz = 16;
3736 optional int32 time6_millis = 17;
3737 optional int32 frequency7_khz = 18;
3738 optional int32 time7_millis = 19;
3739 optional int32 frequency8_khz = 20;
3740 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003741}
Bookatz75ee6042018-11-09 12:27:37 -08003742
3743/**
Bookatz366a4432018-11-20 09:42:33 -08003744 * Pulls information about the device's build.
3745 */
3746message BuildInformation {
3747 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3748 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3749 optional string fingerprint = 1;
3750
3751 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3752 optional string brand = 2;
3753
3754 // Build.PRODUCT. The name of the overall product.
3755 optional string product = 3;
3756
3757 // Build.DEVICE. The name of the industrial design.
3758 optional string device = 4;
3759
3760 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3761 optional string version_release = 5;
3762
3763 // Build.ID. E.g. a label like "M4-rc20".
3764 optional string id = 6;
3765
3766 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3767 // represent this build.
3768 optional string version_incremental = 7;
3769
3770 // Build.TYPE. The type of build, like "user" or "eng".
3771 optional string type = 8;
3772
3773 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3774 optional string tags = 9;
3775}
3776
3777/**
Bookatz75ee6042018-11-09 12:27:37 -08003778 * Pulls on-device BatteryStats power use calculations for the overall device.
3779 */
3780message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08003781 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3782 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3783 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3784 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08003785}
3786
3787/**
3788 * Pulls on-device BatteryStats power use calculations broken down by uid.
3789 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3790 * that is attributed to non-uid items. They must all be included to get the total power use.
3791 */
3792message DeviceCalculatedPowerBlameUid {
3793 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3794 optional int32 uid = 1 [(is_uid) = true];
3795
Bookatz3dbc13a2018-12-21 12:16:51 -08003796 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3797 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3798 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08003799}
3800
3801/**
3802 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3803 * drain type.
3804 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3805 * is attributed uids. They must all be included to get the total power use.
3806 */
3807message DeviceCalculatedPowerBlameOther {
3808 // The type of item whose power use is being reported.
3809 enum DrainType {
3810 AMBIENT_DISPLAY = 0;
3811 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3812 BLUETOOTH = 2;
3813 CAMERA = 3;
3814 // Cell-standby
3815 CELL = 4;
3816 FLASHLIGHT = 5;
3817 IDLE = 6;
3818 MEMORY = 7;
3819 // Amount that total computed drain exceeded the drain estimated using the
3820 // battery level changes and capacity.
3821 OVERCOUNTED = 8;
3822 PHONE = 9;
3823 SCREEN = 10;
3824 // Amount that total computed drain was below the drain estimated using the
3825 // battery level changes and capacity.
3826 UNACCOUNTED = 11;
3827 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3828 WIFI = 13;
3829 }
3830 optional DrainType drain_type = 1;
3831
Bookatz3dbc13a2018-12-21 12:16:51 -08003832 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3833 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3834 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003835}
arangelov4e994062018-11-13 16:12:38 +00003836
3837/**
3838 * Logs device policy features.
3839 *
3840 * Logged from:
3841 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3842 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3843 */
3844message DevicePolicyEvent {
3845 // The event id - unique for each event.
3846 optional android.stats.devicepolicy.EventId event_id = 1;
3847 // The admin package name.
3848 optional string admin_package_name = 2;
3849 // A generic integer parameter.
3850 optional int32 integer_value = 3;
3851 // A generic boolean parameter.
3852 optional bool boolean_value = 4;
3853 // A parameter specifying a time period in milliseconds.
3854 optional uint64 time_period_millis = 5;
3855 // A parameter specifying a list of package names, bundle extras or string parameters.
3856 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3857}
shawnlinea5b66b2018-11-13 15:05:29 +08003858
3859/**
3860 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3861 *
3862 * Logged from:
3863 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3864 */
3865message DocsUILaunchReported {
3866 optional android.stats.docsui.LaunchAction launch_action = 1;
3867 optional bool has_initial_uri = 2;
3868 optional android.stats.docsui.MimeType mime_type = 3;
3869 optional android.stats.docsui.Root initial_root = 4;
3870}
3871
3872/**
3873 * Logs root/app visited event in file managers/picker. Call this when the user
3874 * taps on root/app in hamburger menu.
3875 *
3876 * Logged from:
3877 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3878 */
3879message DocsUIRootVisitedReported {
3880 optional android.stats.docsui.ContextScope scope = 1;
3881 optional android.stats.docsui.Root root = 2;
3882}
3883
3884/**
3885 * Logs file operation stats. Call this when a file operation has completed.
3886 *
3887 * Logged from:
3888 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3889 */
3890message DocsUIFileOperationReported {
3891 optional android.stats.docsui.Provider provider = 1;
3892 optional android.stats.docsui.FileOperation file_op = 2;
3893}
3894
3895/**
3896 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3897 * mode.
3898 *
3899 * Logged from:
3900 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3901 */
3902message DocsUIFileOperationCopyMoveModeReported {
3903 optional android.stats.docsui.FileOperation file_op = 1;
3904 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3905}
3906
3907
3908/**
3909 * Logs file sub operation stats. Call this when a file operation has failed.
3910 *
3911 * Logged from:
3912 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3913 */
3914message DocsUIFileOperationFailureReported {
3915 optional android.stats.docsui.Authority authority = 1;
3916 optional android.stats.docsui.SubFileOperation sub_op = 2;
3917}
3918
3919/**
3920* Logs the cancellation of a file operation. Call this when a job is canceled
3921*
3922* Logged from:
3923* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3924*/
3925message DocsUIFileOperationCanceledReported {
3926 optional android.stats.docsui.FileOperation file_op = 1;
3927}
3928
3929/**
3930 * Logs startup time in milliseconds.
3931 *
3932 * Logged from:
3933 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3934 */
3935message DocsUIStartupMsReported {
3936 optional int32 startup_millis = 1;
3937}
3938
3939/**
3940 * Logs the action that was started by user.
3941 *
3942 * Logged from:
3943 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3944 */
3945message DocsUIUserActionReported {
3946 optional android.stats.docsui.UserAction action = 1;
3947}
3948
3949/**
3950 * Logs the invalid type when invalid scoped access is requested.
3951 *
3952 * Logged from:
3953 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
3954 */
3955message DocsUIInvalidScopedAccessRequestReported {
3956 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00003957}
Ben Murdochbab399f2018-12-06 11:01:38 +00003958
3959/**
shawnlina75e82d2019-01-07 10:31:12 +08003960 * Logs the package name that launches docsui picker mode.
3961 *
3962 * Logged from:
3963 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3964 */
3965message DocsUIPickerLaunchedFromReported {
3966 optional string package_name = 1;
3967}
3968
3969/**
3970 * Logs the search type.
3971 *
3972 * Logged from:
3973 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3974 */
3975message DocsUISearchTypeReported {
3976 optional android.stats.docsui.SearchType search_type = 1;
3977}
3978
3979/**
3980 * Logs the search mode.
3981 *
3982 * Logged from:
3983 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3984 */
3985message DocsUISearchModeReported {
3986 optional android.stats.docsui.SearchMode search_mode = 1;
3987}
3988
3989/**
3990 * Logs the pick result information.
3991 *
3992 * Logged from:
3993 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3994 */
3995message DocsUIPickResultReported {
3996 optional int32 total_action_count = 1;
3997 optional int64 duration_millis = 2;
3998 optional int32 file_count= 3;
3999 optional bool is_searching = 4;
4000 optional android.stats.docsui.Root picked_from = 5;
4001 optional android.stats.docsui.MimeType mime_type = 6;
4002 optional int32 repeatedly_pick_times = 7;
4003}
4004
4005/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004006 * Logs when an app's memory is compacted.
4007 *
4008 * Logged from:
4009 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4010 */
4011message AppCompacted {
4012 // The pid of the process being compacted.
4013 optional int32 pid = 1;
4014
4015 // The name of the process being compacted.
4016 optional string process_name = 2;
4017
4018 // The type of compaction.
4019 enum Action {
4020 UNKNOWN = 0;
4021 SOME = 1;
4022 FULL = 2;
4023 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004024 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004025
4026 // Total RSS in kilobytes consumed by the process prior to compaction.
4027 optional int64 before_rss_total_kilobytes = 4;
4028
4029 // File RSS in kilobytes consumed by the process prior to compaction.
4030 optional int64 before_rss_file_kilobytes = 5;
4031
4032 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4033 optional int64 before_rss_anon_kilobytes = 6;
4034
4035 // Swap in kilobytes consumed by the process prior to compaction.
4036 optional int64 before_swap_kilobytes = 7;
4037
4038 // Total RSS in kilobytes consumed by the process after compaction.
4039 optional int64 after_rss_total_kilobytes = 8;
4040
4041 // File RSS in kilobytes consumed by the process after compaction.
4042 optional int64 after_rss_file_kilobytes = 9;
4043
4044 // Anonymous RSS in kilobytes consumed by the process after compaction.
4045 optional int64 after_rss_anon_kilobytes = 10;
4046
4047 // Swap in kilobytes consumed by the process after compaction.
4048 optional int64 after_swap_kilobytes = 11;
4049
4050 // The time taken to perform compaction in milliseconds.
4051 optional int64 time_to_compact_millis = 12;
4052
4053 // The last compaction action performed for this app.
4054 optional Action last_action = 13;
4055
Ben Murdoch01720b82018-12-19 18:03:44 +00004056 // The last time that compaction was attempted on this process in milliseconds
4057 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4058 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004059
Ben Murdoch01720b82018-12-19 18:03:44 +00004060 // The oom_score_adj at the time of compaction.
4061 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004062
4063 // The process state at the time of compaction.
4064 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4065}
lifr157fc552018-12-12 16:38:04 +08004066
4067/**
4068 * Logs the latency period(in microseconds) and the return code of
4069 * the DNS(Domain Name System) lookups.
4070 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4071 * to get info(address or hostname) from DNS server(or DNS cache).
4072 * Logged from:
4073 * /system/netd/server/DnsProxyListener.cpp
4074 */
4075message NetworkDnsEventReported {
4076 // The types of the DNS lookups, as defined in
4077 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4078 enum EventType {
4079 EVENT_UNKNOWN = 0;
4080 EVENT_GETADDRINFO = 1;
4081 EVENT_GETHOSTBYNAME = 2;
4082 EVENT_GETHOSTBYADDR = 3;
4083 EVENT_RES_NSEND = 4;
4084 }
4085 optional EventType event_type = 1;
4086
4087 // The return value of the DNS resolver for each DNS lookups.
4088 //bionic/libc/include/netdb.h
4089 //system/netd/resolv/include/netd_resolv/resolv.h
4090 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004091 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004092 EAI_ADDRFAMILY = 1;
4093 EAI_AGAIN = 2;
4094 EAI_BADFLAGS = 3;
4095 EAI_FAIL = 4;
4096 EAI_FAMILY = 5;
4097 EAI_MEMORY = 6;
4098 EAI_NODATA = 7;
4099 EAI_NONAME = 8;
4100 EAI_SERVICE = 9;
4101 EAI_SOCKTYPE = 10;
4102 EAI_SYSTEM = 11;
4103 EAI_BADHINTS = 12;
4104 EAI_PROTOCOL = 13;
4105 EAI_OVERFLOW = 14;
4106 RESOLV_TIMEOUT = 255;
4107 EAI_MAX = 256;
4108 }
4109 optional ReturnCode return_code = 2;
4110
4111 // The latency period(in microseconds) it took for this DNS lookup to complete.
4112 optional int32 latency_micros = 3;
4113}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004114
4115/**
4116 * Logs when a data stall event occurs.
4117 *
4118 * Log from:
4119 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4120 */
4121message DataStallEvent {
4122 // Data stall evaluation type.
4123 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4124 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4125 optional int32 evaluation_type = 1;
4126 // See definition in data_stall_event.proto.
4127 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4128 // See definition in data_stall_event.proto.
4129 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4130 // See definition in data_stall_event.proto.
4131 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4132 // See definition in data_stall_event.proto.
4133 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4134 // See definition in data_stall_event.proto.
4135 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4136}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004137
4138/*
4139 * Logs when RescueParty resets some set of experiment flags.
4140 *
4141 * Logged from:
4142 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4143 */
4144message RescuePartyResetReported {
4145 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4146 optional int32 rescue_level = 1;
4147}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004148
4149/**
4150 * Logs when signed config is received from an APK, and if that config was applied successfully.
4151 * Logged from:
4152 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4153 */
4154message SignedConfigReported {
4155 enum Type {
4156 UNKNOWN_TYPE = 0;
4157 GLOBAL_SETTINGS = 1;
4158 }
4159 optional Type type = 1;
4160
4161 // The final status of the signed config received.
4162 enum Status {
4163 UNKNOWN_STATUS = 0;
4164 APPLIED = 1;
4165 BASE64_FAILURE_CONFIG = 2;
4166 BASE64_FAILURE_SIGNATURE = 3;
4167 SECURITY_EXCEPTION = 4;
4168 INVALID_CONFIG = 5;
4169 OLD_CONFIG = 6;
4170 SIGNATURE_CHECK_FAILED = 7;
4171 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004172 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004173 }
4174 optional Status status = 2;
4175
4176 // The version of the signed config processed.
4177 optional int32 version = 3;
4178
4179 // The package name that the config was extracted from.
4180 optional string from_package = 4;
4181
4182 enum Key {
4183 NO_KEY = 0;
4184 DEBUG = 1;
4185 PRODUCTION = 2;
4186 }
4187 // Which key was used to verify the config.
4188 optional Key verified_with = 5;
4189}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004190
4191/*
4192 * Logs GNSS Network-Initiated (NI) location events.
4193 *
4194 * Logged from:
4195 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4196 */
4197message GnssNiEventReported {
4198 // The type of GnssNiEvent.
4199 enum EventType {
4200 UNKNOWN = 0;
4201 NI_REQUEST = 1;
4202 NI_RESPONSE = 2;
4203 }
4204 optional EventType event_type = 1;
4205
4206 // An ID generated by HAL to associate NI notifications and UI responses.
4207 optional int32 notification_id = 2;
4208
4209 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004210 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004211
4212 // NI requires notification.
4213 optional bool need_notify = 4;
4214
4215 // NI requires verification.
4216 optional bool need_verify = 5;
4217
4218 // NI requires privacy override, no notification/minimal trace.
4219 optional bool privacy_override = 6;
4220
4221 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4222 // seconds.
4223 optional int32 timeout = 7;
4224
4225 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004226 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004227
4228 // String representing the requester of the network inititated location request.
4229 optional string requestor_id = 9;
4230
4231 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4232 // network initiated location request.
4233 optional string text = 10;
4234
4235 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004236 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004237
4238 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004239 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004240
4241 // True if SUPL ES is enabled.
4242 optional bool is_supl_es_enabled = 13;
4243
4244 // True if GNSS location is enabled.
4245 optional bool is_location_enabled = 14;
4246
4247 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004248 optional android.server.location.GnssUserResponseType user_response = 15;
4249}
4250
4251/**
4252 * Logs GNSS non-framework (NFW) location notification.
4253 *
4254 * Logged from:
4255 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4256 */
4257message GnssNfwNotificationReported {
4258 // Package name of the Android proxy application representing the non-framework entity that
4259 // requested location. Set to empty string if unknown.
4260 optional string proxy_app_package_name = 1;
4261
4262 // Protocol stack that initiated the non-framework location request.
4263 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4264
4265 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4266 // set to empty string. This field is opaque to the framework and used for logging purposes.
4267 optional string other_protocol_stack_name = 3;
4268
4269 // Source initiating/receiving the location information.
4270 optional android.server.location.NfwRequestor requestor = 4;
4271
4272 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4273 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4274 // and used for logging purposes.
4275 optional string requestor_id = 5;
4276
4277 // Indicates whether location information was provided for this request.
4278 optional android.server.location.NfwResponseType response_type = 6;
4279
4280 // True if the device is in user initiated emergency session.
4281 optional bool in_emergency_mode = 7;
4282
4283 // True if cached location is provided.
4284 optional bool is_cached_location = 8;
4285
4286 // True if proxy app permission mismatch between framework and GNSS HAL.
4287 optional bool is_permission_mismatched = 9;
4288}
4289
4290/**
4291 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4292 *
4293 * Logged from:
4294 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4295 */
4296message GnssConfigurationReported {
4297 // SUPL host name.
4298 optional string supl_host = 1;
4299
4300 // SUPL port number.
4301 optional int32 supl_port = 2;
4302
4303 // C2K host name.
4304 optional string c2k_host = 3;
4305
4306 // C2K port number.
4307 optional int32 c2k_port = 4;
4308
4309 // The SUPL version requested by Carrier.
4310 optional int32 supl_ver = 5;
4311
4312 // The SUPL mode.
4313 optional android.server.location.SuplMode supl_mode = 6;
4314
4315 // True if NI emergency SUPL restrictions is enabled.
4316 optional bool supl_es = 7;
4317
4318 // LTE Positioning Profile settings
4319 optional android.server.location.LppProfile lpp_profile = 8;
4320
4321 // Positioning protocol on A-Glonass system.
4322 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4323
4324 // True if emergency PDN is used. Otherwise, regular PDN is used.
4325 optional bool use_emergency_pdn_for_emergency_supl= 10;
4326
4327 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4328 optional android.server.location.GpsLock gps_lock = 11;
4329
4330 // Number of seconds to extend the emergency session duration post emergency call.
4331 optional int32 es_extension_sec = 12;
4332
4333 // The full list of package names of proxy Android applications representing the non-framework
4334 // location access entities (on/off the device) for which the framework user has granted
4335 // non-framework location access permission. The package names are concatenated in one string
4336 // with spaces as separators.
4337 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004338}
Jack Yu95b64f32018-12-13 18:26:11 +08004339
4340/**
4341 * Logs when a NFC device's error occurred.
4342 * Logged from:
4343 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4344 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
4345 */
4346message NfcErrorOccurred {
4347 enum Type {
4348 UNKNOWN = 0;
4349 CMD_TIMEOUT = 1;
4350 ERROR_NOTIFICATION = 2;
4351 AID_OVERFLOW = 3;
4352 }
4353 optional Type type = 1;
4354 // If it's nci cmd timeout, log the timeout command.
4355 optional uint32 nci_cmd = 2;
4356
4357 optional uint32 error_ntf_status_code = 3;
4358}
4359
4360/**
4361 * Logs when a NFC device's state changed event
4362 * Logged from:
4363 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
4364 */
4365message NfcStateChanged {
4366 enum State {
4367 UNKNOWN = 0;
4368 OFF = 1;
4369 ON = 2;
4370 ON_LOCKED = 3; // Secure Nfc enabled.
4371 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
4372 }
4373 optional State state = 1;
4374}
4375
4376/**
4377 * Logs when a NFC Beam Transaction occurred.
4378 * Logged from:
4379 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
4380 */
4381message NfcBeamOccurred {
4382 enum Operation {
4383 UNKNOWN = 0;
4384 SEND = 1;
4385 RECEIVE = 2;
4386 }
4387 optional Operation operation = 1;
4388}
4389
4390/**
4391 * Logs when a NFC Card Emulation Transaction occurred.
4392 * Logged from:
4393 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
4394 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
4395 */
4396message NfcCardemulationOccurred {
4397 enum Category {
4398 UNKNOWN = 0;
4399 HCE_PAYMENT = 1;
4400 HCE_OTHER = 2;
4401 OFFHOST = 3;
4402 }
4403 // Transaction belongs to HCE payment or HCE other category, or offhost.
4404 optional Category category = 1;
4405 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
4406 optional string se_name = 2;
4407}
4408
4409/**
4410 * Logs when a NFC Tag event occurred.
4411 * Logged from:
4412 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
4413 */
4414message NfcTagOccurred {
4415 enum Type {
4416 UNKNOWN = 0;
4417 URL = 1;
4418 BT_PAIRING = 2;
4419 PROVISION = 3;
4420 WIFI_CONNECT = 4;
4421 APP_LAUNCH = 5;
4422 OTHERS = 6;
4423 }
4424 optional Type type = 1;
4425}
4426
4427/**
4428 * Logs when Hce transaction triggered
4429 * Logged from:
4430 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4431 */
4432message NfcHceTransactionOccurred {
4433 // The latency period(in microseconds) it took for the first HCE data
4434 // exchange.
4435 optional uint32 latency_micros = 1;
4436}
4437
4438/**
4439 * Logs when SecureElement state event changed
4440 * Logged from:
4441 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4442 */
4443message SeStateChanged {
4444 enum State {
4445 UNKNOWN = 0;
4446 INITIALIZED = 1;
4447 DISCONNECTED = 2;
4448 CONNECTED = 3;
4449 HALCRASH = 4;
4450 }
4451 optional State state = 1;
4452
4453 optional string state_change_reason = 2;
4454 // SIMx or eSEx.
4455 optional string terminal = 3;
4456}
4457
4458/**
4459 * Logs when Omapi API used
4460 * Logged from:
4461 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4462 */
4463message SeOmapiReported {
4464 enum Operation {
4465 UNKNOWN = 0;
4466 OPEN_CHANNEL = 1;
4467 }
4468 optional Operation operation = 1;
4469 // SIMx or eSEx.
4470 optional string terminal = 2;
4471
Jack Yu4bb90eb2019-01-23 15:13:41 +08004472 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08004473}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004474
4475/**
Alex Saloa060aee2019-01-21 14:36:41 -08004476 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
4477 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004478 * Logged from:
4479 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
4480 */
4481message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08004482 optional int64 dispatch_latency_millis = 1;
4483}
4484
4485/**
4486 * Logs AttentionManagerService attention check result.
4487 *
4488 * Logged from:
4489 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
4490 */
4491message AttentionManagerServiceResultReported {
4492 // See core/java/android/service/attention/AttentionService.java
4493 enum AttentionCheckResult {
4494 UNKNOWN = 20;
4495 ATTENTION_SUCCESS_ABSENT = 0;
4496 ATTENTION_SUCCESS_PRESENT = 1;
4497 ATTENTION_FAILURE_PREEMPTED = 2;
4498 ATTENTION_FAILURE_TIMED_OUT = 3;
4499 ATTENTION_FAILURE_UNKNOWN = 4;
4500 }
4501 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004502}
Michael Groover9e7b06e2018-12-28 19:55:51 -08004503
4504/**
4505 * Logs when an adb connection changes state.
4506 *
4507 * Logged from:
4508 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
4509 */
4510message AdbConnectionChanged {
4511 // The last time this system connected via adb, or 0 if the 'always allow' option was not
4512 // previously selected for this system.
4513 optional int64 last_connection_time_millis = 1;
4514
4515 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
4516 // to reconnect via adb without user interaction.
4517 optional int64 auth_window_millis = 2;
4518
4519 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
4520 optional android.debug.AdbConnectionStateEnum state = 3;
4521
4522 // True if the 'always allow' option was selected for this system.
4523 optional bool always_allow = 4;
4524}
Carter Hsub8fd1e92019-01-11 15:24:45 +08004525
4526/*
4527 * Logs the reported speech DSP status.
4528 *
4529 * Logged from:
4530 * Vendor audio implementation.
4531 */
4532message SpeechDspStatReported {
4533 // The total Speech DSP uptime in milliseconds.
4534 optional int32 total_uptime_millis = 1;
4535 // The total Speech DSP downtime in milliseconds.
4536 optional int32 total_downtime_millis = 2;
4537 optional int32 total_crash_count = 3;
4538 optional int32 total_recover_count = 4;
4539}