blob: 1a0a983520518db24bd123810b1a4e0dfbe2cfea [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Fan Zhangf837b8e2018-10-23 12:38:30 -070025import "frameworks/base/core/proto/android/app/settings_enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070026import "frameworks/base/core/proto/android/app/job/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080027import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080028import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080029import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080030import "frameworks/base/core/proto/android/debug/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080031import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080032import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080033import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080034import "frameworks/base/core/proto/android/server/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080035import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070036import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080037import "frameworks/base/core/proto/android/service/usb.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070038import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080039import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070040import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080041import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080042import "frameworks/base/core/proto/android/telephony/enums.proto";
43import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000044import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
45import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080046
Yao Chend54f9dd2017-10-17 17:37:48 +000047/**
Stefan Lafonae2df012017-11-14 09:17:21 -080048 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000049 * raw stats log events from the Android system, also known as "atoms."
50 *
51 * This field contains a single oneof with all of the available messages.
52 * The stats-log-api-gen tool runs as part of the Android build and
53 * generates the android.util.StatsLog class, which contains the constants
54 * and methods that Android uses to log.
55 *
Stefan Lafonae2df012017-11-14 09:17:21 -080056 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000057 * Instead, statsd on Android constructs these messages synthetically,
58 * in the format defined here and in stats_log.proto.
59 */
Stefan Lafonae2df012017-11-14 09:17:21 -080060message Atom {
61 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070062 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070063 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
64 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070065 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070066 BleScanResultReceived ble_scan_result_received = 4;
67 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080068 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070069 SyncStateChanged sync_state_changed = 7;
70 ScheduledJobStateChanged scheduled_job_state_changed = 8;
71 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070072 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080073 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
74 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
75 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070076 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
77 MemoryFactorStateChanged memory_factor_state_changed = 15;
78 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
79 CachedKillReported cached_kill_reported = 17;
80 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070081 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080082 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
83 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
84 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070085 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080086 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070087 CameraStateChanged camera_state_changed = 25;
88 FlashlightStateChanged flashlight_state_changed = 26;
89 UidProcessStateChanged uid_process_state_changed = 27;
90 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
91 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070092 BatteryLevelChanged battery_level_changed = 30;
93 ChargingStateChanged charging_state_changed = 31;
94 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070095 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -080096 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -070097 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
98 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070099 WifiLockStateChanged wifi_lock_state_changed = 37;
100 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
101 WifiScanStateChanged wifi_scan_state_changed = 39;
102 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700103 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700104 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700105 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900106 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700107 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800108 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800109 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800110 AppStartOccurred app_start_occurred = 48;
111 AppStartCanceled app_start_canceled = 49;
112 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800113 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800114 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800115 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800116 LmkStateChanged lmk_state_changed = 54;
117 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800118 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800119 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800120 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800121 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800122 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800123 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800124 KeyguardStateChanged keyguard_state_changed = 62;
125 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
126 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800127 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800128 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800129 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
130 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800131 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700132 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800133 SpeakerImpedanceReported speaker_impedance_reported = 71;
134 HardwareFailed hardware_failed = 72;
135 PhysicalDropDetected physical_drop_detected = 73;
136 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800137 MobileConnectionStateChanged mobile_connection_state_changed = 75;
138 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700139 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800140 AppCrashOccurred app_crash_occurred = 78;
141 ANROccurred anr_occurred = 79;
142 WTFOccurred wtf_occurred = 80;
143 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700144 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700145 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700146 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700147 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700148 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700149 FingerprintAcquired fingerprint_acquired = 87;
150 FingerprintAuthenticated fingerprint_authenticated = 88;
151 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700152 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700153 BatteryHealthSnapshot battery_health_snapshot = 91;
154 SlowIo slow_io = 92;
155 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700156 PhoneServiceStateChanged phone_service_state_changed = 94;
157 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100158 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700159 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700160 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700161 // TODO: service state change is very noisy shortly after boot, as well
162 // as at other transitions - coming out of doze, device plugged in, etc.
163 // Consider removing this if it becomes a problem
164 ServiceStateChanged service_state_changed = 99;
165 ServiceLaunchReported service_launch_reported = 100;
Yangster-macb89807e2018-11-15 21:10:57 -0800166 PhenotypeFlagStateChanged phenotype_flag_state_changed = 101;
167 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000168 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800169 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
170 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
171 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
172 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
173 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
174 DocsUILaunchReported docs_ui_launch_reported = 109;
175 DocsUIRootVisitedReported docs_ui_root_visited = 110;
176 DocsUIStartupMsReported docs_ui_startup_ms = 111;
177 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800178 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
179 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000180 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800181 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800182 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
183 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
184 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
185 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800186 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000187 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000188 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800189 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800190 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800191 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
192 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000193 AppDowngraded app_downgraded = 128;
194 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
195 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800196 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
197 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800198 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800199 NfcErrorOccurred nfc_error_occurred = 134;
200 NfcStateChanged nfc_state_changed = 135;
201 NfcBeamOccurred nfc_beam_occurred = 136;
202 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
203 NfcTagOccurred nfc_tag_occurred = 138;
204 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
205 SeStateChanged se_state_changed = 140;
206 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800207 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800208 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800209 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800210 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800211 UsbContaminantReported usb_contaminant_reported = 146;
Yao Chend54f9dd2017-10-17 17:37:48 +0000212 }
David Chenc8a43242017-10-17 16:23:28 -0700213
David Chen6e3e6cb2018-01-03 16:14:06 -0800214 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000215 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700216 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800217 WifiBytesTransfer wifi_bytes_transfer = 10000;
218 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
219 MobileBytesTransfer mobile_bytes_transfer = 10002;
220 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800221 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800222 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800223 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800224 CpuTimePerFreq cpu_time_per_freq = 10008;
225 CpuTimePerUid cpu_time_per_uid = 10009;
226 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800227 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800228 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800229 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800230 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800231 SystemElapsedRealtime system_elapsed_realtime = 10014;
232 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800233 CpuActiveTime cpu_active_time = 10016;
234 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000235 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800236 RemainingBatteryCapacity remaining_battery_capacity = 10019;
237 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800238 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100239 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100240 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100241 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000242 DiskStats disk_stats = 10025;
243 DirectoryUsage directory_usage = 10026;
244 AppSize app_size = 10027;
245 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700246 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700247 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700248 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700249 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700250 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800251 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700252 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100253 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100254 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700255 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800256 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
257 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
258 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000259 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800260 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800261 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800262 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000263 DebugElapsedClock debug_elapsed_clock = 10046;
264 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
David Chenc8a43242017-10-17 16:23:28 -0700265 }
yroa1fe77c2018-02-26 14:22:54 -0800266
Bookatz76aafcf2018-09-17 16:17:10 -0700267 // DO NOT USE field numbers above 100,000 in AOSP.
268 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
269 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700270}
271
Yao Chend54f9dd2017-10-17 17:37:48 +0000272/**
Yangster-mac20877162017-12-22 17:19:39 -0800273 * This proto represents a node of an attribution chain.
274 * Note: All attribution chains are represented as a repeated field of type
275 * AttributionNode. It is understood that in such arrays, the order is that
276 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000277 */
Yangster-mac20877162017-12-22 17:19:39 -0800278message AttributionNode {
279 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800280 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800281
Yangster-mac20877162017-12-22 17:19:39 -0800282 // The (optional) string tag for an element in the attribution chain. If the
283 // element has no tag, it is encoded as an empty string.
284 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700285}
286
Yangster-mac48b3d622018-08-18 12:38:11 -0700287message KeyValuePair {
288 optional int32 key = 1;
289 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700290 int32 value_int = 2;
291 int64 value_long = 3;
292 string value_str = 4;
293 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700294 }
295}
296
297message KeyValuePairsAtom {
298 optional int32 uid = 1;
299 repeated KeyValuePair pairs = 2;
300}
301
Yao Chend54f9dd2017-10-17 17:37:48 +0000302/*
303 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800304 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000305 *
306 * RULES:
307 * - The field ids for each atom must start at 1, and count upwards by 1.
308 * Skipping field ids is not allowed.
309 * - These form an API, so renaming, renumbering or removing fields is
310 * not allowed between android releases. (This is not currently enforced,
311 * but there will be a tool to enforce this restriction).
312 * - The types must be built-in protocol buffer types, namely, no sub-messages
313 * are allowed (yet). The bytes type is also not allowed.
314 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800315 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000316 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800317 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000318 * - A field that is a uid should be a string field, tagged with the [xxx]
319 * annotation. The generated code on android will be represented by UIDs,
320 * and those UIDs will be translated in xxx to those strings.
321 *
322 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700323 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000324 * - If there is a UID, it goes first. Think in an object-oriented fashion.
325 * *****************************************************************************
326 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700327
Yao Chend54f9dd2017-10-17 17:37:48 +0000328/**
Yangster-mace16189a2018-08-26 12:20:16 -0700329 * Logs when the Thermal service HAL notifies the throttling start/stop events.
330 *
331 * Logged from:
332 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
333 */
334message ThermalThrottlingStateChanged {
335 optional android.os.TemperatureTypeEnum sensor_type = 1;
336
337 enum State {
338 UNKNOWN = 0;
339 START = 1;
340 STOP = 2;
341 }
342
343 optional State state = 2;
344
345 optional float temperature = 3;
346}
347
348/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000349 * Logs when the screen state changes.
350 *
351 * Logged from:
352 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
353 */
354message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800355 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700356 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700357}
Yao Chend54f9dd2017-10-17 17:37:48 +0000358
359/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700360 * Logs that the process state of the uid, as determined by ActivityManager
361 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000362 *
363 * Logged from:
364 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
365 */
Bookatzc1a050a2017-10-10 15:49:28 -0700366message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700367 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000368
Bookatzdb026a22018-01-10 19:01:56 -0800369 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700370 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000371}
372
373/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700374 * Logs process state change of a process, as per the activity manager.
375 *
376 * Logged from:
377 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
378 */
379message ProcessStateChanged {
380 optional int32 uid = 1;
381 optional string process_name = 2;
382 optional string package_name = 3;
383 // TODO: remove this when validation is done
384 optional int64 version = 5;
385 // The state, from frameworks/base/core/proto/android/app/enums.proto.
386 optional android.app.ProcessStateEnum state = 4;
387}
388
389/**
390 * Logs when ActivityManagerService sleep state is changed.
391 *
392 * Logged from:
393 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
394 */
395message ActivityManagerSleepStateChanged {
396 // TODO: import frameworks proto
397 enum State {
398 UNKNOWN = 0;
399 ASLEEP = 1;
400 AWAKE = 2;
401 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700402 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700403}
404
405/**
406 * Logs when system memory state changes.
407 *
408 * Logged from:
409 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
410 */
411message MemoryFactorStateChanged {
412 // TODO: import frameworks proto
413 enum State {
414 MEMORY_UNKNOWN = 0;
415 NORMAL = 1; // normal.
416 MODERATE = 2; // moderate memory pressure.
417 LOW = 3; // low memory.
418 CRITICAL = 4; // critical memory.
419
420 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700421 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700422}
423
424/**
425 * Logs when app is using too much cpu, according to ActivityManagerService.
426 *
427 * Logged from:
428 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
429 */
430message ExcessiveCpuUsageReported {
431 optional int32 uid = 1;
432 optional string process_name = 2;
433 optional string package_name = 3;
434 // package version. TODO: remove this when validation is done
435 optional int64 version = 4;
436}
437
438/**
439 * Logs when a cached process is killed, along with its pss.
440 *
441 * Logged from:
442 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
443 */
444message CachedKillReported {
445 optional int32 uid = 1;
446 optional string process_name = 2;
447 optional string package_name = 3;
448 // TODO: remove this when validation is done
449 optional int64 version = 5;
450 optional int64 pss = 4;
451}
452
453/**
454 * Logs when memory stats of a process is reported.
455 *
456 * Logged from:
457 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
458 */
459message ProcessMemoryStatReported {
460 optional int32 uid = 1;
461 optional string process_name = 2;
462 optional string package_name = 3;
463 //TODO: remove this when validation is done
464 optional int64 version = 9;
465 optional int64 pss = 4;
466 optional int64 uss = 5;
467 optional int64 rss = 6;
468 enum Type {
469 ADD_PSS_INTERNAL_SINGLE = 0;
470 ADD_PSS_INTERNAL_ALL_MEM = 1;
471 ADD_PSS_INTERNAL_ALL_POLL = 2;
472 ADD_PSS_EXTERNAL = 3;
473 ADD_PSS_EXTERNAL_SLOW = 4;
474 }
475 optional Type type = 7;
476 optional int64 duration = 8;
477}
478
479/**
Bookatzc1a050a2017-10-10 15:49:28 -0700480 * Logs that a process started, finished, crashed, or ANRed.
481 *
482 * Logged from:
483 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
484 */
485message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700486 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700487
David Chen0b5c90c2018-01-25 16:51:49 -0800488 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800489 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700490
Bookatzddccf0a2017-11-28 16:48:14 -0800491 // What lifecycle state the process changed to.
492 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800493 enum State {
494 FINISHED = 0;
495 STARTED = 1;
496 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800497 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800498 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700499}
500
Bookatzc1a050a2017-10-10 15:49:28 -0700501/**
502 * Logs when the ble scan state changes.
503 *
504 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700505 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700506 */
507message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800508 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700509
510 enum State {
511 OFF = 0;
512 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700513 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
514 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700515 }
516 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700517
Bookatze5ec0b42018-03-26 13:34:56 -0700518 // Does the scan have a filter.
519 optional bool is_filtered = 3;
520 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
521 optional bool is_first_match = 4;
522 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
523 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700524}
525
526/**
527 * Logs reporting of a ble scan finding results.
528 *
529 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700530 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700531 */
Bookatzae6738e2018-09-13 11:38:56 -0700532// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700533message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800534 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700535
536 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800537 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700538}
539
540/**
541 * Logs when a sensor state changes.
542 *
543 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700544 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700545 */
546message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800547 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700548
Bookatzc1a050a2017-10-10 15:49:28 -0700549 // The id (int) of the sensor.
550 optional int32 sensor_id = 2;
551
552 enum State {
553 OFF = 0;
554 ON = 1;
555 }
556 optional State state = 3;
557}
558
Bookatzc1a050a2017-10-10 15:49:28 -0700559/**
560 * Logs when GPS state changes.
561 *
562 * Logged from:
563 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
564 */
565message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800566 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700567
568 enum State {
569 OFF = 0;
570 ON = 1;
571 }
572 optional State state = 2;
573}
574
Bookatz48d362e2018-11-06 15:49:08 -0800575/**
576 * Logs when GPS signal quality.
577 *
578 * Logged from:
579 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
580 */
581message GpsSignalQualityChanged {
582 optional android.server.location.GpsSignalQualityEnum level = 1;
583}
584
Bookatzc1a050a2017-10-10 15:49:28 -0700585
586/**
587 * Logs when a sync manager sync state changes.
588 *
589 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700590 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700591 */
592message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800593 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700594
David Chen0b5c90c2018-01-25 16:51:49 -0800595 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800596 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700597
598 enum State {
599 OFF = 0;
600 ON = 1;
601 }
602 optional State state = 3;
603}
604
Yangster-mac96353002018-09-05 11:18:55 -0700605/*
606 * Deferred job stats.
607 *
608 * Logged from:
609 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
610*/
611message DeferredJobStatsReported {
612 repeated AttributionNode attribution_node = 1;
613
614 // Number of jobs deferred.
615 optional int32 num_jobs_deferred = 2;
616
617 // Time since the last job runs.
618 optional int64 time_since_last_job_millis = 3;
619}
620
Bookatzc1a050a2017-10-10 15:49:28 -0700621/**
622 * Logs when a job scheduler job state changes.
623 *
624 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700625 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700626 */
627message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800628 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700629
630 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800631 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700632
633 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800634 FINISHED = 0;
635 STARTED = 1;
636 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700637 }
638 optional State state = 3;
639
Tej Singh33a412b2018-03-16 18:43:59 -0700640 // The reason a job has stopped.
641 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700642 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700643 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700644}
645
646/**
647 * Logs when the audio state changes.
648 *
649 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700650 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700651 */
652message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800653 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700654
655 enum State {
656 OFF = 0;
657 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700658 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
659 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700660 }
661 optional State state = 2;
662}
663
664/**
665 * Logs when the video codec state changes.
666 *
667 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700668 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700669 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800670message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800671 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700672
673 enum State {
674 OFF = 0;
675 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700676 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
677 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700678 }
679 optional State state = 2;
680}
681
682/**
683 * Logs when the flashlight state changes.
684 *
685 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700686 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700687 */
688message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800689 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700690
691 enum State {
692 OFF = 0;
693 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700694 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
695 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700696 }
697 optional State state = 2;
698}
699
700/**
701 * Logs when the camera state changes.
702 *
703 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700704 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700705 */
706message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800707 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700708
709 enum State {
710 OFF = 0;
711 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700712 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
713 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700714 }
715 optional State state = 2;
716}
717
718/**
719 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000720 *
721 * Logged from:
722 * TODO
723 */
Bookatzd6746242017-10-24 18:39:35 -0700724message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800725 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000726
Bookatz1a1b0462018-01-12 11:47:03 -0800727 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
728 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700729 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700730
731 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
732 optional string tag = 3;
733
734 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800735 RELEASE = 0;
736 ACQUIRE = 1;
737 CHANGE_RELEASE = 2;
738 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700739 }
740 optional State state = 4;
741}
742
743/**
Bookatzc1a050a2017-10-10 15:49:28 -0700744 * Logs when a partial wakelock is considered 'long' (over 1 min).
745 *
746 * Logged from:
747 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
748 */
749message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800750 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700751
Yao Chend54f9dd2017-10-17 17:37:48 +0000752 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
753 optional string tag = 2;
754
Bookatzc1a050a2017-10-10 15:49:28 -0700755 // TODO: I have no idea what this is.
756 optional string history_tag = 3;
757
758 enum State {
759 OFF = 0;
760 ON = 1;
761 }
762 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000763}
764
Bookatzc1a050a2017-10-10 15:49:28 -0700765/**
Bookatza66083f2018-09-20 17:24:00 -0700766 * Logs when the device is interactive, according to the PowerManager Notifier.
767 *
768 * Logged from:
769 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
770 */
771message InteractiveStateChanged {
772 enum State {
773 OFF = 0;
774 ON = 1;
775 }
776 optional State state = 1;
777}
778
779/**
Bookatzc1a050a2017-10-10 15:49:28 -0700780 * Logs Battery Saver state change.
781 *
782 * Logged from:
783 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
784 */
785message BatterySaverModeStateChanged {
786 enum State {
787 OFF = 0;
788 ON = 1;
789 }
790 optional State state = 1;
791}
792
793/**
794 * Logs Doze mode state change.
795 *
796 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800797 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700798 */
799message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800800 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800801}
802
803
804/**
805 * Logs state change of Doze mode including maintenance windows.
806 *
807 * Logged from:
808 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
809 */
810message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800811 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700812}
813
814/**
815 * Logs screen brightness level.
816 *
817 * Logged from:
818 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
819 */
820message ScreenBrightnessChanged {
821 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
822 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700823}
824
825/**
826 * Logs battery level (percent full, from 0 to 100).
827 *
828 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700829 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700830 */
831message BatteryLevelChanged {
832 // Battery level. Should be in [0, 100].
833 optional int32 battery_level = 1;
834}
835
836/**
837 * Logs change in charging status of the device.
838 *
839 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700840 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700841 */
842message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800843 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
844 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700845}
846
847/**
848 * Logs whether the device is plugged in, and what power source it is using.
849 *
850 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700851 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700852 */
853message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800854 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
855 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700856}
857
Bookatz8c6571b2017-10-24 15:04:41 -0700858/**
859 * Logs when an app's wakeup alarm fires.
860 *
861 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700862 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700863 */
864message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800865 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800866
867 // Name of the wakeup alarm.
868 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700869
870 // Name of source package (for historical reasons, since BatteryStats tracked it).
871 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800872}
873
874/**
875 * Logs when an an app causes the mobile radio to change state.
876 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
877 *
878 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700879 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800880 */
881message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800882 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800883
Bookatz1a1b0462018-01-12 11:47:03 -0800884 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
885 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800886}
887
888/**
889 * Logs when an an app causes the wifi radio to change state.
890 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
891 *
892 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700893 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800894 */
895message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800896 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800897
Bookatz1a1b0462018-01-12 11:47:03 -0800898 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
899 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700900}
901
902/**
903 * Logs kernel wakeup reasons and aborts.
904 *
905 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700906 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700907 */
908message KernelWakeupReported {
909 // Name of the kernel wakeup reason (or abort).
910 optional string wakeup_reason_name = 1;
911
912 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800913 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700914}
915
916/**
Bookatzda1798c2018-12-13 14:16:00 -0800917 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800918 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800919 *
920 * Logged from:
921 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
922 */
923message WifiEnabledStateChanged {
924 enum State {
925 OFF = 0;
926 ON = 1;
927 }
928 optional State state = 1;
929}
930
931/**
932 * 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 -0800933 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
934 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800935 *
936 * Logged from:
937 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
938 */
939message WifiRunningStateChanged {
940 repeated AttributionNode attribution_node = 1;
941
942 enum State {
943 OFF = 0;
944 ON = 1;
945 }
946 optional State state = 2;
947}
948
949/**
Bookatze5885242017-10-24 20:10:31 -0700950 * Logs wifi locks held by an app.
951 *
952 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700953 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700954 */
955message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800956 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700957
958 enum State {
959 OFF = 0;
960 ON = 1;
961 }
962 optional State state = 2;
963}
964
965/**
966 * Logs wifi signal strength changes.
967 *
968 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800969 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700970 */
971message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800972 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
973 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700974}
975
976/**
977 * Logs wifi scans performed by an app.
978 *
979 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800980 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700981 */
982message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800983 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700984
985 enum State {
986 OFF = 0;
987 ON = 1;
988 }
989 optional State state = 2;
990}
991
992/**
Tej Singh4503e102018-01-04 14:35:01 -0800993 * Logs wifi multicast locks held by an app
994 *
995 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800996 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -0800997 */
998message WifiMulticastLockStateChanged {
999 repeated AttributionNode attribution_node = 1;
1000
1001 enum State {
1002 OFF = 0;
1003 ON = 1;
1004 }
1005 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001006
1007 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001008}
1009
1010/**
Tej Singh1ea42892018-01-19 09:27:00 -08001011 * Logs shutdown reason and duration on next boot.
1012 *
1013 * Logged from:
1014 * frameworks/base/core/java/com/android/server/BootReceiver.java
1015 */
1016message ShutdownSequenceReported {
1017 // True if shutdown is for a reboot. Default: false if we do not know.
1018 optional bool reboot = 1;
1019
1020 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1021 optional string reason = 2;
1022
1023 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1024 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001025 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001026
1027 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001028 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001029}
1030
Tej Singh6483ea42018-01-25 17:45:49 -08001031
1032/**
1033 * Logs boot reason and duration.
1034 *
1035 * Logged from:
1036 * system/core/bootstat/bootstat.cpp
1037 */
1038message BootSequenceReported {
1039 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1040 // Default: "<EMPTY>" if not available.
1041 optional string bootloader_reason = 1;
1042
1043 // Reason for system boot. Eg. bootloader, reboot,userrequested
1044 // Default: "<EMPTY>" if not available.
1045 optional string system_reason = 2;
1046
1047 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001048 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001049
1050 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001051 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001052
1053 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001054 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001055
1056 // Time since last boot in ms. Default: 0 if not available.
1057 optional int64 time_since_last_boot = 6;
1058}
1059
Tej Singhc477d9c2018-02-05 18:31:39 -08001060
1061/**
1062 * Logs call state and disconnect cause (if applicable).
1063 *
1064 * Logged from:
1065 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1066 */
1067message CallStateChanged {
1068 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1069 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1070 optional android.telecom.CallStateEnum call_state = 1;
1071
1072 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1073 // This value is only applicable when the call_state is DISCONNECTED, and
1074 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1075 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1076 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1077
1078 // True if the call is self-managed, which are apps that use the
1079 // telecom infrastructure to make their own calls.
1080 optional bool self_managed = 3;
1081
1082 // True if call is external. External calls are calls on connected Wear
1083 // devices but show up in Telecom so the user can pull them onto the device.
1084 optional bool external_call = 4;
1085}
1086
Tej Singh1ea42892018-01-19 09:27:00 -08001087/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001088 * Logs keyguard state. The keyguard is the lock screen.
1089 *
1090 * Logged from:
1091 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1092 */
1093message KeyguardStateChanged {
1094 enum State {
1095 UNKNOWN = 0;
1096 // The keyguard is hidden when the phone is unlocked.
1097 HIDDEN = 1;
1098 // The keyguard is shown when the phone is locked (screen turns off).
1099 SHOWN= 2;
1100 // The keyguard is occluded when something is overlaying the keyguard.
1101 // Eg. Opening the camera while on the lock screen.
1102 OCCLUDED = 3;
1103 }
1104 optional State state = 1;
1105}
1106
1107/**
1108 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1109 * prompts the user to enter a password (pattern, pin, etc).
1110 *
1111 * Logged from:
1112 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1113 */
1114
1115message KeyguardBouncerStateChanged {
1116 enum State {
1117 UNKNOWN = 0;
1118 // Bouncer is hidden, either as a result of successfully entering the
1119 // password, screen timing out, or user going back to lock screen.
1120 HIDDEN = 1;
1121 // This is when the user is being prompted to enter the password.
1122 SHOWN = 2;
1123 }
1124 optional State state = 1;
1125}
1126
1127/**
1128 * Logs the result of entering a password into the keyguard bouncer.
1129 *
1130 * Logged from:
1131 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1132 */
1133message KeyguardBouncerPasswordEntered {
1134 enum BouncerResult {
1135 UNKNOWN = 0;
1136 // The password entered was incorrect.
1137 FAILURE = 1;
1138 // The password entered was correct.
1139 SUCCESS = 2;
1140 }
1141 optional BouncerResult result = 1;
1142}
1143
Tej Singha883b372018-02-15 11:30:01 -08001144/*
1145 * Logs changes to the configuration of the device. The configuration is defined
1146 * in frameworks/base/core/java/android/content/res/Configuration.java
1147 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1148 * Please go there to interpret the possible values each field can be.
1149 *
1150 * Logged from:
1151 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1152 */
1153message ResourceConfigurationChanged {
1154 // Bit mask of color capabilities of the screen.
1155 // Contains information about the color gamut and hdr mode of the screen.
1156 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001157 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001158
1159 // The target screen density being rendered to.
1160 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001161 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001162
1163 // Current user preference for the scaling factor for fonts,
1164 // relative to the base density scaling.
1165 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001166 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001167
1168 // Flag indicating whether the hard keyboard is hidden.
1169 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001170 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001171
1172 // The type of keyboard attached to the device.
1173 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1174 optional int32 keyboard = 5;
1175
1176 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1177 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001178 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001179
1180 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1181 // 0 if undefined.
1182 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1183 optional int32 mcc = 7;
1184
1185 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1186 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1187 // MNC_ZERO symbol defined in Configuration.java.
1188 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1189 optional int32 mnc = 8;
1190
1191 // The kind of navigation available on the device.
1192 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1193 optional int32 navigation = 9;
1194
1195 // Flag indicating whether the navigation is available.
1196 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001197 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001198
1199 // Overall orientation of the screen.
1200 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1201 optional int32 orientation = 11;
1202
1203 // The current height of the available screen space, in dp units.
1204 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001205 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001206
1207 // Bit mask of overall layout of the screen.
1208 // Contains information about screen size, whether the screen is wider/taller
1209 // than normal, whether the screen layout is right-tl-left or left-to-right,
1210 // and whether the screen has a rounded shape.
1211 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001212 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001213
1214 // Current width of the available screen space, in dp units.
1215 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001216 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001217
1218 // The smallest screen size an application will see in normal operation.
1219 // This is the smallest value of both screenWidthDp and screenHeightDp
1220 // in portrait and landscape.
1221 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001222 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001223
1224 // The type of touch screen attached to the device.
1225 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1226 optional int32 touchscreen = 16;
1227
1228 // Bit mask of the ui mode.
1229 // Contains information about the overall ui mode of the device.
1230 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1231 // Also contains information about whether the device is in night mode.
1232 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001233 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001234}
1235
Tej Singheee317b2018-03-07 19:28:05 -08001236
1237/**
1238 * Logs changes in the connection state of the mobile radio.
1239 *
1240 * Logged from:
1241 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1242 */
1243message MobileConnectionStateChanged {
1244 // States are from the state machine DataConnection.java.
1245 enum State {
1246 UNKNOWN = 0;
1247 // The connection is inactive, or disconnected.
1248 INACTIVE = 1;
1249 // The connection is being activated, or connecting.
1250 ACTIVATING = 2;
1251 // The connection is active, or connected.
1252 ACTIVE = 3;
1253 // The connection is disconnecting.
1254 DISCONNECTING = 4;
1255 // The connection is disconnecting after creating a connection.
1256 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1257 }
1258 optional State state = 1;
1259 // For multi-sim phones, this distinguishes between the sim cards.
1260 optional int32 sim_slot_index = 2;
1261 // Used to identify the connection. Starts at 0 and increments by 1 for
1262 // every new network created. Resets whenever the device reboots.
1263 optional int32 data_connection_id = 3;
1264 // A bitmask for the capabilities of this connection.
1265 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1266 // Default value (if we have no information): 0
1267 optional int64 capabilities = 4;
1268 // If this connection has internet.
1269 // This just checks if the DEFAULT bit of capabilities is set.
1270 optional bool has_internet = 5;
1271}
1272
1273/**
1274 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1275 *
1276 * Logged from:
1277 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1278 */
1279message MobileRadioTechnologyChanged {
1280 optional android.telephony.NetworkTypeEnum state = 1;
1281 // For multi-sim phones, this distinguishes between the sim cards.
1282 optional int32 sim_slot_index = 2;
1283}
1284
Andrew Chantb56388b2018-03-22 21:07:33 -07001285/**
1286 * Logs the VID and PID of any connected USB devices.
1287 *
1288 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1289 *
1290 * Logged by Vendor.
1291 */
1292message UsbDeviceAttached {
1293 optional int32 vid = 1;
1294 optional int32 pid = 2;
1295 optional bool has_audio = 3;
1296 optional bool has_hid = 4;
1297 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001298 enum State {
1299 STATE_DISCONNECTED = 0;
1300 STATE_CONNECTED = 1;
1301 }
1302 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001303 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001304}
1305
Tej Singheee317b2018-03-07 19:28:05 -08001306
Tej Singhdd7bd352018-02-09 19:33:15 -08001307/**
Tej Singh5d991e12018-03-09 19:48:11 -08001308 * Logs when Bluetooth is enabled and disabled.
1309 *
1310 * Logged from:
1311 * services/core/java/com/android/server/BluetoothManagerService.java
1312 */
1313message BluetoothEnabledStateChanged {
1314 repeated AttributionNode attribution_node = 1;
1315 // Whether or not bluetooth is enabled on the device.
1316 enum State {
1317 UNKNOWN = 0;
1318 ENABLED = 1;
1319 DISABLED = 2;
1320 }
1321 optional State state = 2;
1322 // The reason for being enabled/disabled.
1323 // Eg. Airplane mode, crash, application request.
1324 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1325 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001326 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001327}
1328
1329/**
Jack Hed9837c82019-01-09 01:19:13 -08001330 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001331 *
1332 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001333 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1334 *
1335 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001336 */
1337message BluetoothConnectionStateChanged {
1338 // The state of the connection.
1339 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1340 optional android.bluetooth.ConnectionStateEnum state = 1;
1341 // An identifier that can be used to match connect and disconnect events.
1342 // Currently is last two bytes of a hash of a device level ID and
1343 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001344 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1345 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001346 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1347 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001348 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001349 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001350 // An identifier that can be used to match events for this device.
1351 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1352 // Salt: Randomly generated 256 bit value
1353 // Hash algorithm: HMAC-SHA256
1354 // Size: 32 byte
1355 // Default: null or empty if the device identifier is not known
1356 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1357}
1358
1359/**
1360 * Logs when a Bluetooth device connects and disconnects over ACL
1361 *
1362 * Logged from:
1363 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1364 *
1365 * Next Tag: 3
1366 */
1367message BluetoothAclConnectionStateChanged {
1368 // An identifier that can be used to match events for this device.
1369 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1370 // Salt: Randomly generated 256 bit value
1371 // Hash algorithm: HMAC-SHA256
1372 // Size: 32 byte
1373 // Default: null or empty if the device identifier is not known
1374 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1375 // The state of the connection.
1376 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1377 optional android.bluetooth.ConnectionStateEnum state = 2;
1378}
1379
1380/**
1381 * Logs when a Bluetooth device connects and disconnects over SCO
1382 *
1383 * Logged from:
1384 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1385 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1386 *
1387 * Next Tag: 4
1388 */
1389message BluetoothScoConnectionStateChanged {
1390 // An identifier that can be used to match events for this device.
1391 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1392 // Salt: Randomly generated 256 bit value
1393 // Hash algorithm: HMAC-SHA256
1394 // Size: 32 byte
1395 // Default: null or empty if the device identifier is not known
1396 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1397 // The state of the connection.
1398 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1399 optional android.bluetooth.ConnectionStateEnum state = 2;
1400 // Codec used for this SCO connection
1401 // Default: UNKNOWN
1402 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001403}
1404
Jack Heab86dbd22018-12-18 15:43:27 -08001405// Logs when there is an event affecting Bluetooth device's link layer connection.
1406// - This event is triggered when there is a related HCI command or event
1407// - Users of this metrics can deduce Bluetooth device's connection state from these events
1408// - HCI commands are logged before the command is sent, after receiving command status, and after
1409// receiving command complete
1410// - HCI events are logged when they arrive
1411//
1412// Low level log from system/bt
1413//
1414// Bluetooth classic commands:
1415// - CMD_CREATE_CONNECTION
1416// - CMD_DISCONNECT
1417// - CMD_CREATE_CONNECTION_CANCEL
1418// - CMD_ACCEPT_CONNECTION_REQUEST
1419// - CMD_REJECT_CONNECTION_REQUEST
1420// - CMD_SETUP_ESCO_CONNECTION
1421// - CMD_ACCEPT_ESCO_CONNECTION
1422// - CMD_REJECT_ESCO_CONNECTION
1423// - CMD_ENH_SETUP_ESCO_CONNECTION
1424// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1425//
1426// Bluetooth low energy commands:
1427// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1428// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1429// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1430// - CMD_BLE_CLEAR_WHITE_LIST
1431// - CMD_BLE_ADD_WHITE_LIST
1432// - CMD_BLE_REMOVE_WHITE_LIST
1433//
1434// Bluetooth classic events:
1435// - EVT_CONNECTION_COMP
1436// - EVT_CONNECTION_REQUEST
1437// - EVT_DISCONNECTION_COMP
1438// - EVT_ESCO_CONNECTION_COMP
1439// - EVT_ESCO_CONNECTION_CHANGED
1440//
1441// Bluetooth low energy meta events:
1442// - BLE_EVT_CONN_COMPLETE_EVT
1443// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1444//
1445// Next tag: 10
1446message BluetoothLinkLayerConnectionEvent {
1447 // An identifier that can be used to match events for this device.
1448 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1449 // Salt: Randomly generated 256 bit value
1450 // Hash algorithm: HMAC-SHA256
1451 // Size: 32 byte
1452 // Default: null or empty if the device identifier is not known
1453 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1454 // Connection handle of this connection if available
1455 // Range: 0x0000 - 0x0EFF (12 bits)
1456 // Default: 0xFFFF if the handle is unknown
1457 optional int32 connection_handle = 2;
1458 // Direction of the link
1459 // Default: DIRECTION_UNKNOWN
1460 optional android.bluetooth.DirectionEnum direction = 3;
1461 // Type of this link
1462 // Default: LINK_TYPE_UNKNOWN
1463 optional android.bluetooth.LinkTypeEnum type = 4;
1464
1465 // Reason metadata for this link layer connection event, rules for interpretation:
1466 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1467 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1468 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1469 // set and valid, ignore hci_ble_event
1470
1471 // HCI command associated with this event
1472 // Default: CMD_UNKNOWN
1473 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1474 // HCI event associated with this event
1475 // Default: EVT_UNKNOWN
1476 optional android.bluetooth.hci.EventEnum hci_event = 6;
1477 // HCI BLE meta event associated with this event
1478 // Default: BLE_EVT_UNKNOWN
1479 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1480 // HCI command status code if this is triggerred by hci_cmd
1481 // Default: STATUS_UNKNOWN
1482 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1483 // HCI reason code associated with this event
1484 // Default: STATUS_UNKNOWN
1485 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1486}
1487
1488
Tej Singh5d991e12018-03-09 19:48:11 -08001489/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001490 * Logs when something is plugged into or removed from the USB-C connector.
1491 *
1492 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001493 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001494 */
1495message UsbConnectorStateChanged {
1496 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001497 STATE_DISCONNECTED = 0;
1498 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001499 }
1500 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001501 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001502 // Last active session in ms.
1503 // 0 when the port is in connected state.
1504 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001505}
1506
1507/**
1508 * Logs the reported speaker impedance.
1509 *
1510 * Logged from:
1511 * Vendor audio implementation.
1512 */
1513message SpeakerImpedanceReported {
1514 optional int32 speaker_location = 1;
1515 optional int32 impedance = 2;
1516}
1517
1518/**
1519 * Logs the report of a failed hardware.
1520 *
1521 * Logged from:
1522 * Vendor HALs.
1523 *
1524 */
1525message HardwareFailed {
1526 enum HardwareType {
1527 HARDWARE_FAILED_UNKNOWN = 0;
1528 HARDWARE_FAILED_MICROPHONE = 1;
1529 HARDWARE_FAILED_CODEC = 2;
1530 HARDWARE_FAILED_SPEAKER = 3;
1531 HARDWARE_FAILED_FINGERPRINT = 4;
1532 }
1533 optional HardwareType hardware_type = 1;
1534
1535 /* hardware_location allows vendors to differentiate between multiple instances of
1536 * the same hardware_type. The specific locations are vendor defined integers,
1537 * referring to board-specific numbering schemes.
1538 */
1539 optional int32 hardware_location = 2;
1540
1541 /* failure_code is specific to the HardwareType of the failed hardware.
1542 * It should use the enum values defined below.
1543 */
1544 enum MicrophoneFailureCode {
1545 MICROPHONE_FAILURE_COMPLETE = 0;
1546 }
1547 enum CodecFailureCode {
1548 CODEC_FAILURE_COMPLETE = 0;
1549 }
1550 enum SpeakerFailureCode {
1551 SPEAKER_FAILURE_COMPLETE = 0;
1552 SPEAKER_FAILURE_HIGH_Z = 1;
1553 SPEAKER_FAILURE_SHORT = 2;
1554 }
1555 enum FingerprintFailureCode {
1556 FINGERPRINT_FAILURE_COMPLETE = 0;
1557 FINGERPRINT_SENSOR_BROKEN = 1;
1558 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1559 }
1560 optional int32 failure_code = 3;
1561}
1562
1563/**
1564 * Log an event when the device has been physically dropped.
1565 * Reported from the /vendor partition.
1566 */
1567message PhysicalDropDetected {
1568 // Confidence that the event was actually a drop, 0 -> 100
1569 optional int32 confidence_pctg = 1;
1570 // Peak acceleration of the drop, in 1/1000s of a g.
1571 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001572 // Duration of freefall in ms
1573 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001574}
1575
1576/**
1577 * Log bucketed battery charge cycles.
1578 *
1579 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001580 * a given charge point. For example, if 10 cycle buckets are
1581 * initialized, bucket 1 is the lowest 1/10th of the battery,
1582 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001583 *
1584 * Logged from:
1585 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1586 */
1587message ChargeCyclesReported {
1588 optional int32 cycle_bucket_1 = 1;
1589 optional int32 cycle_bucket_2 = 2;
1590 optional int32 cycle_bucket_3 = 3;
1591 optional int32 cycle_bucket_4 = 4;
1592 optional int32 cycle_bucket_5 = 5;
1593 optional int32 cycle_bucket_6 = 6;
1594 optional int32 cycle_bucket_7 = 7;
1595 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001596 optional int32 cycle_bucket_9 = 9;
1597 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001598}
1599
1600/**
Howard Roa46b6582018-09-18 16:45:02 -07001601 * Log battery health snapshot.
1602 *
1603 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1604 * are snapshotted periodically over 24hrs.
1605 */
1606message BatteryHealthSnapshot {
1607 enum BatterySnapshotType {
1608 UNKNOWN = 0;
1609 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1610 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1611 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1612 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1613 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1614 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1615 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1616 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1617 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1618 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1619 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1620 }
1621 optional BatterySnapshotType type = 1;
1622 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001623 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001624 // Voltage Battery Voltage, in microVolts.
1625 optional int32 voltage_micro_volt = 3;
1626 // Current Battery current, in microAmps.
1627 optional int32 current_micro_amps = 4;
1628 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1629 optional int32 open_circuit_micro_volt = 5;
1630 // Resistance Battery Resistance, in microOhms.
1631 optional int32 resistance_micro_ohm = 6;
1632 // Level Battery Level, as % of full.
1633 optional int32 level_percent = 7;
1634}
1635
1636/**
1637 * Log slow I/O operations on the primary storage.
1638 */
1639message SlowIo {
1640 // Classifications of IO Operations.
1641 enum IoOperation {
1642 UNKNOWN = 0;
1643 READ = 1;
1644 WRITE = 2;
1645 UNMAP = 3;
1646 SYNC = 4;
1647 }
1648 optional IoOperation operation = 1;
1649
1650 // The number of slow IO operations of this type over 24 hours.
1651 optional int32 count = 2;
1652}
1653
1654/**
1655 * Log battery caused shutdown with the last recorded voltage.
1656 */
1657message BatteryCausedShutdown {
1658 // The last recorded battery voltage prior to shutdown.
1659 optional int32 last_recorded_micro_volt = 1;
1660}
1661
1662/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001663 * Logs the duration of a davey (jank of >=700ms) when it occurs
1664 *
1665 * Logged from:
1666 * frameworks/base/libs/hwui/JankTracker.cpp
1667 */
1668message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001669 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001670 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001671
Tej Singhbb8554a2018-01-26 11:59:14 -08001672 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001673 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001674}
1675
1676/**
Bookatze5885242017-10-24 20:10:31 -07001677 * Logs phone signal strength changes.
1678 *
1679 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001680 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001681 */
1682message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001683 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1684 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001685}
1686
Yangster4ccebea2018-10-09 17:09:02 -07001687
1688/**
1689 * Logs when the phone state, sim state or signal strength changes
1690 *
1691 * Logged from:
1692 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1693 */
1694message PhoneServiceStateChanged {
1695 optional android.telephony.ServiceStateEnum state = 1;
1696 optional android.telephony.SimStateEnum sim_state = 2;
1697 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1698}
1699
1700/**
1701 * Logs when the phone becomes on or off.
1702 *
1703 * Logged from:
1704 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1705 */
1706message PhoneStateChanged {
1707 enum State {
1708 OFF = 0;
1709 ON = 1;
1710 }
1711 optional State state = 1;
1712}
1713
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001714message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001715 optional android.stats.launcher.LauncherAction action = 1;
1716 optional android.stats.launcher.LauncherState src_state = 2;
1717 optional android.stats.launcher.LauncherState dst_state = 3;
1718 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001719 optional bool is_swipe_up_enabled = 5;
1720}
1721
David Chenc28b2bb2017-10-24 12:52:52 -07001722/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001723 * Logs when Settings UI has changed.
1724 *
1725 * Logged from:
1726 * packages/apps/Settings
1727 */
1728message SettingsUIChanged {
1729 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001730 * Where this SettingsUIChange event comes from. For example, if
1731 * it's a PAGE_VISIBLE event, where the page is opened from.
1732 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001733 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001734
1735 /**
1736 * What the UI action is.
1737 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001738 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001739
1740 /**
1741 * Where the action is happening
1742 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001743 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001744
1745 /**
1746 * What preference changed in this event.
1747 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001748 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001749
1750 /**
1751 * The new value of the changed preference.
1752 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001753 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001754}
1755
1756/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08001757 * Logs basic timing information about touch events.
1758 * Reported at most every 5 minutes while device is being interacted with.
1759 *
1760 * Logged from:
1761 * frameworks/native/services/inputflinger
1762 */
1763message TouchEventReported {
1764 /**
1765 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
1766 * and the standard deviation of latency between the kernel and framework
1767 * for touchscreen events. The units are microseconds.
1768 *
1769 * The number is measured as the difference between the time at which
1770 * the input event was received in the evdev driver,
1771 * and the time at which the input event was received in EventHub.
1772 */
1773 // Minimum value
1774 optional float latency_min_micros = 1;
1775 // Maximum value
1776 optional float latency_max_micros = 2;
1777 // Average value
1778 optional float latency_mean_micros = 3;
1779 // Standard deviation
1780 optional float latency_stdev_micros = 4;
1781}
1782
1783/**
David Chenc28b2bb2017-10-24 12:52:52 -07001784 * Logs that a setting was updated.
1785 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001786 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001787 * The tag and is_default allow resetting of settings to default values based on the specified
1788 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1789 */
1790message SettingChanged {
1791 // The name of the setting.
1792 optional string setting = 1;
1793
1794 // The change being imposed on this setting. May represent a number, eg "3".
1795 optional string value = 2;
1796
1797 // The new value of this setting. For most settings, this is same as value. For some settings,
1798 // value is +X or -X where X represents an element in a set. For example, if the previous value
1799 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1800 // The +/- feature is currently only used for location_providers_allowed.
1801 optional string new_value = 3;
1802
1803 // The previous value of this setting.
1804 optional string prev_value = 4;
1805
1806 // The tag used with the is_default for resetting sets of settings. This is generally null.
1807 optional string tag = 5;
1808
Bookatz90867622018-01-31 15:05:57 -08001809 // True if this setting with tag should be resettable.
1810 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001811
David Chenbd789912018-03-16 17:19:55 -07001812 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001813 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001814
1815 enum ChangeReason {
1816 UPDATED = 1; // Updated can be an insertion or an update.
1817 DELETED = 2;
1818 }
1819 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001820}
Chenjie Yub3dda412017-10-24 13:41:59 -07001821
Chenjie Yu05013b32017-11-21 10:21:41 -08001822/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001823 * Logs activity going to foreground or background
1824 *
1825 * Logged from:
1826 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1827 */
1828message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001829 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001830 optional string pkg_name = 2;
1831 optional string class_name = 3;
1832
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001833 enum State {
1834 BACKGROUND = 0;
1835 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001836 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001837 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001838}
David Chenc8a43242017-10-17 16:23:28 -07001839
1840/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00001841 * Logs when a volume entered low Storage state.
1842 * Logged from:
1843 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
1844 */
1845message LowStorageStateChanged {
1846 // Volume that ran out of storage.
1847 optional string volume_description = 1;
1848
1849 enum State {
1850 UNKNOWN = 0;
1851 OFF = 1;
1852 ON = 2;
1853 }
1854 optional State state = 2;
1855}
1856
1857/**
1858 * Logs when an app is downgraded.
1859 * Logged from:
1860 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1861 */
1862message AppDowngraded {
1863 optional string package_name = 1;
1864 // Size of the package (all data) before being downgraded.
1865 optional int64 size_in_bytes_before = 2;
1866 // Size of the package (all data) after being downgraded.
1867 optional int64 size_in_bytes_after = 3;
1868
1869 optional bool aggressive = 4;
1870}
1871
1872/**
1873 * Logs when an app is optimized after being downgraded.
1874 * Logged from:
1875 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1876 */
1877message AppOptimizedAfterDowngraded {
1878 optional string package_name = 1;
1879}
1880
1881/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001882 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001883 * Logged from:
1884 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1885 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001886message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001887 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001888
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001889 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001890
1891 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001892 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001893 optional string process_name = 3;
1894
1895 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001896 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001897
1898 optional string package_name = 5;
1899
1900 enum InstantApp {
1901 UNAVAILABLE = 0;
1902 FALSE = 1;
1903 TRUE = 2;
1904 }
1905 optional InstantApp is_instant_app = 6;
1906
1907 enum ForegroundState {
1908 UNKNOWN = 0;
1909 BACKGROUND = 1;
1910 FOREGROUND = 2;
1911 }
1912 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001913
1914 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001915}
David Chen9e3808c2017-11-20 17:25:34 -08001916
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001917/**
1918 * Logs when a WTF (What a Terrible Failure) happened.
1919 * Logged from:
1920 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1921 */
1922message WTFOccurred {
1923 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001924
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001925 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001926
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001927 // The name of the process.
1928 // system_server if it is not by an app
1929 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001930
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001931 // The pid if available. -1 means not available.
1932 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001933
1934 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001935}
1936
1937/**
1938 * Logs when system server reports low memory.
1939 * Logged from:
1940 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1941 */
1942message LowMemReported {
1943}
1944
1945/**
1946 * Logs when an app ANR (App Not Responding) occurs.
1947 * Logged from:
1948 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1949 */
1950message ANROccurred {
1951 optional int32 uid = 1 [(is_uid) = true];
1952
1953 optional string process_name = 2;
1954
1955 optional string short_component_name = 3;
1956
1957 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001958
1959 enum InstantApp {
1960 UNAVAILABLE = 0;
1961 FALSE = 1;
1962 TRUE = 2;
1963 }
1964 optional InstantApp is_instant_app = 5;
1965
1966 enum ForegroundState {
1967 UNKNOWN = 0;
1968 BACKGROUND = 1;
1969 FOREGROUND = 2;
1970 }
1971 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001972
1973 optional android.server.ErrorSource error_source = 7;
1974
1975 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001976}
1977
Bookatza7020bd2018-08-28 16:29:35 -07001978/**
1979 * Logs when the vibrator state changes.
1980 * Logged from:
1981 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1982 */
1983message VibratorStateChanged {
1984 repeated AttributionNode attribution_node = 1;
1985
1986 enum State {
1987 OFF = 0;
1988 ON = 1;
1989 }
1990 optional State state = 2;
1991
1992 // Duration (in milliseconds) requested to keep the vibrator on.
1993 // Only applicable for State == ON.
1994 optional int64 duration_millis = 3;
1995}
1996
David Chen0a368b22017-12-06 16:28:16 -08001997/*
1998 * Allows other apps to push events into statsd.
1999 * Logged from:
2000 * frameworks/base/core/java/android/util/StatsLog.java
2001 */
David Chen0b5c90c2018-01-25 16:51:49 -08002002message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002003 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002004 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002005
2006 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2007 optional int32 label = 2;
2008
2009 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2010 // predicates for the metrics).
2011 enum State {
2012 UNKNOWN = 0;
2013 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2014 STOP = 2;
2015 START = 3;
2016 }
2017 optional State state = 3;
2018}
2019
David Chen9e3808c2017-11-20 17:25:34 -08002020/**
Bookatz7948c872018-09-04 12:58:33 -07002021 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2022 * For example, this could be due to the user manually changing the time.
2023 *
2024 * Logged from:
2025 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2026 */
2027message WallClockTimeShifted {
2028 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2029 optional int64 wall_clock_timestamp_millis = 1;
2030}
2031
2032/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002033 * Logs when statsd detects an anomaly.
2034 *
2035 * Logged from:
2036 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2037 */
2038message AnomalyDetected {
2039 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002040 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002041
Yangster-mac94e197c2018-01-02 16:03:03 -08002042 // Id of the config whose anomaly detection alert fired.
2043 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002044
Yangster-mac94e197c2018-01-02 16:03:03 -08002045 // Id of the alert (i.e. name of the anomaly that was detected).
2046 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002047}
2048
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002049message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002050 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002051 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002052
2053 // The app package name.
2054 optional string pkg_name = 2;
2055
2056 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002057 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002058 WARM = 1;
2059 HOT = 2;
2060 COLD = 3;
2061 }
2062 // The transition type.
2063 optional TransitionType type = 3;
2064
2065 // The activity name.
2066 optional string activity_name = 4;
2067
2068 // The name of the calling app. Empty if not set.
2069 optional string calling_pkg_name = 5;
2070
2071 // Whether the app is an instant app.
2072 optional bool is_instant_app = 6;
2073
2074 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002075 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002076
Bookatz80d11a02018-01-16 10:46:35 -08002077 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002078
David Chen0b5c90c2018-01-25 16:51:49 -08002079 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002080 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002081 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002082 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002083 optional int32 bind_application_delay_millis = 11;
2084 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002085
2086 // Empty if not set.
2087 optional string launch_token = 13;
2088
Calin Juravle759fbda2018-02-20 19:52:30 +00002089 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002090 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002091
2092 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002093 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002094}
2095
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002096message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002097 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002098 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002099
2100 // The app package name.
2101 optional string pkg_name = 2;
2102
2103 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002104 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002105 WARM = 1;
2106 HOT = 2;
2107 COLD = 3;
2108 }
2109 // The transition type.
2110 optional TransitionType type = 3;
2111
2112 // The activity name.
2113 optional string activity_name = 4;
2114}
2115
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002116message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002117 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002118 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002119
2120 // The app package name.
2121 optional string pkg_name = 2;
2122
2123 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002124 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002125 WITH_BUNDLE = 1;
2126 WITHOUT_BUNDLE = 2;
2127 }
2128 // The transition type.
2129 optional TransitionType type = 3;
2130
2131 // The activity name.
2132 optional string activity_name = 4;
2133
2134 optional bool transition_process_running = 5;
2135
2136 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002137 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002138}
2139
Bookatz8fcd09a2017-12-18 13:01:10 -08002140/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002141 * Logs a picture-in-picture action
2142 * Logged from:
2143 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2144 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2145 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2146 */
2147message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002148 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002149 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002150
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002151 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002152
Chenjie Yu52cacc62017-12-08 18:11:45 -08002153 enum State {
2154 ENTERED = 1;
2155 EXPANDED_TO_FULL_SCREEN = 2;
2156 MINIMIZED = 3;
2157 DISMISSED = 4;
2158 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002159 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002160}
2161
2162/**
Chenjie Yue8904192017-12-08 19:12:57 -08002163 * Logs overlay action
2164 * Logged from:
2165 * services/core/java/com/android/server/wm/Session.java
2166 */
2167message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002168 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002169
2170 optional string package_name = 2;
2171
2172 optional bool using_alert_window = 3;
2173
2174 enum State {
2175 ENTERED = 1;
2176 EXITED = 2;
2177 }
2178 optional State state = 4;
2179}
2180
Chenjie Yuccfe6452018-01-30 11:33:21 -08002181/*
2182 * Logs foreground service starts and stops.
2183 * Note that this is not when a service starts or stops, but when it is
2184 * considered foreground.
2185 * Logged from
2186 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2187 */
2188message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002189 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002190 // package_name + "/" + class_name
2191 optional string short_name = 2;
2192
2193 enum State {
2194 ENTER = 1;
2195 EXIT = 2;
2196 }
2197 optional State state = 3;
2198}
2199
Chenjie Yue8904192017-12-08 19:12:57 -08002200/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002201 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2202 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2203 * attributed back to the parent (host) uid. One example is Chrome.
2204 *
2205 * Logged from:
2206 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2207 */
2208message IsolatedUidChanged {
2209 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002210 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002211 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002212 optional int32 parent_uid = 1;
2213
2214 optional int32 isolated_uid = 2;
2215
2216 // We expect an isolated uid to be removed before if it's used for another parent uid.
2217 enum Event {
2218 REMOVED = 0;
2219 CREATED = 1;
2220 }
2221 optional Event event = 3;
2222}
2223
2224/*
2225 * Logs the reception of an incoming network packet causing the main system to wake up for
2226 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2227 * and processed by WakeupController.cpp.
2228 */
2229message PacketWakeupOccurred {
2230 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2231 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002232 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002233 // The interface name on which the packet was received.
2234 optional string iface = 2;
2235 // The ethertype value of the packet.
2236 optional int32 ethertype = 3;
2237 // String representation of the destination MAC address of the packet.
2238 optional string destination_hardware_address = 4;
2239 // String representation of the source address of the packet if this was an IP packet.
2240 optional string source_ip = 5;
2241 // String representation of the destination address of the packet if this was an IP packet.
2242 optional string destination_ip = 6;
2243 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2244 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2245 // families.
2246 optional int32 ip_next_header = 7;
2247 // The source port if this was a TCP or UDP packet.
2248 optional int32 source_port = 8;
2249 // The destination port if this was a TCP or UDP packet.
2250 optional int32 destination_port = 9;
2251}
2252
2253/*
2254 * Logs the memory stats for an app on startup.
2255 * Logged from:
2256 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2257 */
2258message AppStartMemoryStateCaptured {
2259 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002260 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002261
2262 // The process name.
2263 optional string process_name = 2;
2264
2265 // The activity name.
2266 optional string activity_name = 3;
2267
2268 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002269 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002270
2271 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002272 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002273
2274 // RSS
2275 optional int64 rss_in_bytes = 6;
2276
2277 // CACHE
2278 optional int64 cache_in_bytes = 7;
2279
2280 // SWAP
2281 optional int64 swap_in_bytes = 8;
2282}
2283
2284/*
2285 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2286 * for LMK event.
2287 * Logged from:
2288 * system/core/lmkd/lmkd.c
2289 */
2290message LmkStateChanged {
2291 enum State {
2292 UNKNOWN = 0;
2293 START = 1;
2294 STOP = 2;
2295 }
2296 optional State state = 1;
2297}
2298
2299/*
2300 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2301 * Logged from:
2302 * system/core/lmkd/lmkd.c
2303 */
2304message LmkKillOccurred {
2305 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002306 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002307
2308 // The process name.
2309 optional string process_name = 2;
2310
2311 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002312 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002313
2314 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002315 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002316
2317 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002318 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002319
2320 // RSS
2321 optional int64 rss_in_bytes = 6;
2322
2323 // CACHE
2324 optional int64 cache_in_bytes = 7;
2325
2326 // SWAP
2327 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002328
2329 // The elapsed real time of start of the process.
2330 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002331}
2332
Rajeev Kumar51b54602018-03-01 12:18:26 -08002333/*
2334 * Logs when the ActivityManagerService detects that an app died.
2335 *
2336 * Logged from:
2337 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2338 */
2339message AppDied {
2340 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002341 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002342}
2343
Howard Ro21a039c2018-08-06 14:55:47 -07002344/**
2345 * An atom for generic metrics logging. Available from Android Q.
2346 */
2347message GenericAtom {
2348 // The uid of the application that sent this custom atom.
2349 optional int32 uid = 1 [(is_uid) = true];
2350
2351 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002352 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002353}
2354
Tej Singhd6d6d772018-09-05 17:41:25 -07002355/**
2356 * Logs when a fingerprint acquire event occurs.
2357 *
2358 * Logged from:
2359 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2360 */
2361message FingerprintAcquired {
2362 // The associated user. Eg: 0 for owners, 10+ for others.
2363 // Defined in android/os/UserHandle.java
2364 optional int32 user = 1;
2365 // If this acquire is for a crypto fingerprint.
2366 // e.g. Secure purchases, unlock password storage.
2367 optional bool is_crypto = 2;
2368}
2369
2370/**
2371 * Logs when a fingerprint authentication event occurs.
2372 *
2373 * Logged from:
2374 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2375 */
2376message FingerprintAuthenticated {
2377 // The associated user. Eg: 0 for owners, 10+ for others.
2378 // Defined in android/os/UserHandle.java
2379 optional int32 user = 1;
2380 // If this authentication is for a crypto fingerprint.
2381 // e.g. Secure purchases, unlock password storage.
2382 optional bool is_crypto = 2;
2383 // Whether or not this authentication was successful.
2384 optional bool is_authenticated = 3;
2385}
2386
2387/**
2388 * Logs when a fingerprint error occurs.
2389 *
2390 * Logged from:
2391 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2392 */
2393message FingerprintErrorOccurred {
2394 // The associated user. Eg: 0 for owners, 10+ for others.
2395 // Defined in android/os/UserHandle.java
2396 optional int32 user = 1;
2397 // If this error is for a crypto fingerprint.
2398 // e.g. Secure purchases, unlock password storage.
2399 optional bool is_crypto = 2;
2400
2401 enum Error {
2402 UNKNOWN = 0;
2403 LOCKOUT = 1;
2404 PERMANENT_LOCKOUT = 2;
2405 }
2406 // The type of error.
2407 optional Error error = 3;
2408}
Howard Ro688ae182018-09-25 00:09:36 -07002409
2410message Notification {
2411
2412 // Type of notification event.
2413 enum Type {
2414 TYPE_UNKNOWN = 0;
2415 // Notification became visible to the user.
2416 TYPE_OPEN = 1;
2417 // Notification became hidden.
2418 TYPE_CLOSE = 2;
2419 // Notification switched to detail mode.
2420 TYPE_DETAIL = 3;
2421 // Notification was clicked.
2422 TYPE_ACTION = 4;
2423 // Notification was dismissed.
2424 TYPE_DISMISS = 5;
2425 // Notification switched to summary mode. The enum value of 14 is to
2426 // match that of metrics_constants.
2427 TYPE_COLLAPSE = 14;
2428 }
2429 optional Type type = 1;
2430
2431 // Package name associated with the notification.
2432 optional string package_name = 2;
2433
2434 // Tag associated with notification.
2435 optional string tag = 3;
2436
2437 // Application-supplied ID associated with the notification.
2438 optional int32 id = 4;
2439
2440 // Index of notification in the notification panel.
2441 optional int32 shade_index = 5;
2442
2443 // The number of notifications in the notification panel.
2444 optional int32 shade_count = 6;
2445
2446 // Importance for the notification.
2447 optional int32 importance = 7;
2448
2449 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002450 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002451
2452 // Importance for the notification channel.
2453 optional int32 channel_importance = 9;
2454
Howard Ro183c2bd2018-10-18 13:52:10 -07002455 // Application-supplied ID associated with the notifications group.
2456 optional string group_id = 10;
2457
Howard Ro688ae182018-09-25 00:09:36 -07002458 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002459 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002460
Howard Ro183c2bd2018-10-18 13:52:10 -07002461 // Reason for dismissal of a notification. This field is only meaningful for
2462 // TYPE_DISMISS events.
2463 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002464
Howard Ro183c2bd2018-10-18 13:52:10 -07002465 // The first post time of notification, stable across updates.
2466 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002467
Howard Ro183c2bd2018-10-18 13:52:10 -07002468 // The most recent interruption time, or the creation time if no updates.
2469 // Differs from update_millis because updates are filtered based on whether
2470 // they actually interrupted the user.
2471 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002472
Howard Ro183c2bd2018-10-18 13:52:10 -07002473 // The most recent update time, or the creation time if no updates.
2474 optional int64 update_millis = 15;
2475
2476 // The most recent visibility event.
2477 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002478}
2479
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002480/*
Yangster-macb89807e2018-11-15 21:10:57 -08002481 * Logs when a flag flip state changes.
2482 * Logged in P/h.
2483 */
2484message PhenotypeFlagStateChanged {
2485 // Mendel configuration name.
2486 optional string mendel_config_name = 1;
2487 // State
2488 enum State {
2489 STATE_UNKNOWN = 0;
2490 COMMITTED = 1;
2491 }
2492 optional State state = 2;
2493}
2494
2495/*
2496 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08002497 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08002498 */
2499message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08002500 // Name of the train.
2501 optional string train_name = 1;
2502 // Version code for a "train" of packages that need to be installed atomically
2503 optional int64 train_version_code = 2;
2504 // After installation of this package, device requires a restart.
2505 optional bool requires_staging = 3;
2506 // Rollback should be enabled for this install.
2507 optional bool rollback_enabled = 4;
2508 // Requires low latency monitoring if possible.
2509 optional bool requires_low_latency_monitor = 5;
2510
Yangster-macb89807e2018-11-15 21:10:57 -08002511 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08002512 UNKNOWN = 0;
2513 INSTALL_REQUESTED = 1;
2514 INSTALL_STARTED = 2;
2515 INSTALL_STAGED_NOT_READY = 3;
2516 INSTALL_STAGED_READY = 4;
2517 INSTALL_SUCCESS = 5;
2518 INSTALL_FAILURE = 6;
2519 INSTALL_CANCELLED = 7;
2520 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08002521 }
Chenjie Yu8366c712019-01-16 20:48:30 -08002522 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08002523}
2524
Maggie Whitefc1aa592018-11-28 21:55:23 -08002525/** Represents USB port overheat event. */
2526message UsbPortOverheatEvent {
2527 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
2528 optional int32 plug_temperature_deci_c = 1;
2529
2530 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
2531 optional int32 max_temperature_deci_c = 2;
2532
2533 /* Time between USB plug event and overheat threshold trip, in seconds. */
2534 optional int32 time_to_overheat_secs = 3;
2535
2536 /* Time between overheat threshold trip and hysteresis, in seconds. */
2537 optional int32 time_to_hysteresis_secs = 4;
2538
2539 /* Time between hysteresis and active mitigation ending, in seconds. */
2540 optional int32 time_to_inactive_secs = 5;
2541};
2542
Maggie White8735b852019-01-18 11:40:49 -08002543/**
2544 * Logs total effective full charge and discharge cycles on a battery.
2545 * Here are some examples of one effective cycle:
2546 * 1) the battery charges from 0% to 100% and drains back to 0%,
2547 * 2) charging from 50% to 100% and draining back to 50% twice.
2548 * Pulled from:
2549 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2550 */
2551message BatteryCycleCount {
2552 /* Number of total charge and discharge cycles on the system battery. */
2553 optional int32 cycle_count = 1;
2554}
2555
Yangster-macb89807e2018-11-15 21:10:57 -08002556/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002557 * Logs when a connection becomes available and lost.
2558 * Logged in StatsCompanionService.java
2559 */
2560message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002561 // Id of the network.
2562 optional int32 net_id = 1;
2563
2564 enum State {
2565 UNKNOWN = 0;
2566 CONNECTED = 1;
2567 DISCONNECTED = 2;
2568 }
2569 // Connected state of a network.
2570 optional State state = 2;
2571}
2572
2573/**
2574 * Logs when a service starts and stops.
2575 * Logged from:
2576 * services/core/java/com/android/server/am/ActiveServices.java
2577 */
2578message ServiceStateChanged {
2579
2580 optional int32 uid = 1 [(is_uid) = true];
2581
2582 optional string package_name = 2;
2583
2584 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002585
2586 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002587 START = 1;
2588 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002589 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002590
2591 optional State state = 4;
2592}
2593
2594/**
2595 * Logs when a service is launched.
2596 * Logged from:
2597 * services/core/java/com/android/server/am/ActiveServices.java
2598 */
2599message ServiceLaunchReported {
2600
2601 optional int32 uid = 1 [(is_uid) = true];
2602
2603 optional string package_name = 2;
2604
2605 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002606}
Howard Ro688ae182018-09-25 00:09:36 -07002607
Chenjie Yubbcbc602018-02-05 16:51:52 -08002608//////////////////////////////////////////////////////////////////////
2609// Pulled atoms below this line //
2610//////////////////////////////////////////////////////////////////////
2611
2612/**
David Chenc8a43242017-10-17 16:23:28 -07002613 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2614 *
2615 * Pulled from:
2616 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2617 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002618message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002619 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002620
2621 optional int64 rx_bytes = 2;
2622
2623 optional int64 rx_packets = 3;
2624
2625 optional int64 tx_bytes = 4;
2626
2627 optional int64 tx_packets = 5;
2628}
2629
2630/**
2631 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2632 *
2633 * Pulled from:
2634 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2635 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002636message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002637 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002638
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002639 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2640 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002641
2642 optional int64 rx_bytes = 3;
2643
2644 optional int64 rx_packets = 4;
2645
2646 optional int64 tx_bytes = 5;
2647
2648 optional int64 tx_packets = 6;
2649}
2650
2651/**
2652 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2653 *
2654 * Pulled from:
2655 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2656 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002657message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002658 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002659
2660 optional int64 rx_bytes = 2;
2661
2662 optional int64 rx_packets = 3;
2663
2664 optional int64 tx_bytes = 4;
2665
2666 optional int64 tx_packets = 5;
2667}
2668
2669/**
2670 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2671 *
2672 * Pulled from:
2673 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2674 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002675message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002676 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002677
Yao Chenc40a19d2018-03-15 16:48:25 -07002678 // 1 denotes foreground and 0 denotes background. This is called Set in
2679 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002680 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002681
2682 optional int64 rx_bytes = 3;
2683
2684 optional int64 rx_packets = 4;
2685
2686 optional int64 tx_bytes = 5;
2687
2688 optional int64 tx_packets = 6;
2689}
2690
2691/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002692 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2693 *
2694 * Pulled from:
2695 * StatsCompanionService
2696 */
2697message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002698 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002699
2700 optional int64 rx_bytes = 2;
2701
2702 optional int64 tx_bytes = 3;
2703}
2704
2705/**
David Chenc8a43242017-10-17 16:23:28 -07002706 * Pulls the kernel wakelock durations. This atom is adapted from
2707 * android/internal/os/KernelWakelockStats.java
2708 *
2709 * Pulled from:
2710 * StatsCompanionService using KernelWakelockReader.
2711 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002712message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002713 optional string name = 1;
2714
2715 optional int32 count = 2;
2716
2717 optional int32 version = 3;
2718
Yangster-maca8a30442018-10-13 23:46:34 -07002719 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002720}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002721
Chenjie Yu05013b32017-11-21 10:21:41 -08002722/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002723 * Pulls low power state information. If power.stats HAL is not available, this
2724 * includes platform and subsystem sleep state information,
2725 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2726 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002727 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002728 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002729 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2730 * as defined in:
2731 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002732 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002733message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002734 // Subsystem name
2735 optional string subsystem_name = 1;
2736 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2737 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002738 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2739 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002740 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002741 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002742 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002743 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002744 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002745}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002746
Chenjie Yu05013b32017-11-21 10:21:41 -08002747/**
Bookatz92da2832018-11-01 18:10:03 -07002748 * Pulls on-device power measurement information.
2749 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2750 * Pulled from:
2751 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2752 */
2753message OnDevicePowerMeasurement {
2754 // Name of the subsystem (to which the rail belongs).
2755 optional string subsystem_name = 1;
2756
2757 // Rail name. The rail lies within the subsystem.
2758 optional string rail_name = 2;
2759
2760 // Time (in ms since boot) at which the rail energy value was measured.
2761 // This may differ slightly from the time that statsd logs this information.
2762 optional uint64 measurement_timestamp_millis = 3;
2763
2764 // Accumulated energy used via the rail since device boot in uWs.
2765 optional uint64 energy_microwatt_secs = 4;
2766}
2767
2768/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002769 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002770 * Pulls the time the cpu spend on the frequency index. Frequency index
2771 * starts from highest to lowest. The value should be monotonically
2772 * increasing since boot. However, if there is a cpu
2773 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002774 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002775message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002776 optional uint32 cluster = 1;
2777 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002778 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002779}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002780
Chenjie Yu05013b32017-11-21 10:21:41 -08002781/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002782 * Pulls Cpu Time Per Uid.
2783 * Note that isolated process uid time should be attributed to host uids.
2784 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002785message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002786 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002787 optional uint64 user_time_micros = 2;
2788 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002789}
2790
2791/**
2792 * Pulls Cpu Time Per Uid per frequency.
2793 * Note that isolated process uid time should be attributed to host uids.
2794 * For each uid, we order the time by descending frequencies.
2795 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002796message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002797 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002798 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002799 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002800}
Hugo Benichi884970e2017-11-14 22:42:46 +09002801
Chenjie Yu05013b32017-11-21 10:21:41 -08002802/**
2803 * Pulls Wifi Controller Activity Energy Info
2804 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002805message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002806 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002807 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002808 // stack reported state
2809 // TODO: replace this with proto enum
2810 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002811 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002812 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002813 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002814 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002815 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002816 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002817 // product of current(mA), voltage(V) and time(ms)
2818 optional uint64 controller_energy_used = 6;
2819}
2820
2821/**
2822 * Pulls Modem Activity Energy Info
2823 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002824message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002825 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002826 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002827 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002828 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002829 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002830 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002831 /**
2832 * Tx power index
2833 * index 0 = tx_power < 0dBm
2834 * index 1 = 0dBm < tx_power < 5dBm
2835 * index 2 = 5dBm < tx_power < 15dBm
2836 * index 3 = 15dBm < tx_power < 20dBm
2837 * index 4 = tx_power > 20dBm
2838 */
2839 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002840 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002841 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002842 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002843 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002844 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002845 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002846 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002847 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002848 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002849 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002850 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002851 // product of current(mA), voltage(V) and time(ms)
2852 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002853}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002854
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002855/**
2856 * Pulls Bluetooth Activity Energy Info
2857 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2858 */
2859message BluetoothActivityInfo {
2860 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002861 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002862 // bluetooth stack state
2863 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002864 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002865 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002866 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002867 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002868 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002869 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002870 // product of current(mA), voltage(V) and time(ms)
2871 optional uint64 energy_used = 6;
2872}
2873
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002874/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002875 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002876 *
2877 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002878 */
2879message ProcessMemoryState {
2880 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002881 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002882
2883 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002884 // Usually package name, "system" for system server.
2885 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002886 optional string process_name = 2;
2887
Rafal Slawikda51b932018-12-13 16:31:33 +00002888 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002889 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002890
2891 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002892 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002893
2894 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002895 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002896
Rajeev Kumar90235992018-01-29 11:06:48 -08002897 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002898 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2899 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002900 optional int64 rss_in_bytes = 6;
2901
2902 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002903 // Value is read from memory.stat, field total_cache if per-app memory
2904 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002905 optional int64 cache_in_bytes = 7;
2906
2907 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002908 // Value is read from memory.stat, field total_swap if per-app memory
2909 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002910 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002911
Rafal Slawikd03ae422018-11-20 11:27:45 +00002912 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002913 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002914
2915 // Elapsed real time when the process started.
2916 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2917 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002918}
2919
2920/*
Rafal Slawik08621582018-10-15 14:53:07 +01002921 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002922 *
2923 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002924 */
2925message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002926 // The uid if available. -1 means not available.
2927 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002928
Rafal Slawikbf67d072018-10-23 11:07:54 +01002929 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002930 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002931 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002932
Rafal Slawikbf67d072018-10-23 11:07:54 +01002933 // # of page-faults
2934 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002935
Rafal Slawikbf67d072018-10-23 11:07:54 +01002936 // # of major page-faults
2937 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002938
Rafal Slawikbf67d072018-10-23 11:07:54 +01002939 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002940 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002941 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002942
Rafal Slawikd03ae422018-11-20 11:27:45 +00002943 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002944 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002945
2946 // Elapsed real time when the process started.
2947 // Value is read from /proc/PID/stat, field 22.
2948 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002949}
2950
2951/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002952 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002953 *
2954 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
2955 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00002956 *
2957 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002958 */
2959message ProcessMemoryHighWaterMark {
2960 // The uid if available. -1 means not available.
2961 optional int32 uid = 1 [(is_uid) = true];
2962
Rafal Slawikda51b932018-12-13 16:31:33 +00002963 // The process name.
2964 // Usually package name or process cmdline.
2965 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002966 optional string process_name = 2;
2967
2968 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2969 // /proc/PID/status.
2970 optional int64 rss_high_water_mark_in_bytes = 3;
2971}
2972
2973/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002974 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002975 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002976message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002977 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002978}
2979
2980/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002981 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002982 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002983message SystemUptime {
2984 // Milliseconds since the system was booted.
2985 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2986 // for external input).
2987 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002988 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002989}
2990
2991/*
2992 * Reads from /proc/uid_concurrent_active_time which has the format:
2993 * active: X (X is # cores)
2994 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2995 * [uid1]: [time-0] [time-1] [time-2] ... ...
2996 * ...
2997 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2998 * The file contains a monotonically increasing count of time for a single boot.
2999 */
3000message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003001 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003002 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003003}
3004
3005/**
3006 * Reads from /proc/uid_concurrent_policy_time which has the format:
3007 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3008 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3009 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3010 * ...
3011 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3012 * The file contains a monotonically increasing count of time for a single boot.
3013 */
3014message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003015 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003016 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003017 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003018}
3019
3020/*
3021 * Pulls free disk space, for data, system partition and temporary directory.
3022 */
3023message DiskSpace {
3024 // available bytes in data partition
3025 optional uint64 data_available_bytes = 1;
3026 // available bytes in system partition
3027 optional uint64 system_available_bytes = 2;
3028 // available bytes in download cache or temp directories
3029 optional uint64 temp_available_bytes = 3;
3030}
Tej Singhbf972d92018-01-10 20:51:13 -08003031
3032/**
3033 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003034 *
3035 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003036 */
3037message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003038 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003039}
3040
3041/**
3042 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003043 * Pulled from:
3044 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003045 */
3046message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003047 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003048}
3049
3050/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003051 * Pulls battery voltage.
3052 * Pulled from:
3053 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3054 */
3055message BatteryVoltage {
3056 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003057 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003058}
3059
3060/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003061 * Pulls battery level (percent full, from 0 to 100).
3062 *
3063 * Pulled from:
3064 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3065 */
3066message BatteryLevel {
3067 // Battery level. Should be in [0, 100].
3068 optional int32 battery_level = 1;
3069}
3070
3071/**
Tej Singhd89137e2018-03-26 14:51:40 -07003072 * Pulls the temperature of various parts of the device.
3073 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003074 *
3075 * Pulled from:
3076 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3077 */
3078message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003079 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003080 optional android.os.TemperatureTypeEnum sensor_location = 1;
3081
3082 // The name of the temperature source. Eg. CPU0
3083 optional string sensor_name = 2;
3084
Tej Singhd89137e2018-03-26 14:51:40 -07003085 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003086 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003087 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003088}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003089
3090/**
3091 * Pulls the statistics of calls to Binder.
3092 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003093 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3094 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003095 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003096 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003097 */
3098message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003099 // UID of the process responsible for the binder transaction. It will be set if the process
3100 // executing the binder transaction attribute the transaction to another uid using
3101 // Binder.setThreadWorkSource().
3102 //
3103 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003104 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003105 // UID of the process executing the binder transaction.
3106 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003107 // Fully qualified class name of the API call.
3108 //
3109 // This is a system server class name.
3110 //
3111 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3112 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3113 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3114 // commonly used APIs.
3115 optional string service_class_name = 2;
3116 // Method name of the API call. It can also be a transaction code if we cannot
3117 // resolve it to a name. See Binder#getTransactionName.
3118 //
3119 // This is a system server method name.
3120 optional string service_method_name = 3;
3121 // Total number of API calls.
3122 optional int64 call_count = 4;
3123 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3124 optional bool screen_interactive = 13;
3125 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3126 // call_count will be equal to recorded_call_count.
3127 //
3128 // If recorded_call_count is different than call_count, it means data collection has been
3129 // sampled. All the fields below will be sampled in this case.
3130 optional int64 recorded_call_count = 12;
3131 // Number of exceptions thrown by the API.
3132 optional int64 recorded_exception_count = 5;
3133 // Total latency of all API calls.
3134 // Average can be computed using total_latency_micros / recorded_call_count.
3135 optional int64 recorded_total_latency_micros = 6;
3136 // Maximum latency of one API call.
3137 optional int64 recorded_max_latency_micros = 7;
3138 // Total CPU usage of all API calls.
3139 // Average can be computed using total_cpu_micros / recorded_call_count.
3140 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3141 optional int64 recorded_total_cpu_micros = 8;
3142 // Maximum CPU usage of one API call.
3143 optional int64 recorded_max_cpu_micros = 9;
3144 // Maximum parcel reply size of one API call.
3145 optional int64 recorded_max_reply_size_bytes = 10;
3146 // Maximum parcel request size of one API call.
3147 optional int64 recorded_max_request_size_bytes = 11;
3148}
3149
3150/**
3151 * Pulls the statistics of exceptions during calls to Binder.
3152 *
3153 * Binder stats are cumulative from boot unless somebody reset the data using
3154 * > adb shell dumpsys binder_calls_stats --reset
3155 */
3156message BinderCallsExceptions {
3157 // Exception class name, e.g. java.lang.IllegalArgumentException.
3158 //
3159 // This is an exception class name thrown by the system server.
3160 optional string exception_class_name = 1;
3161 // Total number of exceptions.
3162 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003163}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003164
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003165/**
3166 * Pulls the statistics of message dispatching on HandlerThreads.
3167 *
3168 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3169 * config on the device.
3170 *
3171 * Next tag: 11
3172 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003173message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003174 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003175 optional int32 uid = 1 [(is_uid) = true];
3176
3177 // Fully qualified class name of the handler target class.
3178 //
3179 // This field does not contain PII. This is a system server class name.
3180 optional string handler_class_name = 2;
3181
3182 // The name of the thread that runs the Looper.
3183 //
3184 // This field does not contain PII. This is a system server thread name.
3185 optional string looper_thread_name = 3;
3186
3187 // The name of the dispatched message.
3188 //
3189 // This field does not contain PII. This is a system server constant or class
3190 // name.
3191 optional string message_name = 4;
3192
3193 // Total number of successfully dispatched messages.
3194 optional int64 message_count = 5;
3195
3196 // Total number of messages that failed dispatching.
3197 optional int64 exception_count = 6;
3198
3199 // Total number of processed messages we have data recorded for. If we
3200 // collected data for all the messages, message_count will be equal to
3201 // recorded_message_count.
3202 //
3203 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003204 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003205 optional int64 recorded_message_count = 7;
3206
3207 // Total latency of all processed messages.
3208 // Average can be computed using recorded_total_latency_micros /
3209 // recorded_message_count.
3210 optional int64 recorded_total_latency_micros = 8;
3211
3212 // Total CPU usage of all processed message.
3213 // Average can be computed using recorded_total_cpu_micros /
3214 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003215 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003216 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003217
3218 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3219 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003220
3221 // Max recorded CPU usage of all processed messages.
3222 optional int64 recorded_max_cpu_micros = 11;
3223
3224 // Max recorded latency of all processed messages.
3225 optional int64 recorded_max_latency_micros = 12;
3226
3227 // Total number of messages we tracked the dispatching delay for. If we
3228 // collected data for all the messages, message_count will be equal to
3229 // recorded_delay_message_count.
3230 //
3231 // If recorded_delay_message_count is different than message_count, it means data
3232 // collection has been sampled or/and not all messages specified the target dispatch time.
3233 // The fields below will be sampled in this case.
3234 optional int64 recorded_delay_message_count = 13;
3235
3236 // Total dispatching delay of all processed messages.
3237 // Calculated as a difference between the target dispatching time (Message.when)
3238 // and the actual dispatching time.
3239 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3240 optional int64 recorded_total_delay_millis = 14;
3241
3242 // Max dispatching delay of all processed messages.
3243 // Calculated as a difference between the target dispatching time (Message.when)
3244 // and the actual dispatching time.
3245 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003246}
Tej Singh86dc9db2018-09-06 00:39:57 +00003247
3248/**
3249 * Pulls disk information, such as write speed and latency.
3250 */
3251message DiskStats {
3252 // Time taken to open, write 512B to, and close a file.
3253 // -1 if error performing the check.
3254 optional int64 data_write_latency_millis = 1;
3255
3256 optional bool file_based_encryption = 2;
3257
3258 // Recent disk write speed in kB/s.
3259 // -1 if error querying storageed.
3260 // 0 if data is unavailable.
3261 optional int32 recent_disk_write_speed = 3;
3262}
3263
3264
3265/**
3266 * Free and total bytes of the Data, Cache, and System partition.
3267 */
3268message DirectoryUsage {
3269 enum Directory {
3270 UNKNOWN = 0;
3271 DATA = 1;
3272 CACHE = 2;
3273 SYSTEM = 3;
3274 }
3275 optional Directory directory = 1;
3276 optional int64 free_bytes = 2;
3277 optional int64 total_bytes = 3;
3278}
3279
3280
3281/**
3282 * Size of an application: apk size, data size, and cache size.
3283 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3284 * Information is only reported for apps with the primary user (user 0).
3285 * Sizes are aggregated by package name.
3286 */
3287message AppSize {
3288 // Including uids will involve modifying diskstats logic.
3289 optional string package_name = 1;
3290 // App size in bytes. -1 if unavailable.
3291 optional int64 app_size_bytes = 2;
3292 // App data size in bytes. -1 if unavailable.
3293 optional int64 app_data_size_bytes = 3;
3294 // App cache size in bytes. -1 if unavailable.
3295 optional int64 app_cache_size_bytes = 4;
3296 // Time that the cache file was produced.
3297 // Uses System.currentTimeMillis(), which is wall clock time.
3298 optional int64 cache_time_millis = 5;
3299}
3300
3301
3302/**
3303 * Size of a particular category. Eg: photos, videos.
3304 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3305 */
3306message CategorySize {
3307 enum Category {
3308 UNKNOWN = 0;
3309 APP_SIZE = 1;
3310 APP_DATA_SIZE = 2;
3311 APP_CACHE_SIZE = 3;
3312 PHOTOS = 4;
3313 VIDEOS = 5;
3314 AUDIO = 6;
3315 DOWNLOADS = 7;
3316 SYSTEM = 8;
3317 OTHER = 9;
3318 }
3319 optional Category category = 1;
3320 // Category size in bytes.
3321 optional int64 size_bytes = 2;
3322 // Time that the cache file was produced.
3323 // Uses System.currentTimeMillis(), which is wall clock time.
3324 optional int64 cache_time_millis = 3;
3325}
Tej Singhd6d6d772018-09-05 17:41:25 -07003326
3327/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003328 * Pulls per uid I/O stats. The stats are cumulative since boot.
3329 *
3330 * Read/write bytes are I/O events from a storage device
3331 * Read/write chars are data requested by read/write syscalls, and can be
3332 * satisfied by caching.
3333 *
3334 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3335 */
3336message DiskIo {
3337 optional int32 uid = 1 [(is_uid) = true];
3338 optional int64 fg_chars_read = 2;
3339 optional int64 fg_chars_write = 3;
3340 optional int64 fg_bytes_read = 4;
3341 optional int64 fg_bytes_write = 5;
3342 optional int64 bg_chars_read = 6;
3343 optional int64 bg_chars_write = 7;
3344 optional int64 bg_bytes_read = 8;
3345 optional int64 bg_bytes_write = 9;
3346 optional int64 fg_fsync = 10;
3347 optional int64 bg_fsync= 11;
3348}
3349
3350
3351/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003352 * Pulls the number of fingerprints for each user.
3353 *
3354 * Pulled from StatsCompanionService, which queries FingerprintManager.
3355 */
3356message NumFingerprints {
3357 // The associated user. Eg: 0 for owners, 10+ for others.
3358 // Defined in android/os/UserHandle.java
3359 optional int32 user = 1;
3360 // Number of fingerprints registered to that user.
3361 optional int32 num_fingerprints = 2;
3362}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003363
Yangsteraf9aee72018-10-12 09:26:16 -07003364message AggStats {
3365 optional int64 min = 1;
3366
3367 optional int64 average = 2;
3368
3369 optional int64 max = 3;
3370}
3371
3372message ProcessStatsStateProto {
3373 optional android.service.procstats.ScreenState screen_state = 1;
3374
3375 optional android.service.procstats.MemoryState memory_state = 2;
3376
3377 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3378 // and not frameworks/base/core/java/android/app/ActivityManager.java
3379 optional android.service.procstats.ProcessState process_state = 3;
3380
3381 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003382 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003383
3384 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003385 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003386
3387 // # of samples taken
3388 optional int32 sample_size = 5;
3389
3390 // PSS is memory reserved for this process
3391 optional AggStats pss = 6;
3392
3393 // USS is memory shared between processes, divided evenly for accounting
3394 optional AggStats uss = 7;
3395
3396 // RSS is memory resident for this process
3397 optional AggStats rss = 8;
3398}
3399
3400// Next Tag: 7
3401message ProcessStatsProto {
3402 // Name of process.
3403 optional string process = 1;
3404
3405 // Uid of the process.
3406 optional int32 uid = 2;
3407
3408 // Information about how often kills occurred
3409 message Kill {
3410 // Count of excessive CPU kills
3411 optional int32 cpu = 1;
3412
3413 // Count of kills when cached
3414 optional int32 cached = 2;
3415
3416 // PSS stats during cached kill
3417 optional AggStats cached_pss = 3;
3418 }
3419 optional Kill kill = 3;
3420
3421 // Time and memory spent in various states.
3422 repeated ProcessStatsStateProto states = 5;
3423
3424 // Total time process has been running... screen_state, memory_state, and process_state
3425 // will not be set.
3426 optional ProcessStatsStateProto total_running_state = 6;
3427}
3428
3429message PackageServiceOperationStatsProto {
3430 // Operate enum: Started, Foreground, Bound, Executing
3431 optional android.service.procstats.ServiceOperationState operation = 1;
3432
3433 // Number of times the service was in this operation.
3434 optional int32 count = 2;
3435
3436 // Information about a state the service can be in.
3437 message StateStats {
3438 // Screen state enum.
3439 optional android.service.procstats.ScreenState screen_state = 1;
3440 // Memory state enum.
3441 optional android.service.procstats.MemoryState memory_state = 2;
3442
3443 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003444 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003445 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003446 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003447 }
3448 repeated StateStats state_stats = 3;
3449}
3450
3451message PackageServiceStatsProto {
3452 // Name of service component.
3453 optional string service_name = 1;
3454
3455 // The operation stats.
3456 // The package_name, package_uid, package_version, service_name will not be set to save space.
3457 repeated PackageServiceOperationStatsProto operation_stats = 2;
3458}
3459
3460message PackageAssociationSourceProcessStatsProto {
3461 // Uid of the process.
3462 optional int32 process_uid = 1;
3463 // Process name.
3464 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08003465 // Package name.
3466 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07003467 // Total count of the times this association appeared.
3468 optional int32 total_count = 3;
3469
3470 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003471 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003472
3473 // Total count of the times this association became actively impacting its target process.
3474 optional int32 active_count = 5;
3475
3476 // Information on one source in this association.
3477 message StateStats {
3478 // Process state enum.
3479 optional android.service.procstats.ProcessState process_state = 1;
3480 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003481 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003482 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003483 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003484 }
3485 repeated StateStats active_state_stats = 6;
3486}
3487
3488message PackageAssociationProcessStatsProto {
3489 // Name of the target component.
3490 optional string component_name = 1;
3491 // Information on one source in this association.
3492 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3493}
3494
3495
3496message ProcessStatsPackageProto {
3497 // Name of package.
3498 optional string package = 1;
3499
3500 // Uid of the package.
3501 optional int32 uid = 2;
3502
3503 // Version of the package.
3504 optional int64 version = 3;
3505
3506 // Stats for each process running with the package loaded in to it.
3507 repeated ProcessStatsProto process_stats = 4;
3508
3509 // Stats for each of the package's services.
3510 repeated PackageServiceStatsProto service_stats = 5;
3511
3512 // Stats for each association with the package.
3513 repeated PackageAssociationProcessStatsProto association_stats = 6;
3514}
3515
3516message ProcessStatsSectionProto {
3517 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003518 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003519
3520 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003521 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003522
3523 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003524 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003525
3526 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003527 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003528
3529 // System runtime library. e.g. "libdvm.so", "libart.so".
3530 optional string runtime = 5;
3531
3532 // whether kernel reports swapped pss.
3533 optional bool has_swapped_pss = 6;
3534
3535 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3536 enum Status {
3537 STATUS_UNKNOWN = 0;
3538 STATUS_COMPLETE = 1;
3539 STATUS_PARTIAL = 2;
3540 STATUS_SHUTDOWN = 3;
3541 STATUS_SYSPROPS = 4;
3542 }
3543 repeated Status status = 7;
3544
Chenjie Yub2ecc792019-01-17 10:27:26 -08003545 // Number of pages available of various types and sizes, representation fragmentation.
3546 repeated ProcessStatsAvailablePagesProto available_pages = 10;
3547
Yangsteraf9aee72018-10-12 09:26:16 -07003548 // Stats for each process.
3549 repeated ProcessStatsProto process_stats = 8;
3550
3551 // Stats for each package.
3552 repeated ProcessStatsPackageProto package_stats = 9;
3553}
3554
Chenjie Yub2ecc792019-01-17 10:27:26 -08003555message ProcessStatsAvailablePagesProto {
3556 // Node these pages are in (as per /proc/pagetypeinfo)
3557 optional int32 node = 1;
3558
3559 // Zone these pages are in (as per /proc/pagetypeinfo)
3560 optional string zone = 2;
3561
3562 // Label for the type of these pages (as per /proc/pagetypeinfo)
3563 optional string label = 3;
3564
3565 // Distribution of number of pages available by order size. First entry in array is
3566 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
3567 repeated int32 pages_per_order = 4;
3568}
3569
Chenjie Yu12e5e672018-09-14 15:54:59 -07003570/**
3571 * Pulled from ProcessStatsService.java
3572 */
3573message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003574 optional ProcessStatsSectionProto proc_stats_section = 1;
3575}
3576
Chenjie Yuf910b7802019-01-11 16:08:20 -08003577/**
3578 * Pulled from ProcessStatsService.java
3579 */
3580message ProcStatsPkgProc {
3581 optional ProcessStatsSectionProto proc_stats_section = 1;
3582}
3583
Yangsteraf9aee72018-10-12 09:26:16 -07003584message PowerProfileProto {
3585 optional double cpu_suspend = 1;
3586
3587 optional double cpu_idle = 2;
3588
3589 optional double cpu_active = 3;
3590
3591 message CpuCluster {
3592 optional int32 id = 1;
3593 optional double cluster_power = 2;
3594 optional int32 cores = 3;
3595 repeated int64 speed = 4;
3596 repeated double core_power = 5;
3597 }
3598
3599 repeated CpuCluster cpu_cluster = 40;
3600
3601 optional double wifi_scan = 4;
3602
3603 optional double wifi_on = 5;
3604
3605 optional double wifi_active = 6;
3606
3607 optional double wifi_controller_idle = 7;
3608
3609 optional double wifi_controller_rx = 8;
3610
3611 optional double wifi_controller_tx = 9;
3612
3613 repeated double wifi_controller_tx_levels = 10;
3614
3615 optional double wifi_controller_operating_voltage = 11;
3616
3617 optional double bluetooth_controller_idle = 12;
3618
3619 optional double bluetooth_controller_rx = 13;
3620
3621 optional double bluetooth_controller_tx = 14;
3622
3623 optional double bluetooth_controller_operating_voltage = 15;
3624
3625 optional double modem_controller_sleep = 16;
3626
3627 optional double modem_controller_idle = 17;
3628
3629 optional double modem_controller_rx = 18;
3630
3631 repeated double modem_controller_tx = 19;
3632
3633 optional double modem_controller_operating_voltage = 20;
3634
3635 optional double gps_on = 21;
3636
3637 repeated double gps_signal_quality_based = 22;
3638
3639 optional double gps_operating_voltage = 23;
3640
3641 optional double bluetooth_on = 24;
3642
3643 optional double bluetooth_active = 25;
3644
3645 optional double bluetooth_at_cmd = 26;
3646
3647 optional double ambient_display = 27;
3648
3649 optional double screen_on = 28;
3650
3651 optional double radio_on = 29;
3652
3653 optional double radio_scanning = 30;
3654
3655 optional double radio_active = 31;
3656
3657 optional double screen_full = 32;
3658
3659 optional double audio = 33;
3660
3661 optional double video = 34;
3662
3663 optional double flashlight = 35;
3664
3665 optional double memory = 36;
3666
3667 optional double camera = 37;
3668
3669 optional double wifi_batched_scan = 38;
3670
3671 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003672}
Chenjie Yuab530202018-09-26 12:39:20 -07003673
3674/**
3675 * power_profile.xml and other constants for power model calculations.
3676 * Pulled from PowerProfile.java
3677 */
3678message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003679 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003680}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003681
3682/**
arangelovd5db50e2018-10-12 20:24:39 +01003683 * Logs when a user restriction was added or removed.
3684 *
3685 * Logged from:
3686 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3687 */
3688message UserRestrictionChanged {
3689 // The raw string of the user restriction as defined in UserManager.
3690 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3691 optional string restriction = 1;
3692 // Whether the restriction is enabled or disabled.
3693 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003694}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003695
3696/**
3697 * Pulls process user time and system time. Puller takes a snapshot of all pids
3698 * in the system and returns cpu stats for those that are working at the time.
3699 * Dead pids will be dropped. Kernel processes are excluded.
3700 * Min cool-down is 5 sec.
3701 */
3702message ProcessCpuTime {
3703 optional int32 uid = 1 [(is_uid) = true];
3704
3705 optional string process_name = 2;
3706 // Process cpu time in user space, cumulative from boot/process start
3707 optional int64 user_time_millis = 3;
3708 // Process cpu time in system space, cumulative from boot/process start
3709 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003710}
Misha Wagner5a51e002018-10-03 15:04:09 +01003711
3712/**
3713 * Pulls the CPU usage for each thread.
3714 *
3715 * Read from /proc/$PID/task/$TID/time_in_state files.
3716 *
3717 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3718 * time_in_state files not being present on some phones, have not been addressed. These should be
3719 * considered before a public release.
3720 */
3721message CpuTimePerThreadFreq {
3722 // UID that owns the process.
3723 optional int32 uid = 1 [(is_uid) = true];
3724 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003725 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003726 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003727 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003728 // Name of the process taken from `/proc/$PID/cmdline`.
3729 optional string process_name = 4;
3730 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3731 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003732
3733 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3734 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3735 // frequencies are given here as the alternative is sending eight separate atoms. This method
3736 // significantly reduces the amount of data created
3737 optional int32 frequency1_khz = 6;
3738 optional int32 time1_millis = 7;
3739 optional int32 frequency2_khz = 8;
3740 optional int32 time2_millis = 9;
3741 optional int32 frequency3_khz = 10;
3742 optional int32 time3_millis = 11;
3743 optional int32 frequency4_khz = 12;
3744 optional int32 time4_millis = 13;
3745 optional int32 frequency5_khz = 14;
3746 optional int32 time5_millis = 15;
3747 optional int32 frequency6_khz = 16;
3748 optional int32 time6_millis = 17;
3749 optional int32 frequency7_khz = 18;
3750 optional int32 time7_millis = 19;
3751 optional int32 frequency8_khz = 20;
3752 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003753}
Bookatz75ee6042018-11-09 12:27:37 -08003754
3755/**
Bookatz366a4432018-11-20 09:42:33 -08003756 * Pulls information about the device's build.
3757 */
3758message BuildInformation {
3759 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3760 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3761 optional string fingerprint = 1;
3762
3763 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3764 optional string brand = 2;
3765
3766 // Build.PRODUCT. The name of the overall product.
3767 optional string product = 3;
3768
3769 // Build.DEVICE. The name of the industrial design.
3770 optional string device = 4;
3771
3772 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3773 optional string version_release = 5;
3774
3775 // Build.ID. E.g. a label like "M4-rc20".
3776 optional string id = 6;
3777
3778 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3779 // represent this build.
3780 optional string version_incremental = 7;
3781
3782 // Build.TYPE. The type of build, like "user" or "eng".
3783 optional string type = 8;
3784
3785 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3786 optional string tags = 9;
3787}
3788
3789/**
Bookatz75ee6042018-11-09 12:27:37 -08003790 * Pulls on-device BatteryStats power use calculations for the overall device.
3791 */
3792message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08003793 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3794 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3795 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3796 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08003797}
3798
3799/**
3800 * Pulls on-device BatteryStats power use calculations broken down by uid.
3801 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3802 * that is attributed to non-uid items. They must all be included to get the total power use.
3803 */
3804message DeviceCalculatedPowerBlameUid {
3805 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3806 optional int32 uid = 1 [(is_uid) = true];
3807
Bookatz3dbc13a2018-12-21 12:16:51 -08003808 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3809 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3810 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08003811}
3812
3813/**
3814 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3815 * drain type.
3816 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3817 * is attributed uids. They must all be included to get the total power use.
3818 */
3819message DeviceCalculatedPowerBlameOther {
3820 // The type of item whose power use is being reported.
3821 enum DrainType {
3822 AMBIENT_DISPLAY = 0;
3823 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3824 BLUETOOTH = 2;
3825 CAMERA = 3;
3826 // Cell-standby
3827 CELL = 4;
3828 FLASHLIGHT = 5;
3829 IDLE = 6;
3830 MEMORY = 7;
3831 // Amount that total computed drain exceeded the drain estimated using the
3832 // battery level changes and capacity.
3833 OVERCOUNTED = 8;
3834 PHONE = 9;
3835 SCREEN = 10;
3836 // Amount that total computed drain was below the drain estimated using the
3837 // battery level changes and capacity.
3838 UNACCOUNTED = 11;
3839 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3840 WIFI = 13;
3841 }
3842 optional DrainType drain_type = 1;
3843
Bookatz3dbc13a2018-12-21 12:16:51 -08003844 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3845 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3846 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003847}
arangelov4e994062018-11-13 16:12:38 +00003848
3849/**
3850 * Logs device policy features.
3851 *
3852 * Logged from:
3853 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3854 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3855 */
3856message DevicePolicyEvent {
3857 // The event id - unique for each event.
3858 optional android.stats.devicepolicy.EventId event_id = 1;
3859 // The admin package name.
3860 optional string admin_package_name = 2;
3861 // A generic integer parameter.
3862 optional int32 integer_value = 3;
3863 // A generic boolean parameter.
3864 optional bool boolean_value = 4;
3865 // A parameter specifying a time period in milliseconds.
3866 optional uint64 time_period_millis = 5;
3867 // A parameter specifying a list of package names, bundle extras or string parameters.
3868 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3869}
shawnlinea5b66b2018-11-13 15:05:29 +08003870
3871/**
3872 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3873 *
3874 * Logged from:
3875 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3876 */
3877message DocsUILaunchReported {
3878 optional android.stats.docsui.LaunchAction launch_action = 1;
3879 optional bool has_initial_uri = 2;
3880 optional android.stats.docsui.MimeType mime_type = 3;
3881 optional android.stats.docsui.Root initial_root = 4;
3882}
3883
3884/**
3885 * Logs root/app visited event in file managers/picker. Call this when the user
3886 * taps on root/app in hamburger menu.
3887 *
3888 * Logged from:
3889 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3890 */
3891message DocsUIRootVisitedReported {
3892 optional android.stats.docsui.ContextScope scope = 1;
3893 optional android.stats.docsui.Root root = 2;
3894}
3895
3896/**
3897 * Logs file operation stats. Call this when a file operation has completed.
3898 *
3899 * Logged from:
3900 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3901 */
3902message DocsUIFileOperationReported {
3903 optional android.stats.docsui.Provider provider = 1;
3904 optional android.stats.docsui.FileOperation file_op = 2;
3905}
3906
3907/**
3908 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3909 * mode.
3910 *
3911 * Logged from:
3912 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3913 */
3914message DocsUIFileOperationCopyMoveModeReported {
3915 optional android.stats.docsui.FileOperation file_op = 1;
3916 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3917}
3918
3919
3920/**
3921 * Logs file sub operation stats. Call this when a file operation has failed.
3922 *
3923 * Logged from:
3924 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3925 */
3926message DocsUIFileOperationFailureReported {
3927 optional android.stats.docsui.Authority authority = 1;
3928 optional android.stats.docsui.SubFileOperation sub_op = 2;
3929}
3930
3931/**
3932* Logs the cancellation of a file operation. Call this when a job is canceled
3933*
3934* Logged from:
3935* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3936*/
3937message DocsUIFileOperationCanceledReported {
3938 optional android.stats.docsui.FileOperation file_op = 1;
3939}
3940
3941/**
3942 * Logs startup time in milliseconds.
3943 *
3944 * Logged from:
3945 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3946 */
3947message DocsUIStartupMsReported {
3948 optional int32 startup_millis = 1;
3949}
3950
3951/**
3952 * Logs the action that was started by user.
3953 *
3954 * Logged from:
3955 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3956 */
3957message DocsUIUserActionReported {
3958 optional android.stats.docsui.UserAction action = 1;
3959}
3960
3961/**
3962 * Logs the invalid type when invalid scoped access is requested.
3963 *
3964 * Logged from:
3965 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
3966 */
3967message DocsUIInvalidScopedAccessRequestReported {
3968 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00003969}
Ben Murdochbab399f2018-12-06 11:01:38 +00003970
3971/**
shawnlina75e82d2019-01-07 10:31:12 +08003972 * Logs the package name that launches docsui picker mode.
3973 *
3974 * Logged from:
3975 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3976 */
3977message DocsUIPickerLaunchedFromReported {
3978 optional string package_name = 1;
3979}
3980
3981/**
3982 * Logs the search type.
3983 *
3984 * Logged from:
3985 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3986 */
3987message DocsUISearchTypeReported {
3988 optional android.stats.docsui.SearchType search_type = 1;
3989}
3990
3991/**
3992 * Logs the search mode.
3993 *
3994 * Logged from:
3995 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3996 */
3997message DocsUISearchModeReported {
3998 optional android.stats.docsui.SearchMode search_mode = 1;
3999}
4000
4001/**
4002 * Logs the pick result information.
4003 *
4004 * Logged from:
4005 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4006 */
4007message DocsUIPickResultReported {
4008 optional int32 total_action_count = 1;
4009 optional int64 duration_millis = 2;
4010 optional int32 file_count= 3;
4011 optional bool is_searching = 4;
4012 optional android.stats.docsui.Root picked_from = 5;
4013 optional android.stats.docsui.MimeType mime_type = 6;
4014 optional int32 repeatedly_pick_times = 7;
4015}
4016
4017/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004018 * Logs when an app's memory is compacted.
4019 *
4020 * Logged from:
4021 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4022 */
4023message AppCompacted {
4024 // The pid of the process being compacted.
4025 optional int32 pid = 1;
4026
4027 // The name of the process being compacted.
4028 optional string process_name = 2;
4029
4030 // The type of compaction.
4031 enum Action {
4032 UNKNOWN = 0;
4033 SOME = 1;
4034 FULL = 2;
4035 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004036 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004037
4038 // Total RSS in kilobytes consumed by the process prior to compaction.
4039 optional int64 before_rss_total_kilobytes = 4;
4040
4041 // File RSS in kilobytes consumed by the process prior to compaction.
4042 optional int64 before_rss_file_kilobytes = 5;
4043
4044 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4045 optional int64 before_rss_anon_kilobytes = 6;
4046
4047 // Swap in kilobytes consumed by the process prior to compaction.
4048 optional int64 before_swap_kilobytes = 7;
4049
4050 // Total RSS in kilobytes consumed by the process after compaction.
4051 optional int64 after_rss_total_kilobytes = 8;
4052
4053 // File RSS in kilobytes consumed by the process after compaction.
4054 optional int64 after_rss_file_kilobytes = 9;
4055
4056 // Anonymous RSS in kilobytes consumed by the process after compaction.
4057 optional int64 after_rss_anon_kilobytes = 10;
4058
4059 // Swap in kilobytes consumed by the process after compaction.
4060 optional int64 after_swap_kilobytes = 11;
4061
4062 // The time taken to perform compaction in milliseconds.
4063 optional int64 time_to_compact_millis = 12;
4064
4065 // The last compaction action performed for this app.
4066 optional Action last_action = 13;
4067
Ben Murdoch01720b82018-12-19 18:03:44 +00004068 // The last time that compaction was attempted on this process in milliseconds
4069 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4070 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004071
Ben Murdoch01720b82018-12-19 18:03:44 +00004072 // The oom_score_adj at the time of compaction.
4073 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004074
4075 // The process state at the time of compaction.
4076 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4077}
lifr157fc552018-12-12 16:38:04 +08004078
4079/**
4080 * Logs the latency period(in microseconds) and the return code of
4081 * the DNS(Domain Name System) lookups.
4082 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4083 * to get info(address or hostname) from DNS server(or DNS cache).
4084 * Logged from:
4085 * /system/netd/server/DnsProxyListener.cpp
4086 */
4087message NetworkDnsEventReported {
4088 // The types of the DNS lookups, as defined in
4089 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4090 enum EventType {
4091 EVENT_UNKNOWN = 0;
4092 EVENT_GETADDRINFO = 1;
4093 EVENT_GETHOSTBYNAME = 2;
4094 EVENT_GETHOSTBYADDR = 3;
4095 EVENT_RES_NSEND = 4;
4096 }
4097 optional EventType event_type = 1;
4098
4099 // The return value of the DNS resolver for each DNS lookups.
4100 //bionic/libc/include/netdb.h
4101 //system/netd/resolv/include/netd_resolv/resolv.h
4102 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004103 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004104 EAI_ADDRFAMILY = 1;
4105 EAI_AGAIN = 2;
4106 EAI_BADFLAGS = 3;
4107 EAI_FAIL = 4;
4108 EAI_FAMILY = 5;
4109 EAI_MEMORY = 6;
4110 EAI_NODATA = 7;
4111 EAI_NONAME = 8;
4112 EAI_SERVICE = 9;
4113 EAI_SOCKTYPE = 10;
4114 EAI_SYSTEM = 11;
4115 EAI_BADHINTS = 12;
4116 EAI_PROTOCOL = 13;
4117 EAI_OVERFLOW = 14;
4118 RESOLV_TIMEOUT = 255;
4119 EAI_MAX = 256;
4120 }
4121 optional ReturnCode return_code = 2;
4122
4123 // The latency period(in microseconds) it took for this DNS lookup to complete.
4124 optional int32 latency_micros = 3;
4125}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004126
4127/**
4128 * Logs when a data stall event occurs.
4129 *
4130 * Log from:
4131 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4132 */
4133message DataStallEvent {
4134 // Data stall evaluation type.
4135 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4136 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4137 optional int32 evaluation_type = 1;
4138 // See definition in data_stall_event.proto.
4139 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4140 // See definition in data_stall_event.proto.
4141 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4142 // See definition in data_stall_event.proto.
4143 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4144 // See definition in data_stall_event.proto.
4145 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4146 // See definition in data_stall_event.proto.
4147 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4148}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004149
4150/*
4151 * Logs when RescueParty resets some set of experiment flags.
4152 *
4153 * Logged from:
4154 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4155 */
4156message RescuePartyResetReported {
4157 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4158 optional int32 rescue_level = 1;
4159}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004160
4161/**
4162 * Logs when signed config is received from an APK, and if that config was applied successfully.
4163 * Logged from:
4164 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4165 */
4166message SignedConfigReported {
4167 enum Type {
4168 UNKNOWN_TYPE = 0;
4169 GLOBAL_SETTINGS = 1;
4170 }
4171 optional Type type = 1;
4172
4173 // The final status of the signed config received.
4174 enum Status {
4175 UNKNOWN_STATUS = 0;
4176 APPLIED = 1;
4177 BASE64_FAILURE_CONFIG = 2;
4178 BASE64_FAILURE_SIGNATURE = 3;
4179 SECURITY_EXCEPTION = 4;
4180 INVALID_CONFIG = 5;
4181 OLD_CONFIG = 6;
4182 SIGNATURE_CHECK_FAILED = 7;
4183 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004184 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004185 }
4186 optional Status status = 2;
4187
4188 // The version of the signed config processed.
4189 optional int32 version = 3;
4190
4191 // The package name that the config was extracted from.
4192 optional string from_package = 4;
4193
4194 enum Key {
4195 NO_KEY = 0;
4196 DEBUG = 1;
4197 PRODUCTION = 2;
4198 }
4199 // Which key was used to verify the config.
4200 optional Key verified_with = 5;
4201}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004202
4203/*
4204 * Logs GNSS Network-Initiated (NI) location events.
4205 *
4206 * Logged from:
4207 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4208 */
4209message GnssNiEventReported {
4210 // The type of GnssNiEvent.
4211 enum EventType {
4212 UNKNOWN = 0;
4213 NI_REQUEST = 1;
4214 NI_RESPONSE = 2;
4215 }
4216 optional EventType event_type = 1;
4217
4218 // An ID generated by HAL to associate NI notifications and UI responses.
4219 optional int32 notification_id = 2;
4220
4221 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004222 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004223
4224 // NI requires notification.
4225 optional bool need_notify = 4;
4226
4227 // NI requires verification.
4228 optional bool need_verify = 5;
4229
4230 // NI requires privacy override, no notification/minimal trace.
4231 optional bool privacy_override = 6;
4232
4233 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4234 // seconds.
4235 optional int32 timeout = 7;
4236
4237 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004238 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004239
4240 // String representing the requester of the network inititated location request.
4241 optional string requestor_id = 9;
4242
4243 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4244 // network initiated location request.
4245 optional string text = 10;
4246
4247 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004248 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004249
4250 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004251 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004252
4253 // True if SUPL ES is enabled.
4254 optional bool is_supl_es_enabled = 13;
4255
4256 // True if GNSS location is enabled.
4257 optional bool is_location_enabled = 14;
4258
4259 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004260 optional android.server.location.GnssUserResponseType user_response = 15;
4261}
4262
4263/**
4264 * Logs GNSS non-framework (NFW) location notification.
4265 *
4266 * Logged from:
4267 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4268 */
4269message GnssNfwNotificationReported {
4270 // Package name of the Android proxy application representing the non-framework entity that
4271 // requested location. Set to empty string if unknown.
4272 optional string proxy_app_package_name = 1;
4273
4274 // Protocol stack that initiated the non-framework location request.
4275 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4276
4277 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4278 // set to empty string. This field is opaque to the framework and used for logging purposes.
4279 optional string other_protocol_stack_name = 3;
4280
4281 // Source initiating/receiving the location information.
4282 optional android.server.location.NfwRequestor requestor = 4;
4283
4284 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4285 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4286 // and used for logging purposes.
4287 optional string requestor_id = 5;
4288
4289 // Indicates whether location information was provided for this request.
4290 optional android.server.location.NfwResponseType response_type = 6;
4291
4292 // True if the device is in user initiated emergency session.
4293 optional bool in_emergency_mode = 7;
4294
4295 // True if cached location is provided.
4296 optional bool is_cached_location = 8;
4297
4298 // True if proxy app permission mismatch between framework and GNSS HAL.
4299 optional bool is_permission_mismatched = 9;
4300}
4301
4302/**
4303 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4304 *
4305 * Logged from:
4306 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4307 */
4308message GnssConfigurationReported {
4309 // SUPL host name.
4310 optional string supl_host = 1;
4311
4312 // SUPL port number.
4313 optional int32 supl_port = 2;
4314
4315 // C2K host name.
4316 optional string c2k_host = 3;
4317
4318 // C2K port number.
4319 optional int32 c2k_port = 4;
4320
4321 // The SUPL version requested by Carrier.
4322 optional int32 supl_ver = 5;
4323
4324 // The SUPL mode.
4325 optional android.server.location.SuplMode supl_mode = 6;
4326
4327 // True if NI emergency SUPL restrictions is enabled.
4328 optional bool supl_es = 7;
4329
4330 // LTE Positioning Profile settings
4331 optional android.server.location.LppProfile lpp_profile = 8;
4332
4333 // Positioning protocol on A-Glonass system.
4334 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4335
4336 // True if emergency PDN is used. Otherwise, regular PDN is used.
4337 optional bool use_emergency_pdn_for_emergency_supl= 10;
4338
4339 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4340 optional android.server.location.GpsLock gps_lock = 11;
4341
4342 // Number of seconds to extend the emergency session duration post emergency call.
4343 optional int32 es_extension_sec = 12;
4344
4345 // The full list of package names of proxy Android applications representing the non-framework
4346 // location access entities (on/off the device) for which the framework user has granted
4347 // non-framework location access permission. The package names are concatenated in one string
4348 // with spaces as separators.
4349 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004350}
Jack Yu95b64f32018-12-13 18:26:11 +08004351
4352/**
4353 * Logs when a NFC device's error occurred.
4354 * Logged from:
4355 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4356 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
4357 */
4358message NfcErrorOccurred {
4359 enum Type {
4360 UNKNOWN = 0;
4361 CMD_TIMEOUT = 1;
4362 ERROR_NOTIFICATION = 2;
4363 AID_OVERFLOW = 3;
4364 }
4365 optional Type type = 1;
4366 // If it's nci cmd timeout, log the timeout command.
4367 optional uint32 nci_cmd = 2;
4368
4369 optional uint32 error_ntf_status_code = 3;
4370}
4371
4372/**
4373 * Logs when a NFC device's state changed event
4374 * Logged from:
4375 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
4376 */
4377message NfcStateChanged {
4378 enum State {
4379 UNKNOWN = 0;
4380 OFF = 1;
4381 ON = 2;
4382 ON_LOCKED = 3; // Secure Nfc enabled.
4383 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
4384 }
4385 optional State state = 1;
4386}
4387
4388/**
4389 * Logs when a NFC Beam Transaction occurred.
4390 * Logged from:
4391 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
4392 */
4393message NfcBeamOccurred {
4394 enum Operation {
4395 UNKNOWN = 0;
4396 SEND = 1;
4397 RECEIVE = 2;
4398 }
4399 optional Operation operation = 1;
4400}
4401
4402/**
4403 * Logs when a NFC Card Emulation Transaction occurred.
4404 * Logged from:
4405 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
4406 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
4407 */
4408message NfcCardemulationOccurred {
4409 enum Category {
4410 UNKNOWN = 0;
4411 HCE_PAYMENT = 1;
4412 HCE_OTHER = 2;
4413 OFFHOST = 3;
4414 }
4415 // Transaction belongs to HCE payment or HCE other category, or offhost.
4416 optional Category category = 1;
4417 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
4418 optional string se_name = 2;
4419}
4420
4421/**
4422 * Logs when a NFC Tag event occurred.
4423 * Logged from:
4424 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
4425 */
4426message NfcTagOccurred {
4427 enum Type {
4428 UNKNOWN = 0;
4429 URL = 1;
4430 BT_PAIRING = 2;
4431 PROVISION = 3;
4432 WIFI_CONNECT = 4;
4433 APP_LAUNCH = 5;
4434 OTHERS = 6;
4435 }
4436 optional Type type = 1;
4437}
4438
4439/**
4440 * Logs when Hce transaction triggered
4441 * Logged from:
4442 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4443 */
4444message NfcHceTransactionOccurred {
4445 // The latency period(in microseconds) it took for the first HCE data
4446 // exchange.
4447 optional uint32 latency_micros = 1;
4448}
4449
4450/**
4451 * Logs when SecureElement state event changed
4452 * Logged from:
4453 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4454 */
4455message SeStateChanged {
4456 enum State {
4457 UNKNOWN = 0;
4458 INITIALIZED = 1;
4459 DISCONNECTED = 2;
4460 CONNECTED = 3;
4461 HALCRASH = 4;
4462 }
4463 optional State state = 1;
4464
4465 optional string state_change_reason = 2;
4466 // SIMx or eSEx.
4467 optional string terminal = 3;
4468}
4469
4470/**
4471 * Logs when Omapi API used
4472 * Logged from:
4473 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4474 */
4475message SeOmapiReported {
4476 enum Operation {
4477 UNKNOWN = 0;
4478 OPEN_CHANNEL = 1;
4479 }
4480 optional Operation operation = 1;
4481 // SIMx or eSEx.
4482 optional string terminal = 2;
4483
Jack Yu4bb90eb2019-01-23 15:13:41 +08004484 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08004485}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004486
4487/**
Alex Saloa060aee2019-01-21 14:36:41 -08004488 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
4489 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004490 * Logged from:
4491 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
4492 */
4493message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08004494 optional int64 dispatch_latency_millis = 1;
4495}
4496
4497/**
4498 * Logs AttentionManagerService attention check result.
4499 *
4500 * Logged from:
4501 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
4502 */
4503message AttentionManagerServiceResultReported {
4504 // See core/java/android/service/attention/AttentionService.java
4505 enum AttentionCheckResult {
4506 UNKNOWN = 20;
4507 ATTENTION_SUCCESS_ABSENT = 0;
4508 ATTENTION_SUCCESS_PRESENT = 1;
4509 ATTENTION_FAILURE_PREEMPTED = 2;
4510 ATTENTION_FAILURE_TIMED_OUT = 3;
4511 ATTENTION_FAILURE_UNKNOWN = 4;
4512 }
4513 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004514}
Michael Groover9e7b06e2018-12-28 19:55:51 -08004515
4516/**
4517 * Logs when an adb connection changes state.
4518 *
4519 * Logged from:
4520 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
4521 */
4522message AdbConnectionChanged {
4523 // The last time this system connected via adb, or 0 if the 'always allow' option was not
4524 // previously selected for this system.
4525 optional int64 last_connection_time_millis = 1;
4526
4527 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
4528 // to reconnect via adb without user interaction.
4529 optional int64 auth_window_millis = 2;
4530
4531 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
4532 optional android.debug.AdbConnectionStateEnum state = 3;
4533
4534 // True if the 'always allow' option was selected for this system.
4535 optional bool always_allow = 4;
4536}
Carter Hsub8fd1e92019-01-11 15:24:45 +08004537
4538/*
4539 * Logs the reported speech DSP status.
4540 *
4541 * Logged from:
4542 * Vendor audio implementation.
4543 */
4544message SpeechDspStatReported {
4545 // The total Speech DSP uptime in milliseconds.
4546 optional int32 total_uptime_millis = 1;
4547 // The total Speech DSP downtime in milliseconds.
4548 optional int32 total_downtime_millis = 2;
4549 optional int32 total_crash_count = 3;
4550 optional int32 total_recover_count = 4;
4551}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08004552
4553/**
4554 * Logs USB connector contaminant status.
4555 *
4556 * Logged from: USB Service.
4557 */
4558message UsbContaminantReported {
4559 optional string id = 1;
4560 optional android.service.usb.ContaminantPresenceStatus status = 2;
4561}
Olivier Gaillard18d452202019-01-22 15:03:41 +00004562
4563/**
4564 * This atom is for debugging purpose.
4565 */
4566message DebugElapsedClock {
4567 // Monotically increasing value for each pull.
4568 optional int64 pull_count = 1;
4569 // Time from System.elapsedRealtime.
4570 optional int64 elapsed_clock_millis = 2;
4571 // Time from System.elapsedRealtime.
4572 optional int64 same_elapsed_clock_millis = 3;
4573 // Diff between current elapsed time and elapsed time from previous pull.
4574 optional int64 elapsed_clock_diff_millis = 4;
4575
4576 enum Type {
4577 TYPE_UNKNOWN = 0;
4578 ALWAYS_PRESENT = 1;
4579 PRESENT_ON_ODD_PULLS = 2;
4580 }
4581 // Type of behavior for the pulled data.
4582 optional Type type = 5;
4583}
4584
4585/**
4586 * This atom is for debugging purpose.
4587 */
4588message DebugFailingElapsedClock {
4589 // Monotically increasing value for each pull.
4590 optional int64 pull_count = 1;
4591 // Time from System.elapsedRealtime.
4592 optional int64 elapsed_clock_millis = 2;
4593 // Time from System.elapsedRealtime.
4594 optional int64 same_elapsed_clock_millis = 3;
4595 // Diff between current elapsed time and elapsed time from previous pull.
4596 optional int64 elapsed_clock_diff_millis = 4;
4597}