blob: 1942b2e94f51fcac142b5238fa5740896278d18a [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";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080030import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080031import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080032import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080033import "frameworks/base/core/proto/android/server/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080034import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070035import "frameworks/base/core/proto/android/service/procstats_enum.proto";
36import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080037import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070038import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080039import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080040import "frameworks/base/core/proto/android/telephony/enums.proto";
41import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000042import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
43import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080044
Yao Chend54f9dd2017-10-17 17:37:48 +000045/**
Stefan Lafonae2df012017-11-14 09:17:21 -080046 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000047 * raw stats log events from the Android system, also known as "atoms."
48 *
49 * This field contains a single oneof with all of the available messages.
50 * The stats-log-api-gen tool runs as part of the Android build and
51 * generates the android.util.StatsLog class, which contains the constants
52 * and methods that Android uses to log.
53 *
Stefan Lafonae2df012017-11-14 09:17:21 -080054 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000055 * Instead, statsd on Android constructs these messages synthetically,
56 * in the format defined here and in stats_log.proto.
57 */
Stefan Lafonae2df012017-11-14 09:17:21 -080058message Atom {
59 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070060 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070061 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
62 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070063 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070064 BleScanResultReceived ble_scan_result_received = 4;
65 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080066 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070067 SyncStateChanged sync_state_changed = 7;
68 ScheduledJobStateChanged scheduled_job_state_changed = 8;
69 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070070 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080071 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
72 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
73 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070074 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
75 MemoryFactorStateChanged memory_factor_state_changed = 15;
76 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
77 CachedKillReported cached_kill_reported = 17;
78 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070079 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080080 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
81 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
82 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070083 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080084 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070085 CameraStateChanged camera_state_changed = 25;
86 FlashlightStateChanged flashlight_state_changed = 26;
87 UidProcessStateChanged uid_process_state_changed = 27;
88 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
89 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070090 BatteryLevelChanged battery_level_changed = 30;
91 ChargingStateChanged charging_state_changed = 31;
92 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070093 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -080094 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -070095 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
96 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070097 WifiLockStateChanged wifi_lock_state_changed = 37;
98 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
99 WifiScanStateChanged wifi_scan_state_changed = 39;
100 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700101 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700102 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700103 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900104 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700105 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800106 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800107 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800108 AppStartOccurred app_start_occurred = 48;
109 AppStartCanceled app_start_canceled = 49;
110 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800111 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800112 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800113 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800114 LmkStateChanged lmk_state_changed = 54;
115 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800116 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800117 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800118 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800119 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800120 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800121 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800122 KeyguardStateChanged keyguard_state_changed = 62;
123 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
124 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800125 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800126 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800127 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
128 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800129 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700130 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800131 SpeakerImpedanceReported speaker_impedance_reported = 71;
132 HardwareFailed hardware_failed = 72;
133 PhysicalDropDetected physical_drop_detected = 73;
134 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800135 MobileConnectionStateChanged mobile_connection_state_changed = 75;
136 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700137 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800138 AppCrashOccurred app_crash_occurred = 78;
139 ANROccurred anr_occurred = 79;
140 WTFOccurred wtf_occurred = 80;
141 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700142 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700143 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700144 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700145 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700146 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700147 FingerprintAcquired fingerprint_acquired = 87;
148 FingerprintAuthenticated fingerprint_authenticated = 88;
149 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700150 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700151 BatteryHealthSnapshot battery_health_snapshot = 91;
152 SlowIo slow_io = 92;
153 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700154 PhoneServiceStateChanged phone_service_state_changed = 94;
155 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100156 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700157 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700158 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700159 // TODO: service state change is very noisy shortly after boot, as well
160 // as at other transitions - coming out of doze, device plugged in, etc.
161 // Consider removing this if it becomes a problem
162 ServiceStateChanged service_state_changed = 99;
163 ServiceLaunchReported service_launch_reported = 100;
Yangster-macb89807e2018-11-15 21:10:57 -0800164 PhenotypeFlagStateChanged phenotype_flag_state_changed = 101;
165 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000166 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800167 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
168 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
169 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
170 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
171 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
172 DocsUILaunchReported docs_ui_launch_reported = 109;
173 DocsUIRootVisitedReported docs_ui_root_visited = 110;
174 DocsUIStartupMsReported docs_ui_startup_ms = 111;
175 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800176 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
177 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000178 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800179 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800180 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
181 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
182 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
183 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800184 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000185 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000186 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800187 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800188 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800189 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
190 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000191 AppDowngraded app_downgraded = 128;
192 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
193 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800194 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
195 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800196 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800197 NfcErrorOccurred nfc_error_occurred = 134;
198 NfcStateChanged nfc_state_changed = 135;
199 NfcBeamOccurred nfc_beam_occurred = 136;
200 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
201 NfcTagOccurred nfc_tag_occurred = 138;
202 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
203 SeStateChanged se_state_changed = 140;
204 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800205 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800206 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Yao Chend54f9dd2017-10-17 17:37:48 +0000207 }
David Chenc8a43242017-10-17 16:23:28 -0700208
David Chen6e3e6cb2018-01-03 16:14:06 -0800209 // Pulled events will start at field 10000.
Rafal Slawik3bea8952018-11-15 12:39:33 +0000210 // Next: 10043
David Chenc8a43242017-10-17 16:23:28 -0700211 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800212 WifiBytesTransfer wifi_bytes_transfer = 10000;
213 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
214 MobileBytesTransfer mobile_bytes_transfer = 10002;
215 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800216 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800217 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800218 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800219 CpuTimePerFreq cpu_time_per_freq = 10008;
220 CpuTimePerUid cpu_time_per_uid = 10009;
221 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800222 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800223 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800224 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800225 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800226 SystemElapsedRealtime system_elapsed_realtime = 10014;
227 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800228 CpuActiveTime cpu_active_time = 10016;
229 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000230 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800231 RemainingBatteryCapacity remaining_battery_capacity = 10019;
232 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800233 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100234 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100235 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100236 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000237 DiskStats disk_stats = 10025;
238 DirectoryUsage directory_usage = 10026;
239 AppSize app_size = 10027;
240 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700241 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700242 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700243 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700244 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700245 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800246 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700247 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100248 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100249 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700250 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800251 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
252 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
253 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000254 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800255 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800256 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800257 BatteryCycleCount battery_cycle_count = 10045;
David Chenc8a43242017-10-17 16:23:28 -0700258 }
yroa1fe77c2018-02-26 14:22:54 -0800259
Bookatz76aafcf2018-09-17 16:17:10 -0700260 // DO NOT USE field numbers above 100,000 in AOSP.
261 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
262 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700263}
264
Yao Chend54f9dd2017-10-17 17:37:48 +0000265/**
Yangster-mac20877162017-12-22 17:19:39 -0800266 * This proto represents a node of an attribution chain.
267 * Note: All attribution chains are represented as a repeated field of type
268 * AttributionNode. It is understood that in such arrays, the order is that
269 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000270 */
Yangster-mac20877162017-12-22 17:19:39 -0800271message AttributionNode {
272 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800273 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800274
Yangster-mac20877162017-12-22 17:19:39 -0800275 // The (optional) string tag for an element in the attribution chain. If the
276 // element has no tag, it is encoded as an empty string.
277 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700278}
279
Yangster-mac48b3d622018-08-18 12:38:11 -0700280message KeyValuePair {
281 optional int32 key = 1;
282 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700283 int32 value_int = 2;
284 int64 value_long = 3;
285 string value_str = 4;
286 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700287 }
288}
289
290message KeyValuePairsAtom {
291 optional int32 uid = 1;
292 repeated KeyValuePair pairs = 2;
293}
294
Yao Chend54f9dd2017-10-17 17:37:48 +0000295/*
296 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800297 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000298 *
299 * RULES:
300 * - The field ids for each atom must start at 1, and count upwards by 1.
301 * Skipping field ids is not allowed.
302 * - These form an API, so renaming, renumbering or removing fields is
303 * not allowed between android releases. (This is not currently enforced,
304 * but there will be a tool to enforce this restriction).
305 * - The types must be built-in protocol buffer types, namely, no sub-messages
306 * are allowed (yet). The bytes type is also not allowed.
307 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800308 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000309 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800310 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000311 * - A field that is a uid should be a string field, tagged with the [xxx]
312 * annotation. The generated code on android will be represented by UIDs,
313 * and those UIDs will be translated in xxx to those strings.
314 *
315 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700316 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000317 * - If there is a UID, it goes first. Think in an object-oriented fashion.
318 * *****************************************************************************
319 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700320
Yao Chend54f9dd2017-10-17 17:37:48 +0000321/**
Yangster-mace16189a2018-08-26 12:20:16 -0700322 * Logs when the Thermal service HAL notifies the throttling start/stop events.
323 *
324 * Logged from:
325 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
326 */
327message ThermalThrottlingStateChanged {
328 optional android.os.TemperatureTypeEnum sensor_type = 1;
329
330 enum State {
331 UNKNOWN = 0;
332 START = 1;
333 STOP = 2;
334 }
335
336 optional State state = 2;
337
338 optional float temperature = 3;
339}
340
341/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000342 * Logs when the screen state changes.
343 *
344 * Logged from:
345 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
346 */
347message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800348 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700349 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700350}
Yao Chend54f9dd2017-10-17 17:37:48 +0000351
352/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700353 * Logs that the process state of the uid, as determined by ActivityManager
354 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000355 *
356 * Logged from:
357 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
358 */
Bookatzc1a050a2017-10-10 15:49:28 -0700359message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700360 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000361
Bookatzdb026a22018-01-10 19:01:56 -0800362 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700363 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000364}
365
366/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700367 * Logs process state change of a process, as per the activity manager.
368 *
369 * Logged from:
370 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
371 */
372message ProcessStateChanged {
373 optional int32 uid = 1;
374 optional string process_name = 2;
375 optional string package_name = 3;
376 // TODO: remove this when validation is done
377 optional int64 version = 5;
378 // The state, from frameworks/base/core/proto/android/app/enums.proto.
379 optional android.app.ProcessStateEnum state = 4;
380}
381
382/**
383 * Logs when ActivityManagerService sleep state is changed.
384 *
385 * Logged from:
386 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
387 */
388message ActivityManagerSleepStateChanged {
389 // TODO: import frameworks proto
390 enum State {
391 UNKNOWN = 0;
392 ASLEEP = 1;
393 AWAKE = 2;
394 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700395 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700396}
397
398/**
399 * Logs when system memory state changes.
400 *
401 * Logged from:
402 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
403 */
404message MemoryFactorStateChanged {
405 // TODO: import frameworks proto
406 enum State {
407 MEMORY_UNKNOWN = 0;
408 NORMAL = 1; // normal.
409 MODERATE = 2; // moderate memory pressure.
410 LOW = 3; // low memory.
411 CRITICAL = 4; // critical memory.
412
413 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700414 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700415}
416
417/**
418 * Logs when app is using too much cpu, according to ActivityManagerService.
419 *
420 * Logged from:
421 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
422 */
423message ExcessiveCpuUsageReported {
424 optional int32 uid = 1;
425 optional string process_name = 2;
426 optional string package_name = 3;
427 // package version. TODO: remove this when validation is done
428 optional int64 version = 4;
429}
430
431/**
432 * Logs when a cached process is killed, along with its pss.
433 *
434 * Logged from:
435 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
436 */
437message CachedKillReported {
438 optional int32 uid = 1;
439 optional string process_name = 2;
440 optional string package_name = 3;
441 // TODO: remove this when validation is done
442 optional int64 version = 5;
443 optional int64 pss = 4;
444}
445
446/**
447 * Logs when memory stats of a process is reported.
448 *
449 * Logged from:
450 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
451 */
452message ProcessMemoryStatReported {
453 optional int32 uid = 1;
454 optional string process_name = 2;
455 optional string package_name = 3;
456 //TODO: remove this when validation is done
457 optional int64 version = 9;
458 optional int64 pss = 4;
459 optional int64 uss = 5;
460 optional int64 rss = 6;
461 enum Type {
462 ADD_PSS_INTERNAL_SINGLE = 0;
463 ADD_PSS_INTERNAL_ALL_MEM = 1;
464 ADD_PSS_INTERNAL_ALL_POLL = 2;
465 ADD_PSS_EXTERNAL = 3;
466 ADD_PSS_EXTERNAL_SLOW = 4;
467 }
468 optional Type type = 7;
469 optional int64 duration = 8;
470}
471
472/**
Bookatzc1a050a2017-10-10 15:49:28 -0700473 * Logs that a process started, finished, crashed, or ANRed.
474 *
475 * Logged from:
476 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
477 */
478message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700479 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700480
David Chen0b5c90c2018-01-25 16:51:49 -0800481 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800482 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700483
Bookatzddccf0a2017-11-28 16:48:14 -0800484 // What lifecycle state the process changed to.
485 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800486 enum State {
487 FINISHED = 0;
488 STARTED = 1;
489 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800490 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800491 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700492}
493
Bookatzc1a050a2017-10-10 15:49:28 -0700494/**
495 * Logs when the ble scan state changes.
496 *
497 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700498 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700499 */
500message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800501 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700502
503 enum State {
504 OFF = 0;
505 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700506 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
507 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700508 }
509 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700510
Bookatze5ec0b42018-03-26 13:34:56 -0700511 // Does the scan have a filter.
512 optional bool is_filtered = 3;
513 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
514 optional bool is_first_match = 4;
515 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
516 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700517}
518
519/**
520 * Logs reporting of a ble scan finding results.
521 *
522 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700523 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700524 */
Bookatzae6738e2018-09-13 11:38:56 -0700525// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700526message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800527 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700528
529 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800530 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700531}
532
533/**
534 * Logs when a sensor state changes.
535 *
536 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700537 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700538 */
539message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800540 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700541
Bookatzc1a050a2017-10-10 15:49:28 -0700542 // The id (int) of the sensor.
543 optional int32 sensor_id = 2;
544
545 enum State {
546 OFF = 0;
547 ON = 1;
548 }
549 optional State state = 3;
550}
551
Bookatzc1a050a2017-10-10 15:49:28 -0700552/**
553 * Logs when GPS state changes.
554 *
555 * Logged from:
556 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
557 */
558message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800559 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700560
561 enum State {
562 OFF = 0;
563 ON = 1;
564 }
565 optional State state = 2;
566}
567
Bookatz48d362e2018-11-06 15:49:08 -0800568/**
569 * Logs when GPS signal quality.
570 *
571 * Logged from:
572 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
573 */
574message GpsSignalQualityChanged {
575 optional android.server.location.GpsSignalQualityEnum level = 1;
576}
577
Bookatzc1a050a2017-10-10 15:49:28 -0700578
579/**
580 * Logs when a sync manager sync state changes.
581 *
582 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700583 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700584 */
585message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800586 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700587
David Chen0b5c90c2018-01-25 16:51:49 -0800588 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800589 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700590
591 enum State {
592 OFF = 0;
593 ON = 1;
594 }
595 optional State state = 3;
596}
597
Yangster-mac96353002018-09-05 11:18:55 -0700598/*
599 * Deferred job stats.
600 *
601 * Logged from:
602 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
603*/
604message DeferredJobStatsReported {
605 repeated AttributionNode attribution_node = 1;
606
607 // Number of jobs deferred.
608 optional int32 num_jobs_deferred = 2;
609
610 // Time since the last job runs.
611 optional int64 time_since_last_job_millis = 3;
612}
613
Bookatzc1a050a2017-10-10 15:49:28 -0700614/**
615 * Logs when a job scheduler job state changes.
616 *
617 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700618 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700619 */
620message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800621 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700622
623 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800624 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700625
626 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800627 FINISHED = 0;
628 STARTED = 1;
629 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700630 }
631 optional State state = 3;
632
Tej Singh33a412b2018-03-16 18:43:59 -0700633 // The reason a job has stopped.
634 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700635 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700636 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700637}
638
639/**
640 * Logs when the audio state changes.
641 *
642 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700643 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700644 */
645message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800646 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700647
648 enum State {
649 OFF = 0;
650 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700651 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
652 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700653 }
654 optional State state = 2;
655}
656
657/**
658 * Logs when the video codec state changes.
659 *
660 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700661 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700662 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800663message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800664 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700665
666 enum State {
667 OFF = 0;
668 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700669 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
670 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700671 }
672 optional State state = 2;
673}
674
675/**
676 * Logs when the flashlight state changes.
677 *
678 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700679 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700680 */
681message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800682 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700683
684 enum State {
685 OFF = 0;
686 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700687 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
688 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700689 }
690 optional State state = 2;
691}
692
693/**
694 * Logs when the camera state changes.
695 *
696 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700697 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700698 */
699message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800700 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700701
702 enum State {
703 OFF = 0;
704 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700705 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
706 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700707 }
708 optional State state = 2;
709}
710
711/**
712 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000713 *
714 * Logged from:
715 * TODO
716 */
Bookatzd6746242017-10-24 18:39:35 -0700717message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800718 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000719
Bookatz1a1b0462018-01-12 11:47:03 -0800720 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
721 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700722 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700723
724 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
725 optional string tag = 3;
726
727 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800728 RELEASE = 0;
729 ACQUIRE = 1;
730 CHANGE_RELEASE = 2;
731 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700732 }
733 optional State state = 4;
734}
735
736/**
Bookatzc1a050a2017-10-10 15:49:28 -0700737 * Logs when a partial wakelock is considered 'long' (over 1 min).
738 *
739 * Logged from:
740 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
741 */
742message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800743 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700744
Yao Chend54f9dd2017-10-17 17:37:48 +0000745 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
746 optional string tag = 2;
747
Bookatzc1a050a2017-10-10 15:49:28 -0700748 // TODO: I have no idea what this is.
749 optional string history_tag = 3;
750
751 enum State {
752 OFF = 0;
753 ON = 1;
754 }
755 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000756}
757
Bookatzc1a050a2017-10-10 15:49:28 -0700758/**
Bookatza66083f2018-09-20 17:24:00 -0700759 * Logs when the device is interactive, according to the PowerManager Notifier.
760 *
761 * Logged from:
762 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
763 */
764message InteractiveStateChanged {
765 enum State {
766 OFF = 0;
767 ON = 1;
768 }
769 optional State state = 1;
770}
771
772/**
Bookatzc1a050a2017-10-10 15:49:28 -0700773 * Logs Battery Saver state change.
774 *
775 * Logged from:
776 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
777 */
778message BatterySaverModeStateChanged {
779 enum State {
780 OFF = 0;
781 ON = 1;
782 }
783 optional State state = 1;
784}
785
786/**
787 * Logs Doze mode state change.
788 *
789 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800790 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700791 */
792message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800793 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800794}
795
796
797/**
798 * Logs state change of Doze mode including maintenance windows.
799 *
800 * Logged from:
801 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
802 */
803message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800804 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700805}
806
807/**
808 * Logs screen brightness level.
809 *
810 * Logged from:
811 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
812 */
813message ScreenBrightnessChanged {
814 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
815 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700816}
817
818/**
819 * Logs battery level (percent full, from 0 to 100).
820 *
821 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700822 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700823 */
824message BatteryLevelChanged {
825 // Battery level. Should be in [0, 100].
826 optional int32 battery_level = 1;
827}
828
829/**
830 * Logs change in charging status of the device.
831 *
832 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700833 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700834 */
835message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800836 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
837 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700838}
839
840/**
841 * Logs whether the device is plugged in, and what power source it is using.
842 *
843 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700844 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700845 */
846message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800847 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
848 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700849}
850
Bookatz8c6571b2017-10-24 15:04:41 -0700851/**
852 * Logs when an app's wakeup alarm fires.
853 *
854 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700855 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700856 */
857message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800858 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800859
860 // Name of the wakeup alarm.
861 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700862
863 // Name of source package (for historical reasons, since BatteryStats tracked it).
864 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800865}
866
867/**
868 * Logs when an an app causes the mobile radio to change state.
869 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
870 *
871 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700872 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800873 */
874message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800875 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800876
Bookatz1a1b0462018-01-12 11:47:03 -0800877 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
878 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800879}
880
881/**
882 * Logs when an an app causes the wifi radio to change state.
883 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
884 *
885 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700886 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800887 */
888message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800889 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800890
Bookatz1a1b0462018-01-12 11:47:03 -0800891 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
892 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700893}
894
895/**
896 * Logs kernel wakeup reasons and aborts.
897 *
898 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700899 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700900 */
901message KernelWakeupReported {
902 // Name of the kernel wakeup reason (or abort).
903 optional string wakeup_reason_name = 1;
904
905 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800906 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700907}
908
909/**
Bookatzda1798c2018-12-13 14:16:00 -0800910 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800911 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800912 *
913 * Logged from:
914 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
915 */
916message WifiEnabledStateChanged {
917 enum State {
918 OFF = 0;
919 ON = 1;
920 }
921 optional State state = 1;
922}
923
924/**
925 * 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 -0800926 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
927 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800928 *
929 * Logged from:
930 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
931 */
932message WifiRunningStateChanged {
933 repeated AttributionNode attribution_node = 1;
934
935 enum State {
936 OFF = 0;
937 ON = 1;
938 }
939 optional State state = 2;
940}
941
942/**
Bookatze5885242017-10-24 20:10:31 -0700943 * Logs wifi locks held by an app.
944 *
945 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700946 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700947 */
948message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800949 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700950
951 enum State {
952 OFF = 0;
953 ON = 1;
954 }
955 optional State state = 2;
956}
957
958/**
959 * Logs wifi signal strength changes.
960 *
961 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800962 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700963 */
964message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800965 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
966 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700967}
968
969/**
970 * Logs wifi scans performed by an app.
971 *
972 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800973 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700974 */
975message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800976 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700977
978 enum State {
979 OFF = 0;
980 ON = 1;
981 }
982 optional State state = 2;
983}
984
985/**
Tej Singh4503e102018-01-04 14:35:01 -0800986 * Logs wifi multicast locks held by an app
987 *
988 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800989 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -0800990 */
991message WifiMulticastLockStateChanged {
992 repeated AttributionNode attribution_node = 1;
993
994 enum State {
995 OFF = 0;
996 ON = 1;
997 }
998 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -0800999
1000 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001001}
1002
1003/**
Tej Singh1ea42892018-01-19 09:27:00 -08001004 * Logs shutdown reason and duration on next boot.
1005 *
1006 * Logged from:
1007 * frameworks/base/core/java/com/android/server/BootReceiver.java
1008 */
1009message ShutdownSequenceReported {
1010 // True if shutdown is for a reboot. Default: false if we do not know.
1011 optional bool reboot = 1;
1012
1013 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1014 optional string reason = 2;
1015
1016 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1017 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001018 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001019
1020 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001021 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001022}
1023
Tej Singh6483ea42018-01-25 17:45:49 -08001024
1025/**
1026 * Logs boot reason and duration.
1027 *
1028 * Logged from:
1029 * system/core/bootstat/bootstat.cpp
1030 */
1031message BootSequenceReported {
1032 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1033 // Default: "<EMPTY>" if not available.
1034 optional string bootloader_reason = 1;
1035
1036 // Reason for system boot. Eg. bootloader, reboot,userrequested
1037 // Default: "<EMPTY>" if not available.
1038 optional string system_reason = 2;
1039
1040 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001041 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001042
1043 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001044 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001045
1046 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001047 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001048
1049 // Time since last boot in ms. Default: 0 if not available.
1050 optional int64 time_since_last_boot = 6;
1051}
1052
Tej Singhc477d9c2018-02-05 18:31:39 -08001053
1054/**
1055 * Logs call state and disconnect cause (if applicable).
1056 *
1057 * Logged from:
1058 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1059 */
1060message CallStateChanged {
1061 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1062 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1063 optional android.telecom.CallStateEnum call_state = 1;
1064
1065 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1066 // This value is only applicable when the call_state is DISCONNECTED, and
1067 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1068 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1069 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1070
1071 // True if the call is self-managed, which are apps that use the
1072 // telecom infrastructure to make their own calls.
1073 optional bool self_managed = 3;
1074
1075 // True if call is external. External calls are calls on connected Wear
1076 // devices but show up in Telecom so the user can pull them onto the device.
1077 optional bool external_call = 4;
1078}
1079
Tej Singh1ea42892018-01-19 09:27:00 -08001080/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001081 * Logs keyguard state. The keyguard is the lock screen.
1082 *
1083 * Logged from:
1084 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1085 */
1086message KeyguardStateChanged {
1087 enum State {
1088 UNKNOWN = 0;
1089 // The keyguard is hidden when the phone is unlocked.
1090 HIDDEN = 1;
1091 // The keyguard is shown when the phone is locked (screen turns off).
1092 SHOWN= 2;
1093 // The keyguard is occluded when something is overlaying the keyguard.
1094 // Eg. Opening the camera while on the lock screen.
1095 OCCLUDED = 3;
1096 }
1097 optional State state = 1;
1098}
1099
1100/**
1101 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1102 * prompts the user to enter a password (pattern, pin, etc).
1103 *
1104 * Logged from:
1105 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1106 */
1107
1108message KeyguardBouncerStateChanged {
1109 enum State {
1110 UNKNOWN = 0;
1111 // Bouncer is hidden, either as a result of successfully entering the
1112 // password, screen timing out, or user going back to lock screen.
1113 HIDDEN = 1;
1114 // This is when the user is being prompted to enter the password.
1115 SHOWN = 2;
1116 }
1117 optional State state = 1;
1118}
1119
1120/**
1121 * Logs the result of entering a password into the keyguard bouncer.
1122 *
1123 * Logged from:
1124 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1125 */
1126message KeyguardBouncerPasswordEntered {
1127 enum BouncerResult {
1128 UNKNOWN = 0;
1129 // The password entered was incorrect.
1130 FAILURE = 1;
1131 // The password entered was correct.
1132 SUCCESS = 2;
1133 }
1134 optional BouncerResult result = 1;
1135}
1136
Tej Singha883b372018-02-15 11:30:01 -08001137/*
1138 * Logs changes to the configuration of the device. The configuration is defined
1139 * in frameworks/base/core/java/android/content/res/Configuration.java
1140 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1141 * Please go there to interpret the possible values each field can be.
1142 *
1143 * Logged from:
1144 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1145 */
1146message ResourceConfigurationChanged {
1147 // Bit mask of color capabilities of the screen.
1148 // Contains information about the color gamut and hdr mode of the screen.
1149 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001150 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001151
1152 // The target screen density being rendered to.
1153 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001154 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001155
1156 // Current user preference for the scaling factor for fonts,
1157 // relative to the base density scaling.
1158 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001159 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001160
1161 // Flag indicating whether the hard keyboard is hidden.
1162 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001163 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001164
1165 // The type of keyboard attached to the device.
1166 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1167 optional int32 keyboard = 5;
1168
1169 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1170 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001171 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001172
1173 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1174 // 0 if undefined.
1175 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1176 optional int32 mcc = 7;
1177
1178 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1179 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1180 // MNC_ZERO symbol defined in Configuration.java.
1181 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1182 optional int32 mnc = 8;
1183
1184 // The kind of navigation available on the device.
1185 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1186 optional int32 navigation = 9;
1187
1188 // Flag indicating whether the navigation is available.
1189 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001190 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001191
1192 // Overall orientation of the screen.
1193 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1194 optional int32 orientation = 11;
1195
1196 // The current height of the available screen space, in dp units.
1197 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001198 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001199
1200 // Bit mask of overall layout of the screen.
1201 // Contains information about screen size, whether the screen is wider/taller
1202 // than normal, whether the screen layout is right-tl-left or left-to-right,
1203 // and whether the screen has a rounded shape.
1204 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001205 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001206
1207 // Current width of the available screen space, in dp units.
1208 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001209 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001210
1211 // The smallest screen size an application will see in normal operation.
1212 // This is the smallest value of both screenWidthDp and screenHeightDp
1213 // in portrait and landscape.
1214 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001215 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001216
1217 // The type of touch screen attached to the device.
1218 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1219 optional int32 touchscreen = 16;
1220
1221 // Bit mask of the ui mode.
1222 // Contains information about the overall ui mode of the device.
1223 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1224 // Also contains information about whether the device is in night mode.
1225 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001226 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001227}
1228
Tej Singheee317b2018-03-07 19:28:05 -08001229
1230/**
1231 * Logs changes in the connection state of the mobile radio.
1232 *
1233 * Logged from:
1234 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1235 */
1236message MobileConnectionStateChanged {
1237 // States are from the state machine DataConnection.java.
1238 enum State {
1239 UNKNOWN = 0;
1240 // The connection is inactive, or disconnected.
1241 INACTIVE = 1;
1242 // The connection is being activated, or connecting.
1243 ACTIVATING = 2;
1244 // The connection is active, or connected.
1245 ACTIVE = 3;
1246 // The connection is disconnecting.
1247 DISCONNECTING = 4;
1248 // The connection is disconnecting after creating a connection.
1249 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1250 }
1251 optional State state = 1;
1252 // For multi-sim phones, this distinguishes between the sim cards.
1253 optional int32 sim_slot_index = 2;
1254 // Used to identify the connection. Starts at 0 and increments by 1 for
1255 // every new network created. Resets whenever the device reboots.
1256 optional int32 data_connection_id = 3;
1257 // A bitmask for the capabilities of this connection.
1258 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1259 // Default value (if we have no information): 0
1260 optional int64 capabilities = 4;
1261 // If this connection has internet.
1262 // This just checks if the DEFAULT bit of capabilities is set.
1263 optional bool has_internet = 5;
1264}
1265
1266/**
1267 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1268 *
1269 * Logged from:
1270 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1271 */
1272message MobileRadioTechnologyChanged {
1273 optional android.telephony.NetworkTypeEnum state = 1;
1274 // For multi-sim phones, this distinguishes between the sim cards.
1275 optional int32 sim_slot_index = 2;
1276}
1277
Andrew Chantb56388b2018-03-22 21:07:33 -07001278/**
1279 * Logs the VID and PID of any connected USB devices.
1280 *
1281 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1282 *
1283 * Logged by Vendor.
1284 */
1285message UsbDeviceAttached {
1286 optional int32 vid = 1;
1287 optional int32 pid = 2;
1288 optional bool has_audio = 3;
1289 optional bool has_hid = 4;
1290 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001291 enum State {
1292 STATE_DISCONNECTED = 0;
1293 STATE_CONNECTED = 1;
1294 }
1295 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001296 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001297}
1298
Tej Singheee317b2018-03-07 19:28:05 -08001299
Tej Singhdd7bd352018-02-09 19:33:15 -08001300/**
Tej Singh5d991e12018-03-09 19:48:11 -08001301 * Logs when Bluetooth is enabled and disabled.
1302 *
1303 * Logged from:
1304 * services/core/java/com/android/server/BluetoothManagerService.java
1305 */
1306message BluetoothEnabledStateChanged {
1307 repeated AttributionNode attribution_node = 1;
1308 // Whether or not bluetooth is enabled on the device.
1309 enum State {
1310 UNKNOWN = 0;
1311 ENABLED = 1;
1312 DISABLED = 2;
1313 }
1314 optional State state = 2;
1315 // The reason for being enabled/disabled.
1316 // Eg. Airplane mode, crash, application request.
1317 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1318 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001319 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001320}
1321
1322/**
Jack Hed9837c82019-01-09 01:19:13 -08001323 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001324 *
1325 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001326 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1327 *
1328 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001329 */
1330message BluetoothConnectionStateChanged {
1331 // The state of the connection.
1332 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1333 optional android.bluetooth.ConnectionStateEnum state = 1;
1334 // An identifier that can be used to match connect and disconnect events.
1335 // Currently is last two bytes of a hash of a device level ID and
1336 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001337 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1338 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001339 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1340 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001341 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001342 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001343 // An identifier that can be used to match events for this device.
1344 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1345 // Salt: Randomly generated 256 bit value
1346 // Hash algorithm: HMAC-SHA256
1347 // Size: 32 byte
1348 // Default: null or empty if the device identifier is not known
1349 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1350}
1351
1352/**
1353 * Logs when a Bluetooth device connects and disconnects over ACL
1354 *
1355 * Logged from:
1356 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1357 *
1358 * Next Tag: 3
1359 */
1360message BluetoothAclConnectionStateChanged {
1361 // An identifier that can be used to match events for this device.
1362 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1363 // Salt: Randomly generated 256 bit value
1364 // Hash algorithm: HMAC-SHA256
1365 // Size: 32 byte
1366 // Default: null or empty if the device identifier is not known
1367 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1368 // The state of the connection.
1369 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1370 optional android.bluetooth.ConnectionStateEnum state = 2;
1371}
1372
1373/**
1374 * Logs when a Bluetooth device connects and disconnects over SCO
1375 *
1376 * Logged from:
1377 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1378 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1379 *
1380 * Next Tag: 4
1381 */
1382message BluetoothScoConnectionStateChanged {
1383 // An identifier that can be used to match events for this device.
1384 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1385 // Salt: Randomly generated 256 bit value
1386 // Hash algorithm: HMAC-SHA256
1387 // Size: 32 byte
1388 // Default: null or empty if the device identifier is not known
1389 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1390 // The state of the connection.
1391 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1392 optional android.bluetooth.ConnectionStateEnum state = 2;
1393 // Codec used for this SCO connection
1394 // Default: UNKNOWN
1395 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001396}
1397
Jack Heab86dbd22018-12-18 15:43:27 -08001398// Logs when there is an event affecting Bluetooth device's link layer connection.
1399// - This event is triggered when there is a related HCI command or event
1400// - Users of this metrics can deduce Bluetooth device's connection state from these events
1401// - HCI commands are logged before the command is sent, after receiving command status, and after
1402// receiving command complete
1403// - HCI events are logged when they arrive
1404//
1405// Low level log from system/bt
1406//
1407// Bluetooth classic commands:
1408// - CMD_CREATE_CONNECTION
1409// - CMD_DISCONNECT
1410// - CMD_CREATE_CONNECTION_CANCEL
1411// - CMD_ACCEPT_CONNECTION_REQUEST
1412// - CMD_REJECT_CONNECTION_REQUEST
1413// - CMD_SETUP_ESCO_CONNECTION
1414// - CMD_ACCEPT_ESCO_CONNECTION
1415// - CMD_REJECT_ESCO_CONNECTION
1416// - CMD_ENH_SETUP_ESCO_CONNECTION
1417// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1418//
1419// Bluetooth low energy commands:
1420// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1421// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1422// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1423// - CMD_BLE_CLEAR_WHITE_LIST
1424// - CMD_BLE_ADD_WHITE_LIST
1425// - CMD_BLE_REMOVE_WHITE_LIST
1426//
1427// Bluetooth classic events:
1428// - EVT_CONNECTION_COMP
1429// - EVT_CONNECTION_REQUEST
1430// - EVT_DISCONNECTION_COMP
1431// - EVT_ESCO_CONNECTION_COMP
1432// - EVT_ESCO_CONNECTION_CHANGED
1433//
1434// Bluetooth low energy meta events:
1435// - BLE_EVT_CONN_COMPLETE_EVT
1436// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1437//
1438// Next tag: 10
1439message BluetoothLinkLayerConnectionEvent {
1440 // An identifier that can be used to match events for this device.
1441 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1442 // Salt: Randomly generated 256 bit value
1443 // Hash algorithm: HMAC-SHA256
1444 // Size: 32 byte
1445 // Default: null or empty if the device identifier is not known
1446 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1447 // Connection handle of this connection if available
1448 // Range: 0x0000 - 0x0EFF (12 bits)
1449 // Default: 0xFFFF if the handle is unknown
1450 optional int32 connection_handle = 2;
1451 // Direction of the link
1452 // Default: DIRECTION_UNKNOWN
1453 optional android.bluetooth.DirectionEnum direction = 3;
1454 // Type of this link
1455 // Default: LINK_TYPE_UNKNOWN
1456 optional android.bluetooth.LinkTypeEnum type = 4;
1457
1458 // Reason metadata for this link layer connection event, rules for interpretation:
1459 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1460 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1461 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1462 // set and valid, ignore hci_ble_event
1463
1464 // HCI command associated with this event
1465 // Default: CMD_UNKNOWN
1466 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1467 // HCI event associated with this event
1468 // Default: EVT_UNKNOWN
1469 optional android.bluetooth.hci.EventEnum hci_event = 6;
1470 // HCI BLE meta event associated with this event
1471 // Default: BLE_EVT_UNKNOWN
1472 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1473 // HCI command status code if this is triggerred by hci_cmd
1474 // Default: STATUS_UNKNOWN
1475 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1476 // HCI reason code associated with this event
1477 // Default: STATUS_UNKNOWN
1478 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1479}
1480
1481
Tej Singh5d991e12018-03-09 19:48:11 -08001482/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001483 * Logs when something is plugged into or removed from the USB-C connector.
1484 *
1485 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001486 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001487 */
1488message UsbConnectorStateChanged {
1489 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001490 STATE_DISCONNECTED = 0;
1491 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001492 }
1493 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001494 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001495 // Last active session in ms.
1496 // 0 when the port is in connected state.
1497 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001498}
1499
1500/**
1501 * Logs the reported speaker impedance.
1502 *
1503 * Logged from:
1504 * Vendor audio implementation.
1505 */
1506message SpeakerImpedanceReported {
1507 optional int32 speaker_location = 1;
1508 optional int32 impedance = 2;
1509}
1510
1511/**
1512 * Logs the report of a failed hardware.
1513 *
1514 * Logged from:
1515 * Vendor HALs.
1516 *
1517 */
1518message HardwareFailed {
1519 enum HardwareType {
1520 HARDWARE_FAILED_UNKNOWN = 0;
1521 HARDWARE_FAILED_MICROPHONE = 1;
1522 HARDWARE_FAILED_CODEC = 2;
1523 HARDWARE_FAILED_SPEAKER = 3;
1524 HARDWARE_FAILED_FINGERPRINT = 4;
1525 }
1526 optional HardwareType hardware_type = 1;
1527
1528 /* hardware_location allows vendors to differentiate between multiple instances of
1529 * the same hardware_type. The specific locations are vendor defined integers,
1530 * referring to board-specific numbering schemes.
1531 */
1532 optional int32 hardware_location = 2;
1533
1534 /* failure_code is specific to the HardwareType of the failed hardware.
1535 * It should use the enum values defined below.
1536 */
1537 enum MicrophoneFailureCode {
1538 MICROPHONE_FAILURE_COMPLETE = 0;
1539 }
1540 enum CodecFailureCode {
1541 CODEC_FAILURE_COMPLETE = 0;
1542 }
1543 enum SpeakerFailureCode {
1544 SPEAKER_FAILURE_COMPLETE = 0;
1545 SPEAKER_FAILURE_HIGH_Z = 1;
1546 SPEAKER_FAILURE_SHORT = 2;
1547 }
1548 enum FingerprintFailureCode {
1549 FINGERPRINT_FAILURE_COMPLETE = 0;
1550 FINGERPRINT_SENSOR_BROKEN = 1;
1551 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1552 }
1553 optional int32 failure_code = 3;
1554}
1555
1556/**
1557 * Log an event when the device has been physically dropped.
1558 * Reported from the /vendor partition.
1559 */
1560message PhysicalDropDetected {
1561 // Confidence that the event was actually a drop, 0 -> 100
1562 optional int32 confidence_pctg = 1;
1563 // Peak acceleration of the drop, in 1/1000s of a g.
1564 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001565 // Duration of freefall in ms
1566 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001567}
1568
1569/**
1570 * Log bucketed battery charge cycles.
1571 *
1572 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001573 * a given charge point. For example, if 10 cycle buckets are
1574 * initialized, bucket 1 is the lowest 1/10th of the battery,
1575 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001576 *
1577 * Logged from:
1578 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1579 */
1580message ChargeCyclesReported {
1581 optional int32 cycle_bucket_1 = 1;
1582 optional int32 cycle_bucket_2 = 2;
1583 optional int32 cycle_bucket_3 = 3;
1584 optional int32 cycle_bucket_4 = 4;
1585 optional int32 cycle_bucket_5 = 5;
1586 optional int32 cycle_bucket_6 = 6;
1587 optional int32 cycle_bucket_7 = 7;
1588 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001589 optional int32 cycle_bucket_9 = 9;
1590 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001591}
1592
1593/**
Howard Roa46b6582018-09-18 16:45:02 -07001594 * Log battery health snapshot.
1595 *
1596 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1597 * are snapshotted periodically over 24hrs.
1598 */
1599message BatteryHealthSnapshot {
1600 enum BatterySnapshotType {
1601 UNKNOWN = 0;
1602 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1603 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1604 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1605 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1606 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1607 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1608 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1609 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1610 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1611 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1612 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1613 }
1614 optional BatterySnapshotType type = 1;
1615 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001616 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001617 // Voltage Battery Voltage, in microVolts.
1618 optional int32 voltage_micro_volt = 3;
1619 // Current Battery current, in microAmps.
1620 optional int32 current_micro_amps = 4;
1621 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1622 optional int32 open_circuit_micro_volt = 5;
1623 // Resistance Battery Resistance, in microOhms.
1624 optional int32 resistance_micro_ohm = 6;
1625 // Level Battery Level, as % of full.
1626 optional int32 level_percent = 7;
1627}
1628
1629/**
1630 * Log slow I/O operations on the primary storage.
1631 */
1632message SlowIo {
1633 // Classifications of IO Operations.
1634 enum IoOperation {
1635 UNKNOWN = 0;
1636 READ = 1;
1637 WRITE = 2;
1638 UNMAP = 3;
1639 SYNC = 4;
1640 }
1641 optional IoOperation operation = 1;
1642
1643 // The number of slow IO operations of this type over 24 hours.
1644 optional int32 count = 2;
1645}
1646
1647/**
1648 * Log battery caused shutdown with the last recorded voltage.
1649 */
1650message BatteryCausedShutdown {
1651 // The last recorded battery voltage prior to shutdown.
1652 optional int32 last_recorded_micro_volt = 1;
1653}
1654
1655/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001656 * Logs the duration of a davey (jank of >=700ms) when it occurs
1657 *
1658 * Logged from:
1659 * frameworks/base/libs/hwui/JankTracker.cpp
1660 */
1661message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001662 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001663 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001664
Tej Singhbb8554a2018-01-26 11:59:14 -08001665 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001666 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001667}
1668
1669/**
Bookatze5885242017-10-24 20:10:31 -07001670 * Logs phone signal strength changes.
1671 *
1672 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001673 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001674 */
1675message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001676 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1677 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001678}
1679
Yangster4ccebea2018-10-09 17:09:02 -07001680
1681/**
1682 * Logs when the phone state, sim state or signal strength changes
1683 *
1684 * Logged from:
1685 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1686 */
1687message PhoneServiceStateChanged {
1688 optional android.telephony.ServiceStateEnum state = 1;
1689 optional android.telephony.SimStateEnum sim_state = 2;
1690 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1691}
1692
1693/**
1694 * Logs when the phone becomes on or off.
1695 *
1696 * Logged from:
1697 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1698 */
1699message PhoneStateChanged {
1700 enum State {
1701 OFF = 0;
1702 ON = 1;
1703 }
1704 optional State state = 1;
1705}
1706
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001707message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001708 optional android.stats.launcher.LauncherAction action = 1;
1709 optional android.stats.launcher.LauncherState src_state = 2;
1710 optional android.stats.launcher.LauncherState dst_state = 3;
1711 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001712 optional bool is_swipe_up_enabled = 5;
1713}
1714
David Chenc28b2bb2017-10-24 12:52:52 -07001715/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001716 * Logs when Settings UI has changed.
1717 *
1718 * Logged from:
1719 * packages/apps/Settings
1720 */
1721message SettingsUIChanged {
1722 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001723 * Where this SettingsUIChange event comes from. For example, if
1724 * it's a PAGE_VISIBLE event, where the page is opened from.
1725 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001726 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001727
1728 /**
1729 * What the UI action is.
1730 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001731 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001732
1733 /**
1734 * Where the action is happening
1735 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001736 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001737
1738 /**
1739 * What preference changed in this event.
1740 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001741 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001742
1743 /**
1744 * The new value of the changed preference.
1745 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001746 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001747}
1748
1749/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08001750 * Logs basic timing information about touch events.
1751 * Reported at most every 5 minutes while device is being interacted with.
1752 *
1753 * Logged from:
1754 * frameworks/native/services/inputflinger
1755 */
1756message TouchEventReported {
1757 /**
1758 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
1759 * and the standard deviation of latency between the kernel and framework
1760 * for touchscreen events. The units are microseconds.
1761 *
1762 * The number is measured as the difference between the time at which
1763 * the input event was received in the evdev driver,
1764 * and the time at which the input event was received in EventHub.
1765 */
1766 // Minimum value
1767 optional float latency_min_micros = 1;
1768 // Maximum value
1769 optional float latency_max_micros = 2;
1770 // Average value
1771 optional float latency_mean_micros = 3;
1772 // Standard deviation
1773 optional float latency_stdev_micros = 4;
1774}
1775
1776/**
David Chenc28b2bb2017-10-24 12:52:52 -07001777 * Logs that a setting was updated.
1778 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001779 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001780 * The tag and is_default allow resetting of settings to default values based on the specified
1781 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1782 */
1783message SettingChanged {
1784 // The name of the setting.
1785 optional string setting = 1;
1786
1787 // The change being imposed on this setting. May represent a number, eg "3".
1788 optional string value = 2;
1789
1790 // The new value of this setting. For most settings, this is same as value. For some settings,
1791 // value is +X or -X where X represents an element in a set. For example, if the previous value
1792 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1793 // The +/- feature is currently only used for location_providers_allowed.
1794 optional string new_value = 3;
1795
1796 // The previous value of this setting.
1797 optional string prev_value = 4;
1798
1799 // The tag used with the is_default for resetting sets of settings. This is generally null.
1800 optional string tag = 5;
1801
Bookatz90867622018-01-31 15:05:57 -08001802 // True if this setting with tag should be resettable.
1803 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001804
David Chenbd789912018-03-16 17:19:55 -07001805 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001806 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001807
1808 enum ChangeReason {
1809 UPDATED = 1; // Updated can be an insertion or an update.
1810 DELETED = 2;
1811 }
1812 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001813}
Chenjie Yub3dda412017-10-24 13:41:59 -07001814
Chenjie Yu05013b32017-11-21 10:21:41 -08001815/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001816 * Logs activity going to foreground or background
1817 *
1818 * Logged from:
1819 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1820 */
1821message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001822 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001823 optional string pkg_name = 2;
1824 optional string class_name = 3;
1825
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001826 enum State {
1827 BACKGROUND = 0;
1828 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001829 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001830 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001831}
David Chenc8a43242017-10-17 16:23:28 -07001832
1833/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00001834 * Logs when a volume entered low Storage state.
1835 * Logged from:
1836 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
1837 */
1838message LowStorageStateChanged {
1839 // Volume that ran out of storage.
1840 optional string volume_description = 1;
1841
1842 enum State {
1843 UNKNOWN = 0;
1844 OFF = 1;
1845 ON = 2;
1846 }
1847 optional State state = 2;
1848}
1849
1850/**
1851 * Logs when an app is downgraded.
1852 * Logged from:
1853 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1854 */
1855message AppDowngraded {
1856 optional string package_name = 1;
1857 // Size of the package (all data) before being downgraded.
1858 optional int64 size_in_bytes_before = 2;
1859 // Size of the package (all data) after being downgraded.
1860 optional int64 size_in_bytes_after = 3;
1861
1862 optional bool aggressive = 4;
1863}
1864
1865/**
1866 * Logs when an app is optimized after being downgraded.
1867 * Logged from:
1868 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1869 */
1870message AppOptimizedAfterDowngraded {
1871 optional string package_name = 1;
1872}
1873
1874/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001875 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001876 * Logged from:
1877 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1878 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001879message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001880 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001881
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001882 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001883
1884 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001885 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001886 optional string process_name = 3;
1887
1888 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001889 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001890
1891 optional string package_name = 5;
1892
1893 enum InstantApp {
1894 UNAVAILABLE = 0;
1895 FALSE = 1;
1896 TRUE = 2;
1897 }
1898 optional InstantApp is_instant_app = 6;
1899
1900 enum ForegroundState {
1901 UNKNOWN = 0;
1902 BACKGROUND = 1;
1903 FOREGROUND = 2;
1904 }
1905 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001906
1907 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001908}
David Chen9e3808c2017-11-20 17:25:34 -08001909
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001910/**
1911 * Logs when a WTF (What a Terrible Failure) happened.
1912 * Logged from:
1913 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1914 */
1915message WTFOccurred {
1916 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001917
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001918 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001919
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001920 // The name of the process.
1921 // system_server if it is not by an app
1922 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001923
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001924 // The pid if available. -1 means not available.
1925 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001926
1927 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001928}
1929
1930/**
1931 * Logs when system server reports low memory.
1932 * Logged from:
1933 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1934 */
1935message LowMemReported {
1936}
1937
1938/**
1939 * Logs when an app ANR (App Not Responding) occurs.
1940 * Logged from:
1941 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1942 */
1943message ANROccurred {
1944 optional int32 uid = 1 [(is_uid) = true];
1945
1946 optional string process_name = 2;
1947
1948 optional string short_component_name = 3;
1949
1950 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001951
1952 enum InstantApp {
1953 UNAVAILABLE = 0;
1954 FALSE = 1;
1955 TRUE = 2;
1956 }
1957 optional InstantApp is_instant_app = 5;
1958
1959 enum ForegroundState {
1960 UNKNOWN = 0;
1961 BACKGROUND = 1;
1962 FOREGROUND = 2;
1963 }
1964 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001965
1966 optional android.server.ErrorSource error_source = 7;
1967
1968 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001969}
1970
Bookatza7020bd2018-08-28 16:29:35 -07001971/**
1972 * Logs when the vibrator state changes.
1973 * Logged from:
1974 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1975 */
1976message VibratorStateChanged {
1977 repeated AttributionNode attribution_node = 1;
1978
1979 enum State {
1980 OFF = 0;
1981 ON = 1;
1982 }
1983 optional State state = 2;
1984
1985 // Duration (in milliseconds) requested to keep the vibrator on.
1986 // Only applicable for State == ON.
1987 optional int64 duration_millis = 3;
1988}
1989
David Chen0a368b22017-12-06 16:28:16 -08001990/*
1991 * Allows other apps to push events into statsd.
1992 * Logged from:
1993 * frameworks/base/core/java/android/util/StatsLog.java
1994 */
David Chen0b5c90c2018-01-25 16:51:49 -08001995message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001996 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001997 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001998
1999 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2000 optional int32 label = 2;
2001
2002 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2003 // predicates for the metrics).
2004 enum State {
2005 UNKNOWN = 0;
2006 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2007 STOP = 2;
2008 START = 3;
2009 }
2010 optional State state = 3;
2011}
2012
David Chen9e3808c2017-11-20 17:25:34 -08002013/**
Bookatz7948c872018-09-04 12:58:33 -07002014 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2015 * For example, this could be due to the user manually changing the time.
2016 *
2017 * Logged from:
2018 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2019 */
2020message WallClockTimeShifted {
2021 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2022 optional int64 wall_clock_timestamp_millis = 1;
2023}
2024
2025/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002026 * Logs when statsd detects an anomaly.
2027 *
2028 * Logged from:
2029 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2030 */
2031message AnomalyDetected {
2032 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002033 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002034
Yangster-mac94e197c2018-01-02 16:03:03 -08002035 // Id of the config whose anomaly detection alert fired.
2036 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002037
Yangster-mac94e197c2018-01-02 16:03:03 -08002038 // Id of the alert (i.e. name of the anomaly that was detected).
2039 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002040}
2041
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002042message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002043 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002044 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002045
2046 // The app package name.
2047 optional string pkg_name = 2;
2048
2049 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002050 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002051 WARM = 1;
2052 HOT = 2;
2053 COLD = 3;
2054 }
2055 // The transition type.
2056 optional TransitionType type = 3;
2057
2058 // The activity name.
2059 optional string activity_name = 4;
2060
2061 // The name of the calling app. Empty if not set.
2062 optional string calling_pkg_name = 5;
2063
2064 // Whether the app is an instant app.
2065 optional bool is_instant_app = 6;
2066
2067 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002068 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002069
Bookatz80d11a02018-01-16 10:46:35 -08002070 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002071
David Chen0b5c90c2018-01-25 16:51:49 -08002072 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002073 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002074 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002075 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002076 optional int32 bind_application_delay_millis = 11;
2077 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002078
2079 // Empty if not set.
2080 optional string launch_token = 13;
2081
Calin Juravle759fbda2018-02-20 19:52:30 +00002082 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002083 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002084
2085 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002086 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002087}
2088
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002089message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002090 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002091 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002092
2093 // The app package name.
2094 optional string pkg_name = 2;
2095
2096 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002097 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002098 WARM = 1;
2099 HOT = 2;
2100 COLD = 3;
2101 }
2102 // The transition type.
2103 optional TransitionType type = 3;
2104
2105 // The activity name.
2106 optional string activity_name = 4;
2107}
2108
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002109message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002110 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002111 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002112
2113 // The app package name.
2114 optional string pkg_name = 2;
2115
2116 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002117 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002118 WITH_BUNDLE = 1;
2119 WITHOUT_BUNDLE = 2;
2120 }
2121 // The transition type.
2122 optional TransitionType type = 3;
2123
2124 // The activity name.
2125 optional string activity_name = 4;
2126
2127 optional bool transition_process_running = 5;
2128
2129 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002130 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002131}
2132
Bookatz8fcd09a2017-12-18 13:01:10 -08002133/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002134 * Logs a picture-in-picture action
2135 * Logged from:
2136 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2137 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2138 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2139 */
2140message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002141 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002142 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002143
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002144 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002145
Chenjie Yu52cacc62017-12-08 18:11:45 -08002146 enum State {
2147 ENTERED = 1;
2148 EXPANDED_TO_FULL_SCREEN = 2;
2149 MINIMIZED = 3;
2150 DISMISSED = 4;
2151 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002152 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002153}
2154
2155/**
Chenjie Yue8904192017-12-08 19:12:57 -08002156 * Logs overlay action
2157 * Logged from:
2158 * services/core/java/com/android/server/wm/Session.java
2159 */
2160message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002161 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002162
2163 optional string package_name = 2;
2164
2165 optional bool using_alert_window = 3;
2166
2167 enum State {
2168 ENTERED = 1;
2169 EXITED = 2;
2170 }
2171 optional State state = 4;
2172}
2173
Chenjie Yuccfe6452018-01-30 11:33:21 -08002174/*
2175 * Logs foreground service starts and stops.
2176 * Note that this is not when a service starts or stops, but when it is
2177 * considered foreground.
2178 * Logged from
2179 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2180 */
2181message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002182 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002183 // package_name + "/" + class_name
2184 optional string short_name = 2;
2185
2186 enum State {
2187 ENTER = 1;
2188 EXIT = 2;
2189 }
2190 optional State state = 3;
2191}
2192
Chenjie Yue8904192017-12-08 19:12:57 -08002193/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002194 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2195 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2196 * attributed back to the parent (host) uid. One example is Chrome.
2197 *
2198 * Logged from:
2199 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2200 */
2201message IsolatedUidChanged {
2202 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002203 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002204 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002205 optional int32 parent_uid = 1;
2206
2207 optional int32 isolated_uid = 2;
2208
2209 // We expect an isolated uid to be removed before if it's used for another parent uid.
2210 enum Event {
2211 REMOVED = 0;
2212 CREATED = 1;
2213 }
2214 optional Event event = 3;
2215}
2216
2217/*
2218 * Logs the reception of an incoming network packet causing the main system to wake up for
2219 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2220 * and processed by WakeupController.cpp.
2221 */
2222message PacketWakeupOccurred {
2223 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2224 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002225 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002226 // The interface name on which the packet was received.
2227 optional string iface = 2;
2228 // The ethertype value of the packet.
2229 optional int32 ethertype = 3;
2230 // String representation of the destination MAC address of the packet.
2231 optional string destination_hardware_address = 4;
2232 // String representation of the source address of the packet if this was an IP packet.
2233 optional string source_ip = 5;
2234 // String representation of the destination address of the packet if this was an IP packet.
2235 optional string destination_ip = 6;
2236 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2237 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2238 // families.
2239 optional int32 ip_next_header = 7;
2240 // The source port if this was a TCP or UDP packet.
2241 optional int32 source_port = 8;
2242 // The destination port if this was a TCP or UDP packet.
2243 optional int32 destination_port = 9;
2244}
2245
2246/*
2247 * Logs the memory stats for an app on startup.
2248 * Logged from:
2249 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2250 */
2251message AppStartMemoryStateCaptured {
2252 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002253 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002254
2255 // The process name.
2256 optional string process_name = 2;
2257
2258 // The activity name.
2259 optional string activity_name = 3;
2260
2261 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002262 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002263
2264 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002265 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002266
2267 // RSS
2268 optional int64 rss_in_bytes = 6;
2269
2270 // CACHE
2271 optional int64 cache_in_bytes = 7;
2272
2273 // SWAP
2274 optional int64 swap_in_bytes = 8;
2275}
2276
2277/*
2278 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2279 * for LMK event.
2280 * Logged from:
2281 * system/core/lmkd/lmkd.c
2282 */
2283message LmkStateChanged {
2284 enum State {
2285 UNKNOWN = 0;
2286 START = 1;
2287 STOP = 2;
2288 }
2289 optional State state = 1;
2290}
2291
2292/*
2293 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2294 * Logged from:
2295 * system/core/lmkd/lmkd.c
2296 */
2297message LmkKillOccurred {
2298 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002299 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002300
2301 // The process name.
2302 optional string process_name = 2;
2303
2304 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002305 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002306
2307 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002308 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002309
2310 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002311 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002312
2313 // RSS
2314 optional int64 rss_in_bytes = 6;
2315
2316 // CACHE
2317 optional int64 cache_in_bytes = 7;
2318
2319 // SWAP
2320 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002321
2322 // The elapsed real time of start of the process.
2323 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002324}
2325
Rajeev Kumar51b54602018-03-01 12:18:26 -08002326/*
2327 * Logs when the ActivityManagerService detects that an app died.
2328 *
2329 * Logged from:
2330 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2331 */
2332message AppDied {
2333 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002334 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002335}
2336
Howard Ro21a039c2018-08-06 14:55:47 -07002337/**
2338 * An atom for generic metrics logging. Available from Android Q.
2339 */
2340message GenericAtom {
2341 // The uid of the application that sent this custom atom.
2342 optional int32 uid = 1 [(is_uid) = true];
2343
2344 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002345 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002346}
2347
Tej Singhd6d6d772018-09-05 17:41:25 -07002348/**
2349 * Logs when a fingerprint acquire event occurs.
2350 *
2351 * Logged from:
2352 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2353 */
2354message FingerprintAcquired {
2355 // The associated user. Eg: 0 for owners, 10+ for others.
2356 // Defined in android/os/UserHandle.java
2357 optional int32 user = 1;
2358 // If this acquire is for a crypto fingerprint.
2359 // e.g. Secure purchases, unlock password storage.
2360 optional bool is_crypto = 2;
2361}
2362
2363/**
2364 * Logs when a fingerprint authentication event occurs.
2365 *
2366 * Logged from:
2367 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2368 */
2369message FingerprintAuthenticated {
2370 // The associated user. Eg: 0 for owners, 10+ for others.
2371 // Defined in android/os/UserHandle.java
2372 optional int32 user = 1;
2373 // If this authentication is for a crypto fingerprint.
2374 // e.g. Secure purchases, unlock password storage.
2375 optional bool is_crypto = 2;
2376 // Whether or not this authentication was successful.
2377 optional bool is_authenticated = 3;
2378}
2379
2380/**
2381 * Logs when a fingerprint error occurs.
2382 *
2383 * Logged from:
2384 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2385 */
2386message FingerprintErrorOccurred {
2387 // The associated user. Eg: 0 for owners, 10+ for others.
2388 // Defined in android/os/UserHandle.java
2389 optional int32 user = 1;
2390 // If this error is for a crypto fingerprint.
2391 // e.g. Secure purchases, unlock password storage.
2392 optional bool is_crypto = 2;
2393
2394 enum Error {
2395 UNKNOWN = 0;
2396 LOCKOUT = 1;
2397 PERMANENT_LOCKOUT = 2;
2398 }
2399 // The type of error.
2400 optional Error error = 3;
2401}
Howard Ro688ae182018-09-25 00:09:36 -07002402
2403message Notification {
2404
2405 // Type of notification event.
2406 enum Type {
2407 TYPE_UNKNOWN = 0;
2408 // Notification became visible to the user.
2409 TYPE_OPEN = 1;
2410 // Notification became hidden.
2411 TYPE_CLOSE = 2;
2412 // Notification switched to detail mode.
2413 TYPE_DETAIL = 3;
2414 // Notification was clicked.
2415 TYPE_ACTION = 4;
2416 // Notification was dismissed.
2417 TYPE_DISMISS = 5;
2418 // Notification switched to summary mode. The enum value of 14 is to
2419 // match that of metrics_constants.
2420 TYPE_COLLAPSE = 14;
2421 }
2422 optional Type type = 1;
2423
2424 // Package name associated with the notification.
2425 optional string package_name = 2;
2426
2427 // Tag associated with notification.
2428 optional string tag = 3;
2429
2430 // Application-supplied ID associated with the notification.
2431 optional int32 id = 4;
2432
2433 // Index of notification in the notification panel.
2434 optional int32 shade_index = 5;
2435
2436 // The number of notifications in the notification panel.
2437 optional int32 shade_count = 6;
2438
2439 // Importance for the notification.
2440 optional int32 importance = 7;
2441
2442 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002443 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002444
2445 // Importance for the notification channel.
2446 optional int32 channel_importance = 9;
2447
Howard Ro183c2bd2018-10-18 13:52:10 -07002448 // Application-supplied ID associated with the notifications group.
2449 optional string group_id = 10;
2450
Howard Ro688ae182018-09-25 00:09:36 -07002451 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002452 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002453
Howard Ro183c2bd2018-10-18 13:52:10 -07002454 // Reason for dismissal of a notification. This field is only meaningful for
2455 // TYPE_DISMISS events.
2456 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002457
Howard Ro183c2bd2018-10-18 13:52:10 -07002458 // The first post time of notification, stable across updates.
2459 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002460
Howard Ro183c2bd2018-10-18 13:52:10 -07002461 // The most recent interruption time, or the creation time if no updates.
2462 // Differs from update_millis because updates are filtered based on whether
2463 // they actually interrupted the user.
2464 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002465
Howard Ro183c2bd2018-10-18 13:52:10 -07002466 // The most recent update time, or the creation time if no updates.
2467 optional int64 update_millis = 15;
2468
2469 // The most recent visibility event.
2470 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002471}
2472
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002473/*
Yangster-macb89807e2018-11-15 21:10:57 -08002474 * Logs when a flag flip state changes.
2475 * Logged in P/h.
2476 */
2477message PhenotypeFlagStateChanged {
2478 // Mendel configuration name.
2479 optional string mendel_config_name = 1;
2480 // State
2481 enum State {
2482 STATE_UNKNOWN = 0;
2483 COMMITTED = 1;
2484 }
2485 optional State state = 2;
2486}
2487
2488/*
2489 * Logs when a binary push state changes.
2490 * Logged in Play store
2491 */
2492message BinaryPushStateChanged {
2493 // Binary package name.
2494 optional string binary_name = 1;
2495 // Version code.
2496 optional int64 version = 2;
2497 // State
2498 enum State {
2499 STATE_UNKNOWN = 0;
2500 DOWNLOAD_START = 1;
2501 DOWNLOAD_DONE = 2;
2502 INSTALL_START = 3;
2503 INSTALL_DONE = 4;
2504 REBOOT_START = 5;
2505 REBOOT_DONE = 6;
2506 }
2507 optional State state = 3;
2508}
2509
Maggie Whitefc1aa592018-11-28 21:55:23 -08002510/** Represents USB port overheat event. */
2511message UsbPortOverheatEvent {
2512 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
2513 optional int32 plug_temperature_deci_c = 1;
2514
2515 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
2516 optional int32 max_temperature_deci_c = 2;
2517
2518 /* Time between USB plug event and overheat threshold trip, in seconds. */
2519 optional int32 time_to_overheat_secs = 3;
2520
2521 /* Time between overheat threshold trip and hysteresis, in seconds. */
2522 optional int32 time_to_hysteresis_secs = 4;
2523
2524 /* Time between hysteresis and active mitigation ending, in seconds. */
2525 optional int32 time_to_inactive_secs = 5;
2526};
2527
Maggie White8735b852019-01-18 11:40:49 -08002528/**
2529 * Logs total effective full charge and discharge cycles on a battery.
2530 * Here are some examples of one effective cycle:
2531 * 1) the battery charges from 0% to 100% and drains back to 0%,
2532 * 2) charging from 50% to 100% and draining back to 50% twice.
2533 * Pulled from:
2534 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2535 */
2536message BatteryCycleCount {
2537 /* Number of total charge and discharge cycles on the system battery. */
2538 optional int32 cycle_count = 1;
2539}
2540
Yangster-macb89807e2018-11-15 21:10:57 -08002541/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002542 * Logs when a connection becomes available and lost.
2543 * Logged in StatsCompanionService.java
2544 */
2545message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002546 // Id of the network.
2547 optional int32 net_id = 1;
2548
2549 enum State {
2550 UNKNOWN = 0;
2551 CONNECTED = 1;
2552 DISCONNECTED = 2;
2553 }
2554 // Connected state of a network.
2555 optional State state = 2;
2556}
2557
2558/**
2559 * Logs when a service starts and stops.
2560 * Logged from:
2561 * services/core/java/com/android/server/am/ActiveServices.java
2562 */
2563message ServiceStateChanged {
2564
2565 optional int32 uid = 1 [(is_uid) = true];
2566
2567 optional string package_name = 2;
2568
2569 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002570
2571 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002572 START = 1;
2573 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002574 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002575
2576 optional State state = 4;
2577}
2578
2579/**
2580 * Logs when a service is launched.
2581 * Logged from:
2582 * services/core/java/com/android/server/am/ActiveServices.java
2583 */
2584message ServiceLaunchReported {
2585
2586 optional int32 uid = 1 [(is_uid) = true];
2587
2588 optional string package_name = 2;
2589
2590 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002591}
Howard Ro688ae182018-09-25 00:09:36 -07002592
Chenjie Yubbcbc602018-02-05 16:51:52 -08002593//////////////////////////////////////////////////////////////////////
2594// Pulled atoms below this line //
2595//////////////////////////////////////////////////////////////////////
2596
2597/**
David Chenc8a43242017-10-17 16:23:28 -07002598 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2599 *
2600 * Pulled from:
2601 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2602 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002603message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002604 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002605
2606 optional int64 rx_bytes = 2;
2607
2608 optional int64 rx_packets = 3;
2609
2610 optional int64 tx_bytes = 4;
2611
2612 optional int64 tx_packets = 5;
2613}
2614
2615/**
2616 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2617 *
2618 * Pulled from:
2619 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2620 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002621message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002622 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002623
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002624 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2625 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002626
2627 optional int64 rx_bytes = 3;
2628
2629 optional int64 rx_packets = 4;
2630
2631 optional int64 tx_bytes = 5;
2632
2633 optional int64 tx_packets = 6;
2634}
2635
2636/**
2637 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2638 *
2639 * Pulled from:
2640 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2641 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002642message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002643 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002644
2645 optional int64 rx_bytes = 2;
2646
2647 optional int64 rx_packets = 3;
2648
2649 optional int64 tx_bytes = 4;
2650
2651 optional int64 tx_packets = 5;
2652}
2653
2654/**
2655 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2656 *
2657 * Pulled from:
2658 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2659 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002660message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002661 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002662
Yao Chenc40a19d2018-03-15 16:48:25 -07002663 // 1 denotes foreground and 0 denotes background. This is called Set in
2664 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002665 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002666
2667 optional int64 rx_bytes = 3;
2668
2669 optional int64 rx_packets = 4;
2670
2671 optional int64 tx_bytes = 5;
2672
2673 optional int64 tx_packets = 6;
2674}
2675
2676/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002677 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2678 *
2679 * Pulled from:
2680 * StatsCompanionService
2681 */
2682message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002683 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002684
2685 optional int64 rx_bytes = 2;
2686
2687 optional int64 tx_bytes = 3;
2688}
2689
2690/**
David Chenc8a43242017-10-17 16:23:28 -07002691 * Pulls the kernel wakelock durations. This atom is adapted from
2692 * android/internal/os/KernelWakelockStats.java
2693 *
2694 * Pulled from:
2695 * StatsCompanionService using KernelWakelockReader.
2696 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002697message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002698 optional string name = 1;
2699
2700 optional int32 count = 2;
2701
2702 optional int32 version = 3;
2703
Yangster-maca8a30442018-10-13 23:46:34 -07002704 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002705}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002706
Chenjie Yu05013b32017-11-21 10:21:41 -08002707/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002708 * Pulls low power state information. If power.stats HAL is not available, this
2709 * includes platform and subsystem sleep state information,
2710 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2711 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002712 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002713 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002714 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2715 * as defined in:
2716 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002717 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002718message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002719 // Subsystem name
2720 optional string subsystem_name = 1;
2721 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2722 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002723 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2724 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002725 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002726 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002727 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002728 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002729 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002730}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002731
Chenjie Yu05013b32017-11-21 10:21:41 -08002732/**
Bookatz92da2832018-11-01 18:10:03 -07002733 * Pulls on-device power measurement information.
2734 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2735 * Pulled from:
2736 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2737 */
2738message OnDevicePowerMeasurement {
2739 // Name of the subsystem (to which the rail belongs).
2740 optional string subsystem_name = 1;
2741
2742 // Rail name. The rail lies within the subsystem.
2743 optional string rail_name = 2;
2744
2745 // Time (in ms since boot) at which the rail energy value was measured.
2746 // This may differ slightly from the time that statsd logs this information.
2747 optional uint64 measurement_timestamp_millis = 3;
2748
2749 // Accumulated energy used via the rail since device boot in uWs.
2750 optional uint64 energy_microwatt_secs = 4;
2751}
2752
2753/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002754 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002755 * Pulls the time the cpu spend on the frequency index. Frequency index
2756 * starts from highest to lowest. The value should be monotonically
2757 * increasing since boot. However, if there is a cpu
2758 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002759 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002760message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002761 optional uint32 cluster = 1;
2762 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002763 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002764}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002765
Chenjie Yu05013b32017-11-21 10:21:41 -08002766/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002767 * Pulls Cpu Time Per Uid.
2768 * Note that isolated process uid time should be attributed to host uids.
2769 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002770message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002771 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002772 optional uint64 user_time_micros = 2;
2773 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002774}
2775
2776/**
2777 * Pulls Cpu Time Per Uid per frequency.
2778 * Note that isolated process uid time should be attributed to host uids.
2779 * For each uid, we order the time by descending frequencies.
2780 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002781message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002782 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002783 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002784 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002785}
Hugo Benichi884970e2017-11-14 22:42:46 +09002786
Chenjie Yu05013b32017-11-21 10:21:41 -08002787/**
2788 * Pulls Wifi Controller Activity Energy Info
2789 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002790message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002791 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002792 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002793 // stack reported state
2794 // TODO: replace this with proto enum
2795 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002796 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002797 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002798 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002799 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002800 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002801 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002802 // product of current(mA), voltage(V) and time(ms)
2803 optional uint64 controller_energy_used = 6;
2804}
2805
2806/**
2807 * Pulls Modem Activity Energy Info
2808 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002809message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002810 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002811 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002812 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002813 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002814 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002815 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002816 /**
2817 * Tx power index
2818 * index 0 = tx_power < 0dBm
2819 * index 1 = 0dBm < tx_power < 5dBm
2820 * index 2 = 5dBm < tx_power < 15dBm
2821 * index 3 = 15dBm < tx_power < 20dBm
2822 * index 4 = tx_power > 20dBm
2823 */
2824 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002825 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002826 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002827 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002828 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002829 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002830 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002831 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002832 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002833 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002834 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002835 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002836 // product of current(mA), voltage(V) and time(ms)
2837 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002838}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002839
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002840/**
2841 * Pulls Bluetooth Activity Energy Info
2842 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2843 */
2844message BluetoothActivityInfo {
2845 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002846 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002847 // bluetooth stack state
2848 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002849 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002850 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002851 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002852 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002853 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002854 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002855 // product of current(mA), voltage(V) and time(ms)
2856 optional uint64 energy_used = 6;
2857}
2858
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002859/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002860 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002861 *
2862 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002863 */
2864message ProcessMemoryState {
2865 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002866 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002867
2868 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002869 // Usually package name, "system" for system server.
2870 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002871 optional string process_name = 2;
2872
Rafal Slawikda51b932018-12-13 16:31:33 +00002873 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002874 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002875
2876 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002877 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002878
2879 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002880 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002881
Rajeev Kumar90235992018-01-29 11:06:48 -08002882 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002883 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2884 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002885 optional int64 rss_in_bytes = 6;
2886
2887 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002888 // Value is read from memory.stat, field total_cache if per-app memory
2889 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002890 optional int64 cache_in_bytes = 7;
2891
2892 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002893 // Value is read from memory.stat, field total_swap if per-app memory
2894 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002895 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002896
Rafal Slawikd03ae422018-11-20 11:27:45 +00002897 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002898 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002899
2900 // Elapsed real time when the process started.
2901 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2902 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002903}
2904
2905/*
Rafal Slawik08621582018-10-15 14:53:07 +01002906 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002907 *
2908 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002909 */
2910message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002911 // The uid if available. -1 means not available.
2912 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002913
Rafal Slawikbf67d072018-10-23 11:07:54 +01002914 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002915 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002916 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002917
Rafal Slawikbf67d072018-10-23 11:07:54 +01002918 // # of page-faults
2919 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002920
Rafal Slawikbf67d072018-10-23 11:07:54 +01002921 // # of major page-faults
2922 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002923
Rafal Slawikbf67d072018-10-23 11:07:54 +01002924 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002925 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002926 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002927
Rafal Slawikd03ae422018-11-20 11:27:45 +00002928 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002929 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002930
2931 // Elapsed real time when the process started.
2932 // Value is read from /proc/PID/stat, field 22.
2933 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002934}
2935
2936/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002937 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002938 *
2939 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
2940 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00002941 *
2942 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002943 */
2944message ProcessMemoryHighWaterMark {
2945 // The uid if available. -1 means not available.
2946 optional int32 uid = 1 [(is_uid) = true];
2947
Rafal Slawikda51b932018-12-13 16:31:33 +00002948 // The process name.
2949 // Usually package name or process cmdline.
2950 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002951 optional string process_name = 2;
2952
2953 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2954 // /proc/PID/status.
2955 optional int64 rss_high_water_mark_in_bytes = 3;
2956}
2957
2958/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002959 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002960 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002961message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002962 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002963}
2964
2965/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002966 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002967 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002968message SystemUptime {
2969 // Milliseconds since the system was booted.
2970 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2971 // for external input).
2972 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002973 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002974}
2975
2976/*
2977 * Reads from /proc/uid_concurrent_active_time which has the format:
2978 * active: X (X is # cores)
2979 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2980 * [uid1]: [time-0] [time-1] [time-2] ... ...
2981 * ...
2982 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2983 * The file contains a monotonically increasing count of time for a single boot.
2984 */
2985message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002986 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002987 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002988}
2989
2990/**
2991 * Reads from /proc/uid_concurrent_policy_time which has the format:
2992 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2993 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2994 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2995 * ...
2996 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2997 * The file contains a monotonically increasing count of time for a single boot.
2998 */
2999message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003000 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003001 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003002 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003003}
3004
3005/*
3006 * Pulls free disk space, for data, system partition and temporary directory.
3007 */
3008message DiskSpace {
3009 // available bytes in data partition
3010 optional uint64 data_available_bytes = 1;
3011 // available bytes in system partition
3012 optional uint64 system_available_bytes = 2;
3013 // available bytes in download cache or temp directories
3014 optional uint64 temp_available_bytes = 3;
3015}
Tej Singhbf972d92018-01-10 20:51:13 -08003016
3017/**
3018 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003019 * Pulled from:
3020 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003021 */
3022message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003023 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003024}
3025
3026/**
3027 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003028 * Pulled from:
3029 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003030 */
3031message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003032 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003033}
3034
3035/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003036 * Pulls battery voltage.
3037 * Pulled from:
3038 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3039 */
3040message BatteryVoltage {
3041 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003042 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003043}
3044
3045/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003046 * Pulls battery level (percent full, from 0 to 100).
3047 *
3048 * Pulled from:
3049 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3050 */
3051message BatteryLevel {
3052 // Battery level. Should be in [0, 100].
3053 optional int32 battery_level = 1;
3054}
3055
3056/**
Tej Singhd89137e2018-03-26 14:51:40 -07003057 * Pulls the temperature of various parts of the device.
3058 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003059 *
3060 * Pulled from:
3061 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3062 */
3063message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003064 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003065 optional android.os.TemperatureTypeEnum sensor_location = 1;
3066
3067 // The name of the temperature source. Eg. CPU0
3068 optional string sensor_name = 2;
3069
Tej Singhd89137e2018-03-26 14:51:40 -07003070 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003071 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003072 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003073}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003074
3075/**
3076 * Pulls the statistics of calls to Binder.
3077 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003078 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3079 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003080 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003081 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003082 */
3083message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003084 // UID of the process responsible for the binder transaction. It will be set if the process
3085 // executing the binder transaction attribute the transaction to another uid using
3086 // Binder.setThreadWorkSource().
3087 //
3088 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003089 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003090 // UID of the process executing the binder transaction.
3091 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003092 // Fully qualified class name of the API call.
3093 //
3094 // This is a system server class name.
3095 //
3096 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3097 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3098 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3099 // commonly used APIs.
3100 optional string service_class_name = 2;
3101 // Method name of the API call. It can also be a transaction code if we cannot
3102 // resolve it to a name. See Binder#getTransactionName.
3103 //
3104 // This is a system server method name.
3105 optional string service_method_name = 3;
3106 // Total number of API calls.
3107 optional int64 call_count = 4;
3108 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3109 optional bool screen_interactive = 13;
3110 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3111 // call_count will be equal to recorded_call_count.
3112 //
3113 // If recorded_call_count is different than call_count, it means data collection has been
3114 // sampled. All the fields below will be sampled in this case.
3115 optional int64 recorded_call_count = 12;
3116 // Number of exceptions thrown by the API.
3117 optional int64 recorded_exception_count = 5;
3118 // Total latency of all API calls.
3119 // Average can be computed using total_latency_micros / recorded_call_count.
3120 optional int64 recorded_total_latency_micros = 6;
3121 // Maximum latency of one API call.
3122 optional int64 recorded_max_latency_micros = 7;
3123 // Total CPU usage of all API calls.
3124 // Average can be computed using total_cpu_micros / recorded_call_count.
3125 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3126 optional int64 recorded_total_cpu_micros = 8;
3127 // Maximum CPU usage of one API call.
3128 optional int64 recorded_max_cpu_micros = 9;
3129 // Maximum parcel reply size of one API call.
3130 optional int64 recorded_max_reply_size_bytes = 10;
3131 // Maximum parcel request size of one API call.
3132 optional int64 recorded_max_request_size_bytes = 11;
3133}
3134
3135/**
3136 * Pulls the statistics of exceptions during calls to Binder.
3137 *
3138 * Binder stats are cumulative from boot unless somebody reset the data using
3139 * > adb shell dumpsys binder_calls_stats --reset
3140 */
3141message BinderCallsExceptions {
3142 // Exception class name, e.g. java.lang.IllegalArgumentException.
3143 //
3144 // This is an exception class name thrown by the system server.
3145 optional string exception_class_name = 1;
3146 // Total number of exceptions.
3147 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003148}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003149
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003150/**
3151 * Pulls the statistics of message dispatching on HandlerThreads.
3152 *
3153 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3154 * config on the device.
3155 *
3156 * Next tag: 11
3157 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003158message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003159 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003160 optional int32 uid = 1 [(is_uid) = true];
3161
3162 // Fully qualified class name of the handler target class.
3163 //
3164 // This field does not contain PII. This is a system server class name.
3165 optional string handler_class_name = 2;
3166
3167 // The name of the thread that runs the Looper.
3168 //
3169 // This field does not contain PII. This is a system server thread name.
3170 optional string looper_thread_name = 3;
3171
3172 // The name of the dispatched message.
3173 //
3174 // This field does not contain PII. This is a system server constant or class
3175 // name.
3176 optional string message_name = 4;
3177
3178 // Total number of successfully dispatched messages.
3179 optional int64 message_count = 5;
3180
3181 // Total number of messages that failed dispatching.
3182 optional int64 exception_count = 6;
3183
3184 // Total number of processed messages we have data recorded for. If we
3185 // collected data for all the messages, message_count will be equal to
3186 // recorded_message_count.
3187 //
3188 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003189 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003190 optional int64 recorded_message_count = 7;
3191
3192 // Total latency of all processed messages.
3193 // Average can be computed using recorded_total_latency_micros /
3194 // recorded_message_count.
3195 optional int64 recorded_total_latency_micros = 8;
3196
3197 // Total CPU usage of all processed message.
3198 // Average can be computed using recorded_total_cpu_micros /
3199 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003200 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003201 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003202
3203 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3204 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003205
3206 // Max recorded CPU usage of all processed messages.
3207 optional int64 recorded_max_cpu_micros = 11;
3208
3209 // Max recorded latency of all processed messages.
3210 optional int64 recorded_max_latency_micros = 12;
3211
3212 // Total number of messages we tracked the dispatching delay for. If we
3213 // collected data for all the messages, message_count will be equal to
3214 // recorded_delay_message_count.
3215 //
3216 // If recorded_delay_message_count is different than message_count, it means data
3217 // collection has been sampled or/and not all messages specified the target dispatch time.
3218 // The fields below will be sampled in this case.
3219 optional int64 recorded_delay_message_count = 13;
3220
3221 // Total dispatching delay of all processed messages.
3222 // Calculated as a difference between the target dispatching time (Message.when)
3223 // and the actual dispatching time.
3224 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3225 optional int64 recorded_total_delay_millis = 14;
3226
3227 // Max dispatching delay of all processed messages.
3228 // Calculated as a difference between the target dispatching time (Message.when)
3229 // and the actual dispatching time.
3230 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003231}
Tej Singh86dc9db2018-09-06 00:39:57 +00003232
3233/**
3234 * Pulls disk information, such as write speed and latency.
3235 */
3236message DiskStats {
3237 // Time taken to open, write 512B to, and close a file.
3238 // -1 if error performing the check.
3239 optional int64 data_write_latency_millis = 1;
3240
3241 optional bool file_based_encryption = 2;
3242
3243 // Recent disk write speed in kB/s.
3244 // -1 if error querying storageed.
3245 // 0 if data is unavailable.
3246 optional int32 recent_disk_write_speed = 3;
3247}
3248
3249
3250/**
3251 * Free and total bytes of the Data, Cache, and System partition.
3252 */
3253message DirectoryUsage {
3254 enum Directory {
3255 UNKNOWN = 0;
3256 DATA = 1;
3257 CACHE = 2;
3258 SYSTEM = 3;
3259 }
3260 optional Directory directory = 1;
3261 optional int64 free_bytes = 2;
3262 optional int64 total_bytes = 3;
3263}
3264
3265
3266/**
3267 * Size of an application: apk size, data size, and cache size.
3268 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3269 * Information is only reported for apps with the primary user (user 0).
3270 * Sizes are aggregated by package name.
3271 */
3272message AppSize {
3273 // Including uids will involve modifying diskstats logic.
3274 optional string package_name = 1;
3275 // App size in bytes. -1 if unavailable.
3276 optional int64 app_size_bytes = 2;
3277 // App data size in bytes. -1 if unavailable.
3278 optional int64 app_data_size_bytes = 3;
3279 // App cache size in bytes. -1 if unavailable.
3280 optional int64 app_cache_size_bytes = 4;
3281 // Time that the cache file was produced.
3282 // Uses System.currentTimeMillis(), which is wall clock time.
3283 optional int64 cache_time_millis = 5;
3284}
3285
3286
3287/**
3288 * Size of a particular category. Eg: photos, videos.
3289 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3290 */
3291message CategorySize {
3292 enum Category {
3293 UNKNOWN = 0;
3294 APP_SIZE = 1;
3295 APP_DATA_SIZE = 2;
3296 APP_CACHE_SIZE = 3;
3297 PHOTOS = 4;
3298 VIDEOS = 5;
3299 AUDIO = 6;
3300 DOWNLOADS = 7;
3301 SYSTEM = 8;
3302 OTHER = 9;
3303 }
3304 optional Category category = 1;
3305 // Category size in bytes.
3306 optional int64 size_bytes = 2;
3307 // Time that the cache file was produced.
3308 // Uses System.currentTimeMillis(), which is wall clock time.
3309 optional int64 cache_time_millis = 3;
3310}
Tej Singhd6d6d772018-09-05 17:41:25 -07003311
3312/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003313 * Pulls per uid I/O stats. The stats are cumulative since boot.
3314 *
3315 * Read/write bytes are I/O events from a storage device
3316 * Read/write chars are data requested by read/write syscalls, and can be
3317 * satisfied by caching.
3318 *
3319 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3320 */
3321message DiskIo {
3322 optional int32 uid = 1 [(is_uid) = true];
3323 optional int64 fg_chars_read = 2;
3324 optional int64 fg_chars_write = 3;
3325 optional int64 fg_bytes_read = 4;
3326 optional int64 fg_bytes_write = 5;
3327 optional int64 bg_chars_read = 6;
3328 optional int64 bg_chars_write = 7;
3329 optional int64 bg_bytes_read = 8;
3330 optional int64 bg_bytes_write = 9;
3331 optional int64 fg_fsync = 10;
3332 optional int64 bg_fsync= 11;
3333}
3334
3335
3336/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003337 * Pulls the number of fingerprints for each user.
3338 *
3339 * Pulled from StatsCompanionService, which queries FingerprintManager.
3340 */
3341message NumFingerprints {
3342 // The associated user. Eg: 0 for owners, 10+ for others.
3343 // Defined in android/os/UserHandle.java
3344 optional int32 user = 1;
3345 // Number of fingerprints registered to that user.
3346 optional int32 num_fingerprints = 2;
3347}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003348
Yangsteraf9aee72018-10-12 09:26:16 -07003349message AggStats {
3350 optional int64 min = 1;
3351
3352 optional int64 average = 2;
3353
3354 optional int64 max = 3;
3355}
3356
3357message ProcessStatsStateProto {
3358 optional android.service.procstats.ScreenState screen_state = 1;
3359
3360 optional android.service.procstats.MemoryState memory_state = 2;
3361
3362 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3363 // and not frameworks/base/core/java/android/app/ActivityManager.java
3364 optional android.service.procstats.ProcessState process_state = 3;
3365
3366 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003367 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003368
3369 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003370 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003371
3372 // # of samples taken
3373 optional int32 sample_size = 5;
3374
3375 // PSS is memory reserved for this process
3376 optional AggStats pss = 6;
3377
3378 // USS is memory shared between processes, divided evenly for accounting
3379 optional AggStats uss = 7;
3380
3381 // RSS is memory resident for this process
3382 optional AggStats rss = 8;
3383}
3384
3385// Next Tag: 7
3386message ProcessStatsProto {
3387 // Name of process.
3388 optional string process = 1;
3389
3390 // Uid of the process.
3391 optional int32 uid = 2;
3392
3393 // Information about how often kills occurred
3394 message Kill {
3395 // Count of excessive CPU kills
3396 optional int32 cpu = 1;
3397
3398 // Count of kills when cached
3399 optional int32 cached = 2;
3400
3401 // PSS stats during cached kill
3402 optional AggStats cached_pss = 3;
3403 }
3404 optional Kill kill = 3;
3405
3406 // Time and memory spent in various states.
3407 repeated ProcessStatsStateProto states = 5;
3408
3409 // Total time process has been running... screen_state, memory_state, and process_state
3410 // will not be set.
3411 optional ProcessStatsStateProto total_running_state = 6;
3412}
3413
3414message PackageServiceOperationStatsProto {
3415 // Operate enum: Started, Foreground, Bound, Executing
3416 optional android.service.procstats.ServiceOperationState operation = 1;
3417
3418 // Number of times the service was in this operation.
3419 optional int32 count = 2;
3420
3421 // Information about a state the service can be in.
3422 message StateStats {
3423 // Screen state enum.
3424 optional android.service.procstats.ScreenState screen_state = 1;
3425 // Memory state enum.
3426 optional android.service.procstats.MemoryState memory_state = 2;
3427
3428 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003429 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003430 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003431 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003432 }
3433 repeated StateStats state_stats = 3;
3434}
3435
3436message PackageServiceStatsProto {
3437 // Name of service component.
3438 optional string service_name = 1;
3439
3440 // The operation stats.
3441 // The package_name, package_uid, package_version, service_name will not be set to save space.
3442 repeated PackageServiceOperationStatsProto operation_stats = 2;
3443}
3444
3445message PackageAssociationSourceProcessStatsProto {
3446 // Uid of the process.
3447 optional int32 process_uid = 1;
3448 // Process name.
3449 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08003450 // Package name.
3451 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07003452 // Total count of the times this association appeared.
3453 optional int32 total_count = 3;
3454
3455 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003456 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003457
3458 // Total count of the times this association became actively impacting its target process.
3459 optional int32 active_count = 5;
3460
3461 // Information on one source in this association.
3462 message StateStats {
3463 // Process state enum.
3464 optional android.service.procstats.ProcessState process_state = 1;
3465 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003466 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003467 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003468 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003469 }
3470 repeated StateStats active_state_stats = 6;
3471}
3472
3473message PackageAssociationProcessStatsProto {
3474 // Name of the target component.
3475 optional string component_name = 1;
3476 // Information on one source in this association.
3477 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3478}
3479
3480
3481message ProcessStatsPackageProto {
3482 // Name of package.
3483 optional string package = 1;
3484
3485 // Uid of the package.
3486 optional int32 uid = 2;
3487
3488 // Version of the package.
3489 optional int64 version = 3;
3490
3491 // Stats for each process running with the package loaded in to it.
3492 repeated ProcessStatsProto process_stats = 4;
3493
3494 // Stats for each of the package's services.
3495 repeated PackageServiceStatsProto service_stats = 5;
3496
3497 // Stats for each association with the package.
3498 repeated PackageAssociationProcessStatsProto association_stats = 6;
3499}
3500
3501message ProcessStatsSectionProto {
3502 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003503 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003504
3505 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003506 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003507
3508 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003509 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003510
3511 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003512 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003513
3514 // System runtime library. e.g. "libdvm.so", "libart.so".
3515 optional string runtime = 5;
3516
3517 // whether kernel reports swapped pss.
3518 optional bool has_swapped_pss = 6;
3519
3520 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3521 enum Status {
3522 STATUS_UNKNOWN = 0;
3523 STATUS_COMPLETE = 1;
3524 STATUS_PARTIAL = 2;
3525 STATUS_SHUTDOWN = 3;
3526 STATUS_SYSPROPS = 4;
3527 }
3528 repeated Status status = 7;
3529
Chenjie Yub2ecc792019-01-17 10:27:26 -08003530 // Number of pages available of various types and sizes, representation fragmentation.
3531 repeated ProcessStatsAvailablePagesProto available_pages = 10;
3532
Yangsteraf9aee72018-10-12 09:26:16 -07003533 // Stats for each process.
3534 repeated ProcessStatsProto process_stats = 8;
3535
3536 // Stats for each package.
3537 repeated ProcessStatsPackageProto package_stats = 9;
3538}
3539
Chenjie Yub2ecc792019-01-17 10:27:26 -08003540message ProcessStatsAvailablePagesProto {
3541 // Node these pages are in (as per /proc/pagetypeinfo)
3542 optional int32 node = 1;
3543
3544 // Zone these pages are in (as per /proc/pagetypeinfo)
3545 optional string zone = 2;
3546
3547 // Label for the type of these pages (as per /proc/pagetypeinfo)
3548 optional string label = 3;
3549
3550 // Distribution of number of pages available by order size. First entry in array is
3551 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
3552 repeated int32 pages_per_order = 4;
3553}
3554
Chenjie Yu12e5e672018-09-14 15:54:59 -07003555/**
3556 * Pulled from ProcessStatsService.java
3557 */
3558message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003559 optional ProcessStatsSectionProto proc_stats_section = 1;
3560}
3561
Chenjie Yuf910b7802019-01-11 16:08:20 -08003562/**
3563 * Pulled from ProcessStatsService.java
3564 */
3565message ProcStatsPkgProc {
3566 optional ProcessStatsSectionProto proc_stats_section = 1;
3567}
3568
Yangsteraf9aee72018-10-12 09:26:16 -07003569message PowerProfileProto {
3570 optional double cpu_suspend = 1;
3571
3572 optional double cpu_idle = 2;
3573
3574 optional double cpu_active = 3;
3575
3576 message CpuCluster {
3577 optional int32 id = 1;
3578 optional double cluster_power = 2;
3579 optional int32 cores = 3;
3580 repeated int64 speed = 4;
3581 repeated double core_power = 5;
3582 }
3583
3584 repeated CpuCluster cpu_cluster = 40;
3585
3586 optional double wifi_scan = 4;
3587
3588 optional double wifi_on = 5;
3589
3590 optional double wifi_active = 6;
3591
3592 optional double wifi_controller_idle = 7;
3593
3594 optional double wifi_controller_rx = 8;
3595
3596 optional double wifi_controller_tx = 9;
3597
3598 repeated double wifi_controller_tx_levels = 10;
3599
3600 optional double wifi_controller_operating_voltage = 11;
3601
3602 optional double bluetooth_controller_idle = 12;
3603
3604 optional double bluetooth_controller_rx = 13;
3605
3606 optional double bluetooth_controller_tx = 14;
3607
3608 optional double bluetooth_controller_operating_voltage = 15;
3609
3610 optional double modem_controller_sleep = 16;
3611
3612 optional double modem_controller_idle = 17;
3613
3614 optional double modem_controller_rx = 18;
3615
3616 repeated double modem_controller_tx = 19;
3617
3618 optional double modem_controller_operating_voltage = 20;
3619
3620 optional double gps_on = 21;
3621
3622 repeated double gps_signal_quality_based = 22;
3623
3624 optional double gps_operating_voltage = 23;
3625
3626 optional double bluetooth_on = 24;
3627
3628 optional double bluetooth_active = 25;
3629
3630 optional double bluetooth_at_cmd = 26;
3631
3632 optional double ambient_display = 27;
3633
3634 optional double screen_on = 28;
3635
3636 optional double radio_on = 29;
3637
3638 optional double radio_scanning = 30;
3639
3640 optional double radio_active = 31;
3641
3642 optional double screen_full = 32;
3643
3644 optional double audio = 33;
3645
3646 optional double video = 34;
3647
3648 optional double flashlight = 35;
3649
3650 optional double memory = 36;
3651
3652 optional double camera = 37;
3653
3654 optional double wifi_batched_scan = 38;
3655
3656 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003657}
Chenjie Yuab530202018-09-26 12:39:20 -07003658
3659/**
3660 * power_profile.xml and other constants for power model calculations.
3661 * Pulled from PowerProfile.java
3662 */
3663message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003664 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003665}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003666
3667/**
arangelovd5db50e2018-10-12 20:24:39 +01003668 * Logs when a user restriction was added or removed.
3669 *
3670 * Logged from:
3671 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3672 */
3673message UserRestrictionChanged {
3674 // The raw string of the user restriction as defined in UserManager.
3675 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3676 optional string restriction = 1;
3677 // Whether the restriction is enabled or disabled.
3678 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003679}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003680
3681/**
3682 * Pulls process user time and system time. Puller takes a snapshot of all pids
3683 * in the system and returns cpu stats for those that are working at the time.
3684 * Dead pids will be dropped. Kernel processes are excluded.
3685 * Min cool-down is 5 sec.
3686 */
3687message ProcessCpuTime {
3688 optional int32 uid = 1 [(is_uid) = true];
3689
3690 optional string process_name = 2;
3691 // Process cpu time in user space, cumulative from boot/process start
3692 optional int64 user_time_millis = 3;
3693 // Process cpu time in system space, cumulative from boot/process start
3694 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003695}
Misha Wagner5a51e002018-10-03 15:04:09 +01003696
3697/**
3698 * Pulls the CPU usage for each thread.
3699 *
3700 * Read from /proc/$PID/task/$TID/time_in_state files.
3701 *
3702 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3703 * time_in_state files not being present on some phones, have not been addressed. These should be
3704 * considered before a public release.
3705 */
3706message CpuTimePerThreadFreq {
3707 // UID that owns the process.
3708 optional int32 uid = 1 [(is_uid) = true];
3709 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003710 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003711 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003712 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003713 // Name of the process taken from `/proc/$PID/cmdline`.
3714 optional string process_name = 4;
3715 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3716 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003717
3718 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3719 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3720 // frequencies are given here as the alternative is sending eight separate atoms. This method
3721 // significantly reduces the amount of data created
3722 optional int32 frequency1_khz = 6;
3723 optional int32 time1_millis = 7;
3724 optional int32 frequency2_khz = 8;
3725 optional int32 time2_millis = 9;
3726 optional int32 frequency3_khz = 10;
3727 optional int32 time3_millis = 11;
3728 optional int32 frequency4_khz = 12;
3729 optional int32 time4_millis = 13;
3730 optional int32 frequency5_khz = 14;
3731 optional int32 time5_millis = 15;
3732 optional int32 frequency6_khz = 16;
3733 optional int32 time6_millis = 17;
3734 optional int32 frequency7_khz = 18;
3735 optional int32 time7_millis = 19;
3736 optional int32 frequency8_khz = 20;
3737 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003738}
Bookatz75ee6042018-11-09 12:27:37 -08003739
3740/**
Bookatz366a4432018-11-20 09:42:33 -08003741 * Pulls information about the device's build.
3742 */
3743message BuildInformation {
3744 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3745 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3746 optional string fingerprint = 1;
3747
3748 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3749 optional string brand = 2;
3750
3751 // Build.PRODUCT. The name of the overall product.
3752 optional string product = 3;
3753
3754 // Build.DEVICE. The name of the industrial design.
3755 optional string device = 4;
3756
3757 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3758 optional string version_release = 5;
3759
3760 // Build.ID. E.g. a label like "M4-rc20".
3761 optional string id = 6;
3762
3763 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3764 // represent this build.
3765 optional string version_incremental = 7;
3766
3767 // Build.TYPE. The type of build, like "user" or "eng".
3768 optional string type = 8;
3769
3770 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3771 optional string tags = 9;
3772}
3773
3774/**
Bookatz75ee6042018-11-09 12:27:37 -08003775 * Pulls on-device BatteryStats power use calculations for the overall device.
3776 */
3777message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08003778 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3779 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3780 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3781 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08003782}
3783
3784/**
3785 * Pulls on-device BatteryStats power use calculations broken down by uid.
3786 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3787 * that is attributed to non-uid items. They must all be included to get the total power use.
3788 */
3789message DeviceCalculatedPowerBlameUid {
3790 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3791 optional int32 uid = 1 [(is_uid) = true];
3792
Bookatz3dbc13a2018-12-21 12:16:51 -08003793 // Power used by this uid 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 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08003796}
3797
3798/**
3799 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3800 * drain type.
3801 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3802 * is attributed uids. They must all be included to get the total power use.
3803 */
3804message DeviceCalculatedPowerBlameOther {
3805 // The type of item whose power use is being reported.
3806 enum DrainType {
3807 AMBIENT_DISPLAY = 0;
3808 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3809 BLUETOOTH = 2;
3810 CAMERA = 3;
3811 // Cell-standby
3812 CELL = 4;
3813 FLASHLIGHT = 5;
3814 IDLE = 6;
3815 MEMORY = 7;
3816 // Amount that total computed drain exceeded the drain estimated using the
3817 // battery level changes and capacity.
3818 OVERCOUNTED = 8;
3819 PHONE = 9;
3820 SCREEN = 10;
3821 // Amount that total computed drain was below the drain estimated using the
3822 // battery level changes and capacity.
3823 UNACCOUNTED = 11;
3824 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3825 WIFI = 13;
3826 }
3827 optional DrainType drain_type = 1;
3828
Bookatz3dbc13a2018-12-21 12:16:51 -08003829 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3830 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3831 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003832}
arangelov4e994062018-11-13 16:12:38 +00003833
3834/**
3835 * Logs device policy features.
3836 *
3837 * Logged from:
3838 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3839 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3840 */
3841message DevicePolicyEvent {
3842 // The event id - unique for each event.
3843 optional android.stats.devicepolicy.EventId event_id = 1;
3844 // The admin package name.
3845 optional string admin_package_name = 2;
3846 // A generic integer parameter.
3847 optional int32 integer_value = 3;
3848 // A generic boolean parameter.
3849 optional bool boolean_value = 4;
3850 // A parameter specifying a time period in milliseconds.
3851 optional uint64 time_period_millis = 5;
3852 // A parameter specifying a list of package names, bundle extras or string parameters.
3853 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3854}
shawnlinea5b66b2018-11-13 15:05:29 +08003855
3856/**
3857 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3858 *
3859 * Logged from:
3860 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3861 */
3862message DocsUILaunchReported {
3863 optional android.stats.docsui.LaunchAction launch_action = 1;
3864 optional bool has_initial_uri = 2;
3865 optional android.stats.docsui.MimeType mime_type = 3;
3866 optional android.stats.docsui.Root initial_root = 4;
3867}
3868
3869/**
3870 * Logs root/app visited event in file managers/picker. Call this when the user
3871 * taps on root/app in hamburger menu.
3872 *
3873 * Logged from:
3874 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3875 */
3876message DocsUIRootVisitedReported {
3877 optional android.stats.docsui.ContextScope scope = 1;
3878 optional android.stats.docsui.Root root = 2;
3879}
3880
3881/**
3882 * Logs file operation stats. Call this when a file operation has completed.
3883 *
3884 * Logged from:
3885 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3886 */
3887message DocsUIFileOperationReported {
3888 optional android.stats.docsui.Provider provider = 1;
3889 optional android.stats.docsui.FileOperation file_op = 2;
3890}
3891
3892/**
3893 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3894 * mode.
3895 *
3896 * Logged from:
3897 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3898 */
3899message DocsUIFileOperationCopyMoveModeReported {
3900 optional android.stats.docsui.FileOperation file_op = 1;
3901 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3902}
3903
3904
3905/**
3906 * Logs file sub operation stats. Call this when a file operation has failed.
3907 *
3908 * Logged from:
3909 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3910 */
3911message DocsUIFileOperationFailureReported {
3912 optional android.stats.docsui.Authority authority = 1;
3913 optional android.stats.docsui.SubFileOperation sub_op = 2;
3914}
3915
3916/**
3917* Logs the cancellation of a file operation. Call this when a job is canceled
3918*
3919* Logged from:
3920* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3921*/
3922message DocsUIFileOperationCanceledReported {
3923 optional android.stats.docsui.FileOperation file_op = 1;
3924}
3925
3926/**
3927 * Logs startup time in milliseconds.
3928 *
3929 * Logged from:
3930 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3931 */
3932message DocsUIStartupMsReported {
3933 optional int32 startup_millis = 1;
3934}
3935
3936/**
3937 * Logs the action that was started by user.
3938 *
3939 * Logged from:
3940 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3941 */
3942message DocsUIUserActionReported {
3943 optional android.stats.docsui.UserAction action = 1;
3944}
3945
3946/**
3947 * Logs the invalid type when invalid scoped access is requested.
3948 *
3949 * Logged from:
3950 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
3951 */
3952message DocsUIInvalidScopedAccessRequestReported {
3953 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00003954}
Ben Murdochbab399f2018-12-06 11:01:38 +00003955
3956/**
shawnlina75e82d2019-01-07 10:31:12 +08003957 * Logs the package name that launches docsui picker mode.
3958 *
3959 * Logged from:
3960 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3961 */
3962message DocsUIPickerLaunchedFromReported {
3963 optional string package_name = 1;
3964}
3965
3966/**
3967 * Logs the search type.
3968 *
3969 * Logged from:
3970 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3971 */
3972message DocsUISearchTypeReported {
3973 optional android.stats.docsui.SearchType search_type = 1;
3974}
3975
3976/**
3977 * Logs the search mode.
3978 *
3979 * Logged from:
3980 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3981 */
3982message DocsUISearchModeReported {
3983 optional android.stats.docsui.SearchMode search_mode = 1;
3984}
3985
3986/**
3987 * Logs the pick result information.
3988 *
3989 * Logged from:
3990 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3991 */
3992message DocsUIPickResultReported {
3993 optional int32 total_action_count = 1;
3994 optional int64 duration_millis = 2;
3995 optional int32 file_count= 3;
3996 optional bool is_searching = 4;
3997 optional android.stats.docsui.Root picked_from = 5;
3998 optional android.stats.docsui.MimeType mime_type = 6;
3999 optional int32 repeatedly_pick_times = 7;
4000}
4001
4002/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004003 * Logs when an app's memory is compacted.
4004 *
4005 * Logged from:
4006 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4007 */
4008message AppCompacted {
4009 // The pid of the process being compacted.
4010 optional int32 pid = 1;
4011
4012 // The name of the process being compacted.
4013 optional string process_name = 2;
4014
4015 // The type of compaction.
4016 enum Action {
4017 UNKNOWN = 0;
4018 SOME = 1;
4019 FULL = 2;
4020 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004021 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004022
4023 // Total RSS in kilobytes consumed by the process prior to compaction.
4024 optional int64 before_rss_total_kilobytes = 4;
4025
4026 // File RSS in kilobytes consumed by the process prior to compaction.
4027 optional int64 before_rss_file_kilobytes = 5;
4028
4029 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4030 optional int64 before_rss_anon_kilobytes = 6;
4031
4032 // Swap in kilobytes consumed by the process prior to compaction.
4033 optional int64 before_swap_kilobytes = 7;
4034
4035 // Total RSS in kilobytes consumed by the process after compaction.
4036 optional int64 after_rss_total_kilobytes = 8;
4037
4038 // File RSS in kilobytes consumed by the process after compaction.
4039 optional int64 after_rss_file_kilobytes = 9;
4040
4041 // Anonymous RSS in kilobytes consumed by the process after compaction.
4042 optional int64 after_rss_anon_kilobytes = 10;
4043
4044 // Swap in kilobytes consumed by the process after compaction.
4045 optional int64 after_swap_kilobytes = 11;
4046
4047 // The time taken to perform compaction in milliseconds.
4048 optional int64 time_to_compact_millis = 12;
4049
4050 // The last compaction action performed for this app.
4051 optional Action last_action = 13;
4052
Ben Murdoch01720b82018-12-19 18:03:44 +00004053 // The last time that compaction was attempted on this process in milliseconds
4054 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4055 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004056
Ben Murdoch01720b82018-12-19 18:03:44 +00004057 // The oom_score_adj at the time of compaction.
4058 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004059
4060 // The process state at the time of compaction.
4061 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4062}
lifr157fc552018-12-12 16:38:04 +08004063
4064/**
4065 * Logs the latency period(in microseconds) and the return code of
4066 * the DNS(Domain Name System) lookups.
4067 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4068 * to get info(address or hostname) from DNS server(or DNS cache).
4069 * Logged from:
4070 * /system/netd/server/DnsProxyListener.cpp
4071 */
4072message NetworkDnsEventReported {
4073 // The types of the DNS lookups, as defined in
4074 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4075 enum EventType {
4076 EVENT_UNKNOWN = 0;
4077 EVENT_GETADDRINFO = 1;
4078 EVENT_GETHOSTBYNAME = 2;
4079 EVENT_GETHOSTBYADDR = 3;
4080 EVENT_RES_NSEND = 4;
4081 }
4082 optional EventType event_type = 1;
4083
4084 // The return value of the DNS resolver for each DNS lookups.
4085 //bionic/libc/include/netdb.h
4086 //system/netd/resolv/include/netd_resolv/resolv.h
4087 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004088 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004089 EAI_ADDRFAMILY = 1;
4090 EAI_AGAIN = 2;
4091 EAI_BADFLAGS = 3;
4092 EAI_FAIL = 4;
4093 EAI_FAMILY = 5;
4094 EAI_MEMORY = 6;
4095 EAI_NODATA = 7;
4096 EAI_NONAME = 8;
4097 EAI_SERVICE = 9;
4098 EAI_SOCKTYPE = 10;
4099 EAI_SYSTEM = 11;
4100 EAI_BADHINTS = 12;
4101 EAI_PROTOCOL = 13;
4102 EAI_OVERFLOW = 14;
4103 RESOLV_TIMEOUT = 255;
4104 EAI_MAX = 256;
4105 }
4106 optional ReturnCode return_code = 2;
4107
4108 // The latency period(in microseconds) it took for this DNS lookup to complete.
4109 optional int32 latency_micros = 3;
4110}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004111
4112/**
4113 * Logs when a data stall event occurs.
4114 *
4115 * Log from:
4116 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4117 */
4118message DataStallEvent {
4119 // Data stall evaluation type.
4120 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4121 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4122 optional int32 evaluation_type = 1;
4123 // See definition in data_stall_event.proto.
4124 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4125 // See definition in data_stall_event.proto.
4126 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4127 // See definition in data_stall_event.proto.
4128 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4129 // See definition in data_stall_event.proto.
4130 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4131 // See definition in data_stall_event.proto.
4132 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4133}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004134
4135/*
4136 * Logs when RescueParty resets some set of experiment flags.
4137 *
4138 * Logged from:
4139 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4140 */
4141message RescuePartyResetReported {
4142 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4143 optional int32 rescue_level = 1;
4144}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004145
4146/**
4147 * Logs when signed config is received from an APK, and if that config was applied successfully.
4148 * Logged from:
4149 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4150 */
4151message SignedConfigReported {
4152 enum Type {
4153 UNKNOWN_TYPE = 0;
4154 GLOBAL_SETTINGS = 1;
4155 }
4156 optional Type type = 1;
4157
4158 // The final status of the signed config received.
4159 enum Status {
4160 UNKNOWN_STATUS = 0;
4161 APPLIED = 1;
4162 BASE64_FAILURE_CONFIG = 2;
4163 BASE64_FAILURE_SIGNATURE = 3;
4164 SECURITY_EXCEPTION = 4;
4165 INVALID_CONFIG = 5;
4166 OLD_CONFIG = 6;
4167 SIGNATURE_CHECK_FAILED = 7;
4168 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004169 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004170 }
4171 optional Status status = 2;
4172
4173 // The version of the signed config processed.
4174 optional int32 version = 3;
4175
4176 // The package name that the config was extracted from.
4177 optional string from_package = 4;
4178
4179 enum Key {
4180 NO_KEY = 0;
4181 DEBUG = 1;
4182 PRODUCTION = 2;
4183 }
4184 // Which key was used to verify the config.
4185 optional Key verified_with = 5;
4186}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004187
4188/*
4189 * Logs GNSS Network-Initiated (NI) location events.
4190 *
4191 * Logged from:
4192 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4193 */
4194message GnssNiEventReported {
4195 // The type of GnssNiEvent.
4196 enum EventType {
4197 UNKNOWN = 0;
4198 NI_REQUEST = 1;
4199 NI_RESPONSE = 2;
4200 }
4201 optional EventType event_type = 1;
4202
4203 // An ID generated by HAL to associate NI notifications and UI responses.
4204 optional int32 notification_id = 2;
4205
4206 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004207 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004208
4209 // NI requires notification.
4210 optional bool need_notify = 4;
4211
4212 // NI requires verification.
4213 optional bool need_verify = 5;
4214
4215 // NI requires privacy override, no notification/minimal trace.
4216 optional bool privacy_override = 6;
4217
4218 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4219 // seconds.
4220 optional int32 timeout = 7;
4221
4222 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004223 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004224
4225 // String representing the requester of the network inititated location request.
4226 optional string requestor_id = 9;
4227
4228 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4229 // network initiated location request.
4230 optional string text = 10;
4231
4232 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004233 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004234
4235 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004236 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004237
4238 // True if SUPL ES is enabled.
4239 optional bool is_supl_es_enabled = 13;
4240
4241 // True if GNSS location is enabled.
4242 optional bool is_location_enabled = 14;
4243
4244 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004245 optional android.server.location.GnssUserResponseType user_response = 15;
4246}
4247
4248/**
4249 * Logs GNSS non-framework (NFW) location notification.
4250 *
4251 * Logged from:
4252 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4253 */
4254message GnssNfwNotificationReported {
4255 // Package name of the Android proxy application representing the non-framework entity that
4256 // requested location. Set to empty string if unknown.
4257 optional string proxy_app_package_name = 1;
4258
4259 // Protocol stack that initiated the non-framework location request.
4260 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4261
4262 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4263 // set to empty string. This field is opaque to the framework and used for logging purposes.
4264 optional string other_protocol_stack_name = 3;
4265
4266 // Source initiating/receiving the location information.
4267 optional android.server.location.NfwRequestor requestor = 4;
4268
4269 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4270 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4271 // and used for logging purposes.
4272 optional string requestor_id = 5;
4273
4274 // Indicates whether location information was provided for this request.
4275 optional android.server.location.NfwResponseType response_type = 6;
4276
4277 // True if the device is in user initiated emergency session.
4278 optional bool in_emergency_mode = 7;
4279
4280 // True if cached location is provided.
4281 optional bool is_cached_location = 8;
4282
4283 // True if proxy app permission mismatch between framework and GNSS HAL.
4284 optional bool is_permission_mismatched = 9;
4285}
4286
4287/**
4288 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4289 *
4290 * Logged from:
4291 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4292 */
4293message GnssConfigurationReported {
4294 // SUPL host name.
4295 optional string supl_host = 1;
4296
4297 // SUPL port number.
4298 optional int32 supl_port = 2;
4299
4300 // C2K host name.
4301 optional string c2k_host = 3;
4302
4303 // C2K port number.
4304 optional int32 c2k_port = 4;
4305
4306 // The SUPL version requested by Carrier.
4307 optional int32 supl_ver = 5;
4308
4309 // The SUPL mode.
4310 optional android.server.location.SuplMode supl_mode = 6;
4311
4312 // True if NI emergency SUPL restrictions is enabled.
4313 optional bool supl_es = 7;
4314
4315 // LTE Positioning Profile settings
4316 optional android.server.location.LppProfile lpp_profile = 8;
4317
4318 // Positioning protocol on A-Glonass system.
4319 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4320
4321 // True if emergency PDN is used. Otherwise, regular PDN is used.
4322 optional bool use_emergency_pdn_for_emergency_supl= 10;
4323
4324 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4325 optional android.server.location.GpsLock gps_lock = 11;
4326
4327 // Number of seconds to extend the emergency session duration post emergency call.
4328 optional int32 es_extension_sec = 12;
4329
4330 // The full list of package names of proxy Android applications representing the non-framework
4331 // location access entities (on/off the device) for which the framework user has granted
4332 // non-framework location access permission. The package names are concatenated in one string
4333 // with spaces as separators.
4334 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004335}
Jack Yu95b64f32018-12-13 18:26:11 +08004336
4337/**
4338 * Logs when a NFC device's error occurred.
4339 * Logged from:
4340 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4341 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
4342 */
4343message NfcErrorOccurred {
4344 enum Type {
4345 UNKNOWN = 0;
4346 CMD_TIMEOUT = 1;
4347 ERROR_NOTIFICATION = 2;
4348 AID_OVERFLOW = 3;
4349 }
4350 optional Type type = 1;
4351 // If it's nci cmd timeout, log the timeout command.
4352 optional uint32 nci_cmd = 2;
4353
4354 optional uint32 error_ntf_status_code = 3;
4355}
4356
4357/**
4358 * Logs when a NFC device's state changed event
4359 * Logged from:
4360 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
4361 */
4362message NfcStateChanged {
4363 enum State {
4364 UNKNOWN = 0;
4365 OFF = 1;
4366 ON = 2;
4367 ON_LOCKED = 3; // Secure Nfc enabled.
4368 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
4369 }
4370 optional State state = 1;
4371}
4372
4373/**
4374 * Logs when a NFC Beam Transaction occurred.
4375 * Logged from:
4376 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
4377 */
4378message NfcBeamOccurred {
4379 enum Operation {
4380 UNKNOWN = 0;
4381 SEND = 1;
4382 RECEIVE = 2;
4383 }
4384 optional Operation operation = 1;
4385}
4386
4387/**
4388 * Logs when a NFC Card Emulation Transaction occurred.
4389 * Logged from:
4390 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
4391 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
4392 */
4393message NfcCardemulationOccurred {
4394 enum Category {
4395 UNKNOWN = 0;
4396 HCE_PAYMENT = 1;
4397 HCE_OTHER = 2;
4398 OFFHOST = 3;
4399 }
4400 // Transaction belongs to HCE payment or HCE other category, or offhost.
4401 optional Category category = 1;
4402 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
4403 optional string se_name = 2;
4404}
4405
4406/**
4407 * Logs when a NFC Tag event occurred.
4408 * Logged from:
4409 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
4410 */
4411message NfcTagOccurred {
4412 enum Type {
4413 UNKNOWN = 0;
4414 URL = 1;
4415 BT_PAIRING = 2;
4416 PROVISION = 3;
4417 WIFI_CONNECT = 4;
4418 APP_LAUNCH = 5;
4419 OTHERS = 6;
4420 }
4421 optional Type type = 1;
4422}
4423
4424/**
4425 * Logs when Hce transaction triggered
4426 * Logged from:
4427 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4428 */
4429message NfcHceTransactionOccurred {
4430 // The latency period(in microseconds) it took for the first HCE data
4431 // exchange.
4432 optional uint32 latency_micros = 1;
4433}
4434
4435/**
4436 * Logs when SecureElement state event changed
4437 * Logged from:
4438 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4439 */
4440message SeStateChanged {
4441 enum State {
4442 UNKNOWN = 0;
4443 INITIALIZED = 1;
4444 DISCONNECTED = 2;
4445 CONNECTED = 3;
4446 HALCRASH = 4;
4447 }
4448 optional State state = 1;
4449
4450 optional string state_change_reason = 2;
4451 // SIMx or eSEx.
4452 optional string terminal = 3;
4453}
4454
4455/**
4456 * Logs when Omapi API used
4457 * Logged from:
4458 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4459 */
4460message SeOmapiReported {
4461 enum Operation {
4462 UNKNOWN = 0;
4463 OPEN_CHANNEL = 1;
4464 }
4465 optional Operation operation = 1;
4466 // SIMx or eSEx.
4467 optional string terminal = 2;
4468
4469 optional string packageName = 3;
4470}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004471
4472/**
Alex Saloa060aee2019-01-21 14:36:41 -08004473 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
4474 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004475 * Logged from:
4476 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
4477 */
4478message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08004479 optional int64 dispatch_latency_millis = 1;
4480}
4481
4482/**
4483 * Logs AttentionManagerService attention check result.
4484 *
4485 * Logged from:
4486 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
4487 */
4488message AttentionManagerServiceResultReported {
4489 // See core/java/android/service/attention/AttentionService.java
4490 enum AttentionCheckResult {
4491 UNKNOWN = 20;
4492 ATTENTION_SUCCESS_ABSENT = 0;
4493 ATTENTION_SUCCESS_PRESENT = 1;
4494 ATTENTION_FAILURE_PREEMPTED = 2;
4495 ATTENTION_FAILURE_TIMED_OUT = 3;
4496 ATTENTION_FAILURE_UNKNOWN = 4;
4497 }
4498 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004499}