blob: 7e2df275515e9dc68122c5ca649ad96e396f8935 [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;
94 // 34 is available
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;
Yao Chend54f9dd2017-10-17 17:37:48 +0000191 }
David Chenc8a43242017-10-17 16:23:28 -0700192
David Chen6e3e6cb2018-01-03 16:14:06 -0800193 // Pulled events will start at field 10000.
Rafal Slawik3bea8952018-11-15 12:39:33 +0000194 // Next: 10043
David Chenc8a43242017-10-17 16:23:28 -0700195 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800196 WifiBytesTransfer wifi_bytes_transfer = 10000;
197 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
198 MobileBytesTransfer mobile_bytes_transfer = 10002;
199 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800200 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800201 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800202 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800203 CpuTimePerFreq cpu_time_per_freq = 10008;
204 CpuTimePerUid cpu_time_per_uid = 10009;
205 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800206 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800207 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800208 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800209 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800210 SystemElapsedRealtime system_elapsed_realtime = 10014;
211 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800212 CpuActiveTime cpu_active_time = 10016;
213 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000214 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800215 RemainingBatteryCapacity remaining_battery_capacity = 10019;
216 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800217 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100218 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100219 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100220 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000221 DiskStats disk_stats = 10025;
222 DirectoryUsage directory_usage = 10026;
223 AppSize app_size = 10027;
224 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700225 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700226 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700227 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700228 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700229 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800230 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700231 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100232 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100233 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700234 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800235 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
236 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
237 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000238 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800239 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800240 BuildInformation build_information = 10044;
David Chenc8a43242017-10-17 16:23:28 -0700241 }
yroa1fe77c2018-02-26 14:22:54 -0800242
Bookatz76aafcf2018-09-17 16:17:10 -0700243 // DO NOT USE field numbers above 100,000 in AOSP.
244 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
245 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700246}
247
Yao Chend54f9dd2017-10-17 17:37:48 +0000248/**
Yangster-mac20877162017-12-22 17:19:39 -0800249 * This proto represents a node of an attribution chain.
250 * Note: All attribution chains are represented as a repeated field of type
251 * AttributionNode. It is understood that in such arrays, the order is that
252 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000253 */
Yangster-mac20877162017-12-22 17:19:39 -0800254message AttributionNode {
255 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800256 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800257
Yangster-mac20877162017-12-22 17:19:39 -0800258 // The (optional) string tag for an element in the attribution chain. If the
259 // element has no tag, it is encoded as an empty string.
260 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700261}
262
Yangster-mac48b3d622018-08-18 12:38:11 -0700263message KeyValuePair {
264 optional int32 key = 1;
265 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700266 int32 value_int = 2;
267 int64 value_long = 3;
268 string value_str = 4;
269 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700270 }
271}
272
273message KeyValuePairsAtom {
274 optional int32 uid = 1;
275 repeated KeyValuePair pairs = 2;
276}
277
Yao Chend54f9dd2017-10-17 17:37:48 +0000278/*
279 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800280 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000281 *
282 * RULES:
283 * - The field ids for each atom must start at 1, and count upwards by 1.
284 * Skipping field ids is not allowed.
285 * - These form an API, so renaming, renumbering or removing fields is
286 * not allowed between android releases. (This is not currently enforced,
287 * but there will be a tool to enforce this restriction).
288 * - The types must be built-in protocol buffer types, namely, no sub-messages
289 * are allowed (yet). The bytes type is also not allowed.
290 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800291 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000292 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800293 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000294 * - A field that is a uid should be a string field, tagged with the [xxx]
295 * annotation. The generated code on android will be represented by UIDs,
296 * and those UIDs will be translated in xxx to those strings.
297 *
298 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700299 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000300 * - If there is a UID, it goes first. Think in an object-oriented fashion.
301 * *****************************************************************************
302 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700303
Yao Chend54f9dd2017-10-17 17:37:48 +0000304/**
Yangster-mace16189a2018-08-26 12:20:16 -0700305 * Logs when the Thermal service HAL notifies the throttling start/stop events.
306 *
307 * Logged from:
308 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
309 */
310message ThermalThrottlingStateChanged {
311 optional android.os.TemperatureTypeEnum sensor_type = 1;
312
313 enum State {
314 UNKNOWN = 0;
315 START = 1;
316 STOP = 2;
317 }
318
319 optional State state = 2;
320
321 optional float temperature = 3;
322}
323
324/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000325 * Logs when the screen state changes.
326 *
327 * Logged from:
328 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
329 */
330message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800331 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700332 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700333}
Yao Chend54f9dd2017-10-17 17:37:48 +0000334
335/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700336 * Logs that the process state of the uid, as determined by ActivityManager
337 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000338 *
339 * Logged from:
340 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
341 */
Bookatzc1a050a2017-10-10 15:49:28 -0700342message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700343 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000344
Bookatzdb026a22018-01-10 19:01:56 -0800345 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700346 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000347}
348
349/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700350 * Logs process state change of a process, as per the activity manager.
351 *
352 * Logged from:
353 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
354 */
355message ProcessStateChanged {
356 optional int32 uid = 1;
357 optional string process_name = 2;
358 optional string package_name = 3;
359 // TODO: remove this when validation is done
360 optional int64 version = 5;
361 // The state, from frameworks/base/core/proto/android/app/enums.proto.
362 optional android.app.ProcessStateEnum state = 4;
363}
364
365/**
366 * Logs when ActivityManagerService sleep state is changed.
367 *
368 * Logged from:
369 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
370 */
371message ActivityManagerSleepStateChanged {
372 // TODO: import frameworks proto
373 enum State {
374 UNKNOWN = 0;
375 ASLEEP = 1;
376 AWAKE = 2;
377 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700378 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700379}
380
381/**
382 * Logs when system memory state changes.
383 *
384 * Logged from:
385 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
386 */
387message MemoryFactorStateChanged {
388 // TODO: import frameworks proto
389 enum State {
390 MEMORY_UNKNOWN = 0;
391 NORMAL = 1; // normal.
392 MODERATE = 2; // moderate memory pressure.
393 LOW = 3; // low memory.
394 CRITICAL = 4; // critical memory.
395
396 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700397 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700398}
399
400/**
401 * Logs when app is using too much cpu, according to ActivityManagerService.
402 *
403 * Logged from:
404 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
405 */
406message ExcessiveCpuUsageReported {
407 optional int32 uid = 1;
408 optional string process_name = 2;
409 optional string package_name = 3;
410 // package version. TODO: remove this when validation is done
411 optional int64 version = 4;
412}
413
414/**
415 * Logs when a cached process is killed, along with its pss.
416 *
417 * Logged from:
418 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
419 */
420message CachedKillReported {
421 optional int32 uid = 1;
422 optional string process_name = 2;
423 optional string package_name = 3;
424 // TODO: remove this when validation is done
425 optional int64 version = 5;
426 optional int64 pss = 4;
427}
428
429/**
430 * Logs when memory stats of a process is reported.
431 *
432 * Logged from:
433 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
434 */
435message ProcessMemoryStatReported {
436 optional int32 uid = 1;
437 optional string process_name = 2;
438 optional string package_name = 3;
439 //TODO: remove this when validation is done
440 optional int64 version = 9;
441 optional int64 pss = 4;
442 optional int64 uss = 5;
443 optional int64 rss = 6;
444 enum Type {
445 ADD_PSS_INTERNAL_SINGLE = 0;
446 ADD_PSS_INTERNAL_ALL_MEM = 1;
447 ADD_PSS_INTERNAL_ALL_POLL = 2;
448 ADD_PSS_EXTERNAL = 3;
449 ADD_PSS_EXTERNAL_SLOW = 4;
450 }
451 optional Type type = 7;
452 optional int64 duration = 8;
453}
454
455/**
Bookatzc1a050a2017-10-10 15:49:28 -0700456 * Logs that a process started, finished, crashed, or ANRed.
457 *
458 * Logged from:
459 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
460 */
461message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700462 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700463
David Chen0b5c90c2018-01-25 16:51:49 -0800464 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800465 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700466
Bookatzddccf0a2017-11-28 16:48:14 -0800467 // What lifecycle state the process changed to.
468 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800469 enum State {
470 FINISHED = 0;
471 STARTED = 1;
472 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800473 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800474 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700475}
476
Bookatzc1a050a2017-10-10 15:49:28 -0700477/**
478 * Logs when the ble scan state changes.
479 *
480 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700481 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700482 */
483message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800484 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700485
486 enum State {
487 OFF = 0;
488 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700489 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
490 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700491 }
492 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700493
Bookatze5ec0b42018-03-26 13:34:56 -0700494 // Does the scan have a filter.
495 optional bool is_filtered = 3;
496 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
497 optional bool is_first_match = 4;
498 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
499 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700500}
501
502/**
503 * Logs reporting of a ble scan finding results.
504 *
505 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700506 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700507 */
Bookatzae6738e2018-09-13 11:38:56 -0700508// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700509message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800510 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700511
512 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800513 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700514}
515
516/**
517 * Logs when a sensor state changes.
518 *
519 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700520 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700521 */
522message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800523 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700524
Bookatzc1a050a2017-10-10 15:49:28 -0700525 // The id (int) of the sensor.
526 optional int32 sensor_id = 2;
527
528 enum State {
529 OFF = 0;
530 ON = 1;
531 }
532 optional State state = 3;
533}
534
Bookatzc1a050a2017-10-10 15:49:28 -0700535/**
536 * Logs when GPS state changes.
537 *
538 * Logged from:
539 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
540 */
541message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800542 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700543
544 enum State {
545 OFF = 0;
546 ON = 1;
547 }
548 optional State state = 2;
549}
550
Bookatz48d362e2018-11-06 15:49:08 -0800551/**
552 * Logs when GPS signal quality.
553 *
554 * Logged from:
555 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
556 */
557message GpsSignalQualityChanged {
558 optional android.server.location.GpsSignalQualityEnum level = 1;
559}
560
Bookatzc1a050a2017-10-10 15:49:28 -0700561
562/**
563 * Logs when a sync manager sync state changes.
564 *
565 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700566 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700567 */
568message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800569 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700570
David Chen0b5c90c2018-01-25 16:51:49 -0800571 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800572 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700573
574 enum State {
575 OFF = 0;
576 ON = 1;
577 }
578 optional State state = 3;
579}
580
Yangster-mac96353002018-09-05 11:18:55 -0700581/*
582 * Deferred job stats.
583 *
584 * Logged from:
585 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
586*/
587message DeferredJobStatsReported {
588 repeated AttributionNode attribution_node = 1;
589
590 // Number of jobs deferred.
591 optional int32 num_jobs_deferred = 2;
592
593 // Time since the last job runs.
594 optional int64 time_since_last_job_millis = 3;
595}
596
Bookatzc1a050a2017-10-10 15:49:28 -0700597/**
598 * Logs when a job scheduler job state changes.
599 *
600 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700601 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700602 */
603message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800604 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700605
606 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800607 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700608
609 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800610 FINISHED = 0;
611 STARTED = 1;
612 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700613 }
614 optional State state = 3;
615
Tej Singh33a412b2018-03-16 18:43:59 -0700616 // The reason a job has stopped.
617 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700618 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700619 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700620}
621
622/**
623 * Logs when the audio state changes.
624 *
625 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700626 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700627 */
628message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800629 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700630
631 enum State {
632 OFF = 0;
633 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700634 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
635 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700636 }
637 optional State state = 2;
638}
639
640/**
641 * Logs when the video codec state changes.
642 *
643 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700644 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700645 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800646message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800647 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700648
649 enum State {
650 OFF = 0;
651 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700652 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
653 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700654 }
655 optional State state = 2;
656}
657
658/**
659 * Logs when the flashlight state changes.
660 *
661 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700662 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700663 */
664message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800665 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700666
667 enum State {
668 OFF = 0;
669 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700670 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
671 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700672 }
673 optional State state = 2;
674}
675
676/**
677 * Logs when the camera state changes.
678 *
679 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700680 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700681 */
682message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800683 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700684
685 enum State {
686 OFF = 0;
687 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700688 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
689 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700690 }
691 optional State state = 2;
692}
693
694/**
695 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000696 *
697 * Logged from:
698 * TODO
699 */
Bookatzd6746242017-10-24 18:39:35 -0700700message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800701 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000702
Bookatz1a1b0462018-01-12 11:47:03 -0800703 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
704 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700705 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700706
707 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
708 optional string tag = 3;
709
710 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800711 RELEASE = 0;
712 ACQUIRE = 1;
713 CHANGE_RELEASE = 2;
714 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700715 }
716 optional State state = 4;
717}
718
719/**
Bookatzc1a050a2017-10-10 15:49:28 -0700720 * Logs when a partial wakelock is considered 'long' (over 1 min).
721 *
722 * Logged from:
723 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
724 */
725message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800726 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700727
Yao Chend54f9dd2017-10-17 17:37:48 +0000728 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
729 optional string tag = 2;
730
Bookatzc1a050a2017-10-10 15:49:28 -0700731 // TODO: I have no idea what this is.
732 optional string history_tag = 3;
733
734 enum State {
735 OFF = 0;
736 ON = 1;
737 }
738 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000739}
740
Bookatzc1a050a2017-10-10 15:49:28 -0700741/**
Bookatza66083f2018-09-20 17:24:00 -0700742 * Logs when the device is interactive, according to the PowerManager Notifier.
743 *
744 * Logged from:
745 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
746 */
747message InteractiveStateChanged {
748 enum State {
749 OFF = 0;
750 ON = 1;
751 }
752 optional State state = 1;
753}
754
755/**
Bookatzc1a050a2017-10-10 15:49:28 -0700756 * Logs Battery Saver state change.
757 *
758 * Logged from:
759 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
760 */
761message BatterySaverModeStateChanged {
762 enum State {
763 OFF = 0;
764 ON = 1;
765 }
766 optional State state = 1;
767}
768
769/**
770 * Logs Doze mode state change.
771 *
772 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800773 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700774 */
775message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800776 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800777}
778
779
780/**
781 * Logs state change of Doze mode including maintenance windows.
782 *
783 * Logged from:
784 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
785 */
786message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800787 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700788}
789
790/**
791 * Logs screen brightness level.
792 *
793 * Logged from:
794 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
795 */
796message ScreenBrightnessChanged {
797 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
798 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700799}
800
801/**
802 * Logs battery level (percent full, from 0 to 100).
803 *
804 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700805 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700806 */
807message BatteryLevelChanged {
808 // Battery level. Should be in [0, 100].
809 optional int32 battery_level = 1;
810}
811
812/**
813 * Logs change in charging status of the device.
814 *
815 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700816 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700817 */
818message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800819 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
820 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700821}
822
823/**
824 * Logs whether the device is plugged in, and what power source it is using.
825 *
826 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700827 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700828 */
829message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800830 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
831 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700832}
833
Bookatz8c6571b2017-10-24 15:04:41 -0700834/**
835 * Logs when an app's wakeup alarm fires.
836 *
837 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700838 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700839 */
840message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800841 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800842
843 // Name of the wakeup alarm.
844 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700845
846 // Name of source package (for historical reasons, since BatteryStats tracked it).
847 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800848}
849
850/**
851 * Logs when an an app causes the mobile radio to change state.
852 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
853 *
854 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700855 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800856 */
857message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800858 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800859
Bookatz1a1b0462018-01-12 11:47:03 -0800860 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
861 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800862}
863
864/**
865 * Logs when an an app causes the wifi radio to change state.
866 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
867 *
868 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700869 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800870 */
871message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800872 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800873
Bookatz1a1b0462018-01-12 11:47:03 -0800874 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
875 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700876}
877
878/**
879 * Logs kernel wakeup reasons and aborts.
880 *
881 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700882 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700883 */
884message KernelWakeupReported {
885 // Name of the kernel wakeup reason (or abort).
886 optional string wakeup_reason_name = 1;
887
888 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800889 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700890}
891
892/**
Bookatzda1798c2018-12-13 14:16:00 -0800893 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800894 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800895 *
896 * Logged from:
897 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
898 */
899message WifiEnabledStateChanged {
900 enum State {
901 OFF = 0;
902 ON = 1;
903 }
904 optional State state = 1;
905}
906
907/**
908 * 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 -0800909 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
910 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800911 *
912 * Logged from:
913 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
914 */
915message WifiRunningStateChanged {
916 repeated AttributionNode attribution_node = 1;
917
918 enum State {
919 OFF = 0;
920 ON = 1;
921 }
922 optional State state = 2;
923}
924
925/**
Bookatze5885242017-10-24 20:10:31 -0700926 * Logs wifi locks held by an app.
927 *
928 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700929 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700930 */
931message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800932 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700933
934 enum State {
935 OFF = 0;
936 ON = 1;
937 }
938 optional State state = 2;
939}
940
941/**
942 * Logs wifi signal strength changes.
943 *
944 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800945 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700946 */
947message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800948 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
949 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700950}
951
952/**
953 * Logs wifi scans performed by an app.
954 *
955 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800956 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700957 */
958message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800959 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700960
961 enum State {
962 OFF = 0;
963 ON = 1;
964 }
965 optional State state = 2;
966}
967
968/**
Tej Singh4503e102018-01-04 14:35:01 -0800969 * Logs wifi multicast locks held by an app
970 *
971 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800972 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -0800973 */
974message WifiMulticastLockStateChanged {
975 repeated AttributionNode attribution_node = 1;
976
977 enum State {
978 OFF = 0;
979 ON = 1;
980 }
981 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -0800982
983 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -0800984}
985
986/**
Tej Singh1ea42892018-01-19 09:27:00 -0800987 * Logs shutdown reason and duration on next boot.
988 *
989 * Logged from:
990 * frameworks/base/core/java/com/android/server/BootReceiver.java
991 */
992message ShutdownSequenceReported {
993 // True if shutdown is for a reboot. Default: false if we do not know.
994 optional bool reboot = 1;
995
996 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
997 optional string reason = 2;
998
999 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1000 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001001 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001002
1003 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001004 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001005}
1006
Tej Singh6483ea42018-01-25 17:45:49 -08001007
1008/**
1009 * Logs boot reason and duration.
1010 *
1011 * Logged from:
1012 * system/core/bootstat/bootstat.cpp
1013 */
1014message BootSequenceReported {
1015 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1016 // Default: "<EMPTY>" if not available.
1017 optional string bootloader_reason = 1;
1018
1019 // Reason for system boot. Eg. bootloader, reboot,userrequested
1020 // Default: "<EMPTY>" if not available.
1021 optional string system_reason = 2;
1022
1023 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001024 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001025
1026 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001027 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001028
1029 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001030 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001031
1032 // Time since last boot in ms. Default: 0 if not available.
1033 optional int64 time_since_last_boot = 6;
1034}
1035
Tej Singhc477d9c2018-02-05 18:31:39 -08001036
1037/**
1038 * Logs call state and disconnect cause (if applicable).
1039 *
1040 * Logged from:
1041 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1042 */
1043message CallStateChanged {
1044 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1045 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1046 optional android.telecom.CallStateEnum call_state = 1;
1047
1048 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1049 // This value is only applicable when the call_state is DISCONNECTED, and
1050 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1051 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1052 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1053
1054 // True if the call is self-managed, which are apps that use the
1055 // telecom infrastructure to make their own calls.
1056 optional bool self_managed = 3;
1057
1058 // True if call is external. External calls are calls on connected Wear
1059 // devices but show up in Telecom so the user can pull them onto the device.
1060 optional bool external_call = 4;
1061}
1062
Tej Singh1ea42892018-01-19 09:27:00 -08001063/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001064 * Logs keyguard state. The keyguard is the lock screen.
1065 *
1066 * Logged from:
1067 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1068 */
1069message KeyguardStateChanged {
1070 enum State {
1071 UNKNOWN = 0;
1072 // The keyguard is hidden when the phone is unlocked.
1073 HIDDEN = 1;
1074 // The keyguard is shown when the phone is locked (screen turns off).
1075 SHOWN= 2;
1076 // The keyguard is occluded when something is overlaying the keyguard.
1077 // Eg. Opening the camera while on the lock screen.
1078 OCCLUDED = 3;
1079 }
1080 optional State state = 1;
1081}
1082
1083/**
1084 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1085 * prompts the user to enter a password (pattern, pin, etc).
1086 *
1087 * Logged from:
1088 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1089 */
1090
1091message KeyguardBouncerStateChanged {
1092 enum State {
1093 UNKNOWN = 0;
1094 // Bouncer is hidden, either as a result of successfully entering the
1095 // password, screen timing out, or user going back to lock screen.
1096 HIDDEN = 1;
1097 // This is when the user is being prompted to enter the password.
1098 SHOWN = 2;
1099 }
1100 optional State state = 1;
1101}
1102
1103/**
1104 * Logs the result of entering a password into the keyguard bouncer.
1105 *
1106 * Logged from:
1107 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1108 */
1109message KeyguardBouncerPasswordEntered {
1110 enum BouncerResult {
1111 UNKNOWN = 0;
1112 // The password entered was incorrect.
1113 FAILURE = 1;
1114 // The password entered was correct.
1115 SUCCESS = 2;
1116 }
1117 optional BouncerResult result = 1;
1118}
1119
Tej Singha883b372018-02-15 11:30:01 -08001120/*
1121 * Logs changes to the configuration of the device. The configuration is defined
1122 * in frameworks/base/core/java/android/content/res/Configuration.java
1123 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1124 * Please go there to interpret the possible values each field can be.
1125 *
1126 * Logged from:
1127 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1128 */
1129message ResourceConfigurationChanged {
1130 // Bit mask of color capabilities of the screen.
1131 // Contains information about the color gamut and hdr mode of the screen.
1132 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001133 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001134
1135 // The target screen density being rendered to.
1136 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001137 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001138
1139 // Current user preference for the scaling factor for fonts,
1140 // relative to the base density scaling.
1141 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001142 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001143
1144 // Flag indicating whether the hard keyboard is hidden.
1145 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001146 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001147
1148 // The type of keyboard attached to the device.
1149 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1150 optional int32 keyboard = 5;
1151
1152 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1153 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001154 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001155
1156 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1157 // 0 if undefined.
1158 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1159 optional int32 mcc = 7;
1160
1161 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1162 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1163 // MNC_ZERO symbol defined in Configuration.java.
1164 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1165 optional int32 mnc = 8;
1166
1167 // The kind of navigation available on the device.
1168 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1169 optional int32 navigation = 9;
1170
1171 // Flag indicating whether the navigation is available.
1172 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001173 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001174
1175 // Overall orientation of the screen.
1176 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1177 optional int32 orientation = 11;
1178
1179 // The current height of the available screen space, in dp units.
1180 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001181 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001182
1183 // Bit mask of overall layout of the screen.
1184 // Contains information about screen size, whether the screen is wider/taller
1185 // than normal, whether the screen layout is right-tl-left or left-to-right,
1186 // and whether the screen has a rounded shape.
1187 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001188 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001189
1190 // Current width of the available screen space, in dp units.
1191 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001192 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001193
1194 // The smallest screen size an application will see in normal operation.
1195 // This is the smallest value of both screenWidthDp and screenHeightDp
1196 // in portrait and landscape.
1197 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001198 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001199
1200 // The type of touch screen attached to the device.
1201 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1202 optional int32 touchscreen = 16;
1203
1204 // Bit mask of the ui mode.
1205 // Contains information about the overall ui mode of the device.
1206 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1207 // Also contains information about whether the device is in night mode.
1208 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001209 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001210}
1211
Tej Singheee317b2018-03-07 19:28:05 -08001212
1213/**
1214 * Logs changes in the connection state of the mobile radio.
1215 *
1216 * Logged from:
1217 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1218 */
1219message MobileConnectionStateChanged {
1220 // States are from the state machine DataConnection.java.
1221 enum State {
1222 UNKNOWN = 0;
1223 // The connection is inactive, or disconnected.
1224 INACTIVE = 1;
1225 // The connection is being activated, or connecting.
1226 ACTIVATING = 2;
1227 // The connection is active, or connected.
1228 ACTIVE = 3;
1229 // The connection is disconnecting.
1230 DISCONNECTING = 4;
1231 // The connection is disconnecting after creating a connection.
1232 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1233 }
1234 optional State state = 1;
1235 // For multi-sim phones, this distinguishes between the sim cards.
1236 optional int32 sim_slot_index = 2;
1237 // Used to identify the connection. Starts at 0 and increments by 1 for
1238 // every new network created. Resets whenever the device reboots.
1239 optional int32 data_connection_id = 3;
1240 // A bitmask for the capabilities of this connection.
1241 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1242 // Default value (if we have no information): 0
1243 optional int64 capabilities = 4;
1244 // If this connection has internet.
1245 // This just checks if the DEFAULT bit of capabilities is set.
1246 optional bool has_internet = 5;
1247}
1248
1249/**
1250 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1251 *
1252 * Logged from:
1253 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1254 */
1255message MobileRadioTechnologyChanged {
1256 optional android.telephony.NetworkTypeEnum state = 1;
1257 // For multi-sim phones, this distinguishes between the sim cards.
1258 optional int32 sim_slot_index = 2;
1259}
1260
Andrew Chantb56388b2018-03-22 21:07:33 -07001261/**
1262 * Logs the VID and PID of any connected USB devices.
1263 *
1264 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1265 *
1266 * Logged by Vendor.
1267 */
1268message UsbDeviceAttached {
1269 optional int32 vid = 1;
1270 optional int32 pid = 2;
1271 optional bool has_audio = 3;
1272 optional bool has_hid = 4;
1273 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001274 enum State {
1275 STATE_DISCONNECTED = 0;
1276 STATE_CONNECTED = 1;
1277 }
1278 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001279 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001280}
1281
Tej Singheee317b2018-03-07 19:28:05 -08001282
Tej Singhdd7bd352018-02-09 19:33:15 -08001283/**
Tej Singh5d991e12018-03-09 19:48:11 -08001284 * Logs when Bluetooth is enabled and disabled.
1285 *
1286 * Logged from:
1287 * services/core/java/com/android/server/BluetoothManagerService.java
1288 */
1289message BluetoothEnabledStateChanged {
1290 repeated AttributionNode attribution_node = 1;
1291 // Whether or not bluetooth is enabled on the device.
1292 enum State {
1293 UNKNOWN = 0;
1294 ENABLED = 1;
1295 DISABLED = 2;
1296 }
1297 optional State state = 2;
1298 // The reason for being enabled/disabled.
1299 // Eg. Airplane mode, crash, application request.
1300 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1301 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001302 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001303}
1304
1305/**
Jack Hed9837c82019-01-09 01:19:13 -08001306 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001307 *
1308 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001309 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1310 *
1311 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001312 */
1313message BluetoothConnectionStateChanged {
1314 // The state of the connection.
1315 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1316 optional android.bluetooth.ConnectionStateEnum state = 1;
1317 // An identifier that can be used to match connect and disconnect events.
1318 // Currently is last two bytes of a hash of a device level ID and
1319 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001320 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1321 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001322 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1323 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001324 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001325 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001326 // An identifier that can be used to match events for this device.
1327 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1328 // Salt: Randomly generated 256 bit value
1329 // Hash algorithm: HMAC-SHA256
1330 // Size: 32 byte
1331 // Default: null or empty if the device identifier is not known
1332 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1333}
1334
1335/**
1336 * Logs when a Bluetooth device connects and disconnects over ACL
1337 *
1338 * Logged from:
1339 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1340 *
1341 * Next Tag: 3
1342 */
1343message BluetoothAclConnectionStateChanged {
1344 // An identifier that can be used to match events for this device.
1345 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1346 // Salt: Randomly generated 256 bit value
1347 // Hash algorithm: HMAC-SHA256
1348 // Size: 32 byte
1349 // Default: null or empty if the device identifier is not known
1350 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1351 // The state of the connection.
1352 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1353 optional android.bluetooth.ConnectionStateEnum state = 2;
1354}
1355
1356/**
1357 * Logs when a Bluetooth device connects and disconnects over SCO
1358 *
1359 * Logged from:
1360 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1361 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1362 *
1363 * Next Tag: 4
1364 */
1365message BluetoothScoConnectionStateChanged {
1366 // An identifier that can be used to match events for this device.
1367 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1368 // Salt: Randomly generated 256 bit value
1369 // Hash algorithm: HMAC-SHA256
1370 // Size: 32 byte
1371 // Default: null or empty if the device identifier is not known
1372 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1373 // The state of the connection.
1374 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1375 optional android.bluetooth.ConnectionStateEnum state = 2;
1376 // Codec used for this SCO connection
1377 // Default: UNKNOWN
1378 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001379}
1380
Jack Heab86dbd22018-12-18 15:43:27 -08001381// Logs when there is an event affecting Bluetooth device's link layer connection.
1382// - This event is triggered when there is a related HCI command or event
1383// - Users of this metrics can deduce Bluetooth device's connection state from these events
1384// - HCI commands are logged before the command is sent, after receiving command status, and after
1385// receiving command complete
1386// - HCI events are logged when they arrive
1387//
1388// Low level log from system/bt
1389//
1390// Bluetooth classic commands:
1391// - CMD_CREATE_CONNECTION
1392// - CMD_DISCONNECT
1393// - CMD_CREATE_CONNECTION_CANCEL
1394// - CMD_ACCEPT_CONNECTION_REQUEST
1395// - CMD_REJECT_CONNECTION_REQUEST
1396// - CMD_SETUP_ESCO_CONNECTION
1397// - CMD_ACCEPT_ESCO_CONNECTION
1398// - CMD_REJECT_ESCO_CONNECTION
1399// - CMD_ENH_SETUP_ESCO_CONNECTION
1400// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1401//
1402// Bluetooth low energy commands:
1403// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1404// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1405// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1406// - CMD_BLE_CLEAR_WHITE_LIST
1407// - CMD_BLE_ADD_WHITE_LIST
1408// - CMD_BLE_REMOVE_WHITE_LIST
1409//
1410// Bluetooth classic events:
1411// - EVT_CONNECTION_COMP
1412// - EVT_CONNECTION_REQUEST
1413// - EVT_DISCONNECTION_COMP
1414// - EVT_ESCO_CONNECTION_COMP
1415// - EVT_ESCO_CONNECTION_CHANGED
1416//
1417// Bluetooth low energy meta events:
1418// - BLE_EVT_CONN_COMPLETE_EVT
1419// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1420//
1421// Next tag: 10
1422message BluetoothLinkLayerConnectionEvent {
1423 // An identifier that can be used to match events for this device.
1424 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1425 // Salt: Randomly generated 256 bit value
1426 // Hash algorithm: HMAC-SHA256
1427 // Size: 32 byte
1428 // Default: null or empty if the device identifier is not known
1429 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1430 // Connection handle of this connection if available
1431 // Range: 0x0000 - 0x0EFF (12 bits)
1432 // Default: 0xFFFF if the handle is unknown
1433 optional int32 connection_handle = 2;
1434 // Direction of the link
1435 // Default: DIRECTION_UNKNOWN
1436 optional android.bluetooth.DirectionEnum direction = 3;
1437 // Type of this link
1438 // Default: LINK_TYPE_UNKNOWN
1439 optional android.bluetooth.LinkTypeEnum type = 4;
1440
1441 // Reason metadata for this link layer connection event, rules for interpretation:
1442 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1443 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1444 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1445 // set and valid, ignore hci_ble_event
1446
1447 // HCI command associated with this event
1448 // Default: CMD_UNKNOWN
1449 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1450 // HCI event associated with this event
1451 // Default: EVT_UNKNOWN
1452 optional android.bluetooth.hci.EventEnum hci_event = 6;
1453 // HCI BLE meta event associated with this event
1454 // Default: BLE_EVT_UNKNOWN
1455 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1456 // HCI command status code if this is triggerred by hci_cmd
1457 // Default: STATUS_UNKNOWN
1458 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1459 // HCI reason code associated with this event
1460 // Default: STATUS_UNKNOWN
1461 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1462}
1463
1464
Tej Singh5d991e12018-03-09 19:48:11 -08001465/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001466 * Logs when something is plugged into or removed from the USB-C connector.
1467 *
1468 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001469 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001470 */
1471message UsbConnectorStateChanged {
1472 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001473 STATE_DISCONNECTED = 0;
1474 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001475 }
1476 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001477 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001478 // Last active session in ms.
1479 // 0 when the port is in connected state.
1480 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001481}
1482
1483/**
1484 * Logs the reported speaker impedance.
1485 *
1486 * Logged from:
1487 * Vendor audio implementation.
1488 */
1489message SpeakerImpedanceReported {
1490 optional int32 speaker_location = 1;
1491 optional int32 impedance = 2;
1492}
1493
1494/**
1495 * Logs the report of a failed hardware.
1496 *
1497 * Logged from:
1498 * Vendor HALs.
1499 *
1500 */
1501message HardwareFailed {
1502 enum HardwareType {
1503 HARDWARE_FAILED_UNKNOWN = 0;
1504 HARDWARE_FAILED_MICROPHONE = 1;
1505 HARDWARE_FAILED_CODEC = 2;
1506 HARDWARE_FAILED_SPEAKER = 3;
1507 HARDWARE_FAILED_FINGERPRINT = 4;
1508 }
1509 optional HardwareType hardware_type = 1;
1510
1511 /* hardware_location allows vendors to differentiate between multiple instances of
1512 * the same hardware_type. The specific locations are vendor defined integers,
1513 * referring to board-specific numbering schemes.
1514 */
1515 optional int32 hardware_location = 2;
1516
1517 /* failure_code is specific to the HardwareType of the failed hardware.
1518 * It should use the enum values defined below.
1519 */
1520 enum MicrophoneFailureCode {
1521 MICROPHONE_FAILURE_COMPLETE = 0;
1522 }
1523 enum CodecFailureCode {
1524 CODEC_FAILURE_COMPLETE = 0;
1525 }
1526 enum SpeakerFailureCode {
1527 SPEAKER_FAILURE_COMPLETE = 0;
1528 SPEAKER_FAILURE_HIGH_Z = 1;
1529 SPEAKER_FAILURE_SHORT = 2;
1530 }
1531 enum FingerprintFailureCode {
1532 FINGERPRINT_FAILURE_COMPLETE = 0;
1533 FINGERPRINT_SENSOR_BROKEN = 1;
1534 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1535 }
1536 optional int32 failure_code = 3;
1537}
1538
1539/**
1540 * Log an event when the device has been physically dropped.
1541 * Reported from the /vendor partition.
1542 */
1543message PhysicalDropDetected {
1544 // Confidence that the event was actually a drop, 0 -> 100
1545 optional int32 confidence_pctg = 1;
1546 // Peak acceleration of the drop, in 1/1000s of a g.
1547 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001548 // Duration of freefall in ms
1549 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001550}
1551
1552/**
1553 * Log bucketed battery charge cycles.
1554 *
1555 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001556 * a given charge point. For example, if 10 cycle buckets are
1557 * initialized, bucket 1 is the lowest 1/10th of the battery,
1558 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001559 *
1560 * Logged from:
1561 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1562 */
1563message ChargeCyclesReported {
1564 optional int32 cycle_bucket_1 = 1;
1565 optional int32 cycle_bucket_2 = 2;
1566 optional int32 cycle_bucket_3 = 3;
1567 optional int32 cycle_bucket_4 = 4;
1568 optional int32 cycle_bucket_5 = 5;
1569 optional int32 cycle_bucket_6 = 6;
1570 optional int32 cycle_bucket_7 = 7;
1571 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001572 optional int32 cycle_bucket_9 = 9;
1573 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001574}
1575
1576/**
Howard Roa46b6582018-09-18 16:45:02 -07001577 * Log battery health snapshot.
1578 *
1579 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1580 * are snapshotted periodically over 24hrs.
1581 */
1582message BatteryHealthSnapshot {
1583 enum BatterySnapshotType {
1584 UNKNOWN = 0;
1585 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1586 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1587 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1588 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1589 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1590 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1591 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1592 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1593 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1594 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1595 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1596 }
1597 optional BatterySnapshotType type = 1;
1598 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001599 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001600 // Voltage Battery Voltage, in microVolts.
1601 optional int32 voltage_micro_volt = 3;
1602 // Current Battery current, in microAmps.
1603 optional int32 current_micro_amps = 4;
1604 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1605 optional int32 open_circuit_micro_volt = 5;
1606 // Resistance Battery Resistance, in microOhms.
1607 optional int32 resistance_micro_ohm = 6;
1608 // Level Battery Level, as % of full.
1609 optional int32 level_percent = 7;
1610}
1611
1612/**
1613 * Log slow I/O operations on the primary storage.
1614 */
1615message SlowIo {
1616 // Classifications of IO Operations.
1617 enum IoOperation {
1618 UNKNOWN = 0;
1619 READ = 1;
1620 WRITE = 2;
1621 UNMAP = 3;
1622 SYNC = 4;
1623 }
1624 optional IoOperation operation = 1;
1625
1626 // The number of slow IO operations of this type over 24 hours.
1627 optional int32 count = 2;
1628}
1629
1630/**
1631 * Log battery caused shutdown with the last recorded voltage.
1632 */
1633message BatteryCausedShutdown {
1634 // The last recorded battery voltage prior to shutdown.
1635 optional int32 last_recorded_micro_volt = 1;
1636}
1637
1638/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001639 * Logs the duration of a davey (jank of >=700ms) when it occurs
1640 *
1641 * Logged from:
1642 * frameworks/base/libs/hwui/JankTracker.cpp
1643 */
1644message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001645 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001646 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001647
Tej Singhbb8554a2018-01-26 11:59:14 -08001648 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001649 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001650}
1651
1652/**
Bookatze5885242017-10-24 20:10:31 -07001653 * Logs phone signal strength changes.
1654 *
1655 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001656 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001657 */
1658message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001659 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1660 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001661}
1662
Yangster4ccebea2018-10-09 17:09:02 -07001663
1664/**
1665 * Logs when the phone state, sim state or signal strength changes
1666 *
1667 * Logged from:
1668 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1669 */
1670message PhoneServiceStateChanged {
1671 optional android.telephony.ServiceStateEnum state = 1;
1672 optional android.telephony.SimStateEnum sim_state = 2;
1673 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1674}
1675
1676/**
1677 * Logs when the phone becomes on or off.
1678 *
1679 * Logged from:
1680 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1681 */
1682message PhoneStateChanged {
1683 enum State {
1684 OFF = 0;
1685 ON = 1;
1686 }
1687 optional State state = 1;
1688}
1689
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001690message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001691 optional android.stats.launcher.LauncherAction action = 1;
1692 optional android.stats.launcher.LauncherState src_state = 2;
1693 optional android.stats.launcher.LauncherState dst_state = 3;
1694 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001695 optional bool is_swipe_up_enabled = 5;
1696}
1697
David Chenc28b2bb2017-10-24 12:52:52 -07001698/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001699 * Logs when Settings UI has changed.
1700 *
1701 * Logged from:
1702 * packages/apps/Settings
1703 */
1704message SettingsUIChanged {
1705 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001706 * Where this SettingsUIChange event comes from. For example, if
1707 * it's a PAGE_VISIBLE event, where the page is opened from.
1708 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001709 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001710
1711 /**
1712 * What the UI action is.
1713 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001714 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001715
1716 /**
1717 * Where the action is happening
1718 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001719 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001720
1721 /**
1722 * What preference changed in this event.
1723 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001724 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001725
1726 /**
1727 * The new value of the changed preference.
1728 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001729 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001730}
1731
1732/**
David Chenc28b2bb2017-10-24 12:52:52 -07001733 * Logs that a setting was updated.
1734 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001735 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001736 * The tag and is_default allow resetting of settings to default values based on the specified
1737 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1738 */
1739message SettingChanged {
1740 // The name of the setting.
1741 optional string setting = 1;
1742
1743 // The change being imposed on this setting. May represent a number, eg "3".
1744 optional string value = 2;
1745
1746 // The new value of this setting. For most settings, this is same as value. For some settings,
1747 // value is +X or -X where X represents an element in a set. For example, if the previous value
1748 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1749 // The +/- feature is currently only used for location_providers_allowed.
1750 optional string new_value = 3;
1751
1752 // The previous value of this setting.
1753 optional string prev_value = 4;
1754
1755 // The tag used with the is_default for resetting sets of settings. This is generally null.
1756 optional string tag = 5;
1757
Bookatz90867622018-01-31 15:05:57 -08001758 // True if this setting with tag should be resettable.
1759 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001760
David Chenbd789912018-03-16 17:19:55 -07001761 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001762 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001763
1764 enum ChangeReason {
1765 UPDATED = 1; // Updated can be an insertion or an update.
1766 DELETED = 2;
1767 }
1768 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001769}
Chenjie Yub3dda412017-10-24 13:41:59 -07001770
Chenjie Yu05013b32017-11-21 10:21:41 -08001771/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001772 * Logs activity going to foreground or background
1773 *
1774 * Logged from:
1775 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1776 */
1777message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001778 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001779 optional string pkg_name = 2;
1780 optional string class_name = 3;
1781
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001782 enum State {
1783 BACKGROUND = 0;
1784 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001785 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001786 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001787}
David Chenc8a43242017-10-17 16:23:28 -07001788
1789/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001790 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001791 * Logged from:
1792 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1793 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001794message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001795 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001796
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001797 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001798
1799 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001800 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001801 optional string process_name = 3;
1802
1803 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001804 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001805
1806 optional string package_name = 5;
1807
1808 enum InstantApp {
1809 UNAVAILABLE = 0;
1810 FALSE = 1;
1811 TRUE = 2;
1812 }
1813 optional InstantApp is_instant_app = 6;
1814
1815 enum ForegroundState {
1816 UNKNOWN = 0;
1817 BACKGROUND = 1;
1818 FOREGROUND = 2;
1819 }
1820 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001821
1822 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001823}
David Chen9e3808c2017-11-20 17:25:34 -08001824
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001825/**
1826 * Logs when a WTF (What a Terrible Failure) happened.
1827 * Logged from:
1828 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1829 */
1830message WTFOccurred {
1831 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001832
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001833 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001834
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001835 // The name of the process.
1836 // system_server if it is not by an app
1837 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001838
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001839 // The pid if available. -1 means not available.
1840 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001841
1842 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001843}
1844
1845/**
1846 * Logs when system server reports low memory.
1847 * Logged from:
1848 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1849 */
1850message LowMemReported {
1851}
1852
1853/**
1854 * Logs when an app ANR (App Not Responding) occurs.
1855 * Logged from:
1856 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1857 */
1858message ANROccurred {
1859 optional int32 uid = 1 [(is_uid) = true];
1860
1861 optional string process_name = 2;
1862
1863 optional string short_component_name = 3;
1864
1865 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001866
1867 enum InstantApp {
1868 UNAVAILABLE = 0;
1869 FALSE = 1;
1870 TRUE = 2;
1871 }
1872 optional InstantApp is_instant_app = 5;
1873
1874 enum ForegroundState {
1875 UNKNOWN = 0;
1876 BACKGROUND = 1;
1877 FOREGROUND = 2;
1878 }
1879 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001880
1881 optional android.server.ErrorSource error_source = 7;
1882
1883 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001884}
1885
Bookatza7020bd2018-08-28 16:29:35 -07001886/**
1887 * Logs when the vibrator state changes.
1888 * Logged from:
1889 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1890 */
1891message VibratorStateChanged {
1892 repeated AttributionNode attribution_node = 1;
1893
1894 enum State {
1895 OFF = 0;
1896 ON = 1;
1897 }
1898 optional State state = 2;
1899
1900 // Duration (in milliseconds) requested to keep the vibrator on.
1901 // Only applicable for State == ON.
1902 optional int64 duration_millis = 3;
1903}
1904
David Chen0a368b22017-12-06 16:28:16 -08001905/*
1906 * Allows other apps to push events into statsd.
1907 * Logged from:
1908 * frameworks/base/core/java/android/util/StatsLog.java
1909 */
David Chen0b5c90c2018-01-25 16:51:49 -08001910message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001911 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001912 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001913
1914 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1915 optional int32 label = 2;
1916
1917 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1918 // predicates for the metrics).
1919 enum State {
1920 UNKNOWN = 0;
1921 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1922 STOP = 2;
1923 START = 3;
1924 }
1925 optional State state = 3;
1926}
1927
David Chen9e3808c2017-11-20 17:25:34 -08001928/**
Bookatz7948c872018-09-04 12:58:33 -07001929 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1930 * For example, this could be due to the user manually changing the time.
1931 *
1932 * Logged from:
1933 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1934 */
1935message WallClockTimeShifted {
1936 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1937 optional int64 wall_clock_timestamp_millis = 1;
1938}
1939
1940/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001941 * Logs when statsd detects an anomaly.
1942 *
1943 * Logged from:
1944 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1945 */
1946message AnomalyDetected {
1947 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001948 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001949
Yangster-mac94e197c2018-01-02 16:03:03 -08001950 // Id of the config whose anomaly detection alert fired.
1951 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001952
Yangster-mac94e197c2018-01-02 16:03:03 -08001953 // Id of the alert (i.e. name of the anomaly that was detected).
1954 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001955}
1956
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001957message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001958 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001959 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001960
1961 // The app package name.
1962 optional string pkg_name = 2;
1963
1964 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001965 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001966 WARM = 1;
1967 HOT = 2;
1968 COLD = 3;
1969 }
1970 // The transition type.
1971 optional TransitionType type = 3;
1972
1973 // The activity name.
1974 optional string activity_name = 4;
1975
1976 // The name of the calling app. Empty if not set.
1977 optional string calling_pkg_name = 5;
1978
1979 // Whether the app is an instant app.
1980 optional bool is_instant_app = 6;
1981
1982 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001983 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001984
Bookatz80d11a02018-01-16 10:46:35 -08001985 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001986
David Chen0b5c90c2018-01-25 16:51:49 -08001987 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001988 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001989 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001990 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001991 optional int32 bind_application_delay_millis = 11;
1992 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001993
1994 // Empty if not set.
1995 optional string launch_token = 13;
1996
Calin Juravle759fbda2018-02-20 19:52:30 +00001997 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001998 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001999
2000 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002001 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002002}
2003
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002004message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002005 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002006 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002007
2008 // The app package name.
2009 optional string pkg_name = 2;
2010
2011 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002012 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002013 WARM = 1;
2014 HOT = 2;
2015 COLD = 3;
2016 }
2017 // The transition type.
2018 optional TransitionType type = 3;
2019
2020 // The activity name.
2021 optional string activity_name = 4;
2022}
2023
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002024message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002025 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002026 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002027
2028 // The app package name.
2029 optional string pkg_name = 2;
2030
2031 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002032 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002033 WITH_BUNDLE = 1;
2034 WITHOUT_BUNDLE = 2;
2035 }
2036 // The transition type.
2037 optional TransitionType type = 3;
2038
2039 // The activity name.
2040 optional string activity_name = 4;
2041
2042 optional bool transition_process_running = 5;
2043
2044 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002045 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002046}
2047
Bookatz8fcd09a2017-12-18 13:01:10 -08002048/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002049 * Logs a picture-in-picture action
2050 * Logged from:
2051 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2052 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2053 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2054 */
2055message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002056 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002057 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002058
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002059 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002060
Chenjie Yu52cacc62017-12-08 18:11:45 -08002061 enum State {
2062 ENTERED = 1;
2063 EXPANDED_TO_FULL_SCREEN = 2;
2064 MINIMIZED = 3;
2065 DISMISSED = 4;
2066 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002067 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002068}
2069
2070/**
Chenjie Yue8904192017-12-08 19:12:57 -08002071 * Logs overlay action
2072 * Logged from:
2073 * services/core/java/com/android/server/wm/Session.java
2074 */
2075message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002076 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002077
2078 optional string package_name = 2;
2079
2080 optional bool using_alert_window = 3;
2081
2082 enum State {
2083 ENTERED = 1;
2084 EXITED = 2;
2085 }
2086 optional State state = 4;
2087}
2088
Chenjie Yuccfe6452018-01-30 11:33:21 -08002089/*
2090 * Logs foreground service starts and stops.
2091 * Note that this is not when a service starts or stops, but when it is
2092 * considered foreground.
2093 * Logged from
2094 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2095 */
2096message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002097 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002098 // package_name + "/" + class_name
2099 optional string short_name = 2;
2100
2101 enum State {
2102 ENTER = 1;
2103 EXIT = 2;
2104 }
2105 optional State state = 3;
2106}
2107
Chenjie Yue8904192017-12-08 19:12:57 -08002108/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002109 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2110 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2111 * attributed back to the parent (host) uid. One example is Chrome.
2112 *
2113 * Logged from:
2114 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2115 */
2116message IsolatedUidChanged {
2117 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002118 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002119 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002120 optional int32 parent_uid = 1;
2121
2122 optional int32 isolated_uid = 2;
2123
2124 // We expect an isolated uid to be removed before if it's used for another parent uid.
2125 enum Event {
2126 REMOVED = 0;
2127 CREATED = 1;
2128 }
2129 optional Event event = 3;
2130}
2131
2132/*
2133 * Logs the reception of an incoming network packet causing the main system to wake up for
2134 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2135 * and processed by WakeupController.cpp.
2136 */
2137message PacketWakeupOccurred {
2138 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2139 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002140 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002141 // The interface name on which the packet was received.
2142 optional string iface = 2;
2143 // The ethertype value of the packet.
2144 optional int32 ethertype = 3;
2145 // String representation of the destination MAC address of the packet.
2146 optional string destination_hardware_address = 4;
2147 // String representation of the source address of the packet if this was an IP packet.
2148 optional string source_ip = 5;
2149 // String representation of the destination address of the packet if this was an IP packet.
2150 optional string destination_ip = 6;
2151 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2152 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2153 // families.
2154 optional int32 ip_next_header = 7;
2155 // The source port if this was a TCP or UDP packet.
2156 optional int32 source_port = 8;
2157 // The destination port if this was a TCP or UDP packet.
2158 optional int32 destination_port = 9;
2159}
2160
2161/*
2162 * Logs the memory stats for an app on startup.
2163 * Logged from:
2164 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2165 */
2166message AppStartMemoryStateCaptured {
2167 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002168 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002169
2170 // The process name.
2171 optional string process_name = 2;
2172
2173 // The activity name.
2174 optional string activity_name = 3;
2175
2176 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002177 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002178
2179 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002180 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002181
2182 // RSS
2183 optional int64 rss_in_bytes = 6;
2184
2185 // CACHE
2186 optional int64 cache_in_bytes = 7;
2187
2188 // SWAP
2189 optional int64 swap_in_bytes = 8;
2190}
2191
2192/*
2193 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2194 * for LMK event.
2195 * Logged from:
2196 * system/core/lmkd/lmkd.c
2197 */
2198message LmkStateChanged {
2199 enum State {
2200 UNKNOWN = 0;
2201 START = 1;
2202 STOP = 2;
2203 }
2204 optional State state = 1;
2205}
2206
2207/*
2208 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2209 * Logged from:
2210 * system/core/lmkd/lmkd.c
2211 */
2212message LmkKillOccurred {
2213 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002214 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002215
2216 // The process name.
2217 optional string process_name = 2;
2218
2219 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002220 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002221
2222 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002223 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002224
2225 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002226 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002227
2228 // RSS
2229 optional int64 rss_in_bytes = 6;
2230
2231 // CACHE
2232 optional int64 cache_in_bytes = 7;
2233
2234 // SWAP
2235 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002236
2237 // The elapsed real time of start of the process.
2238 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002239}
2240
Rajeev Kumar51b54602018-03-01 12:18:26 -08002241/*
2242 * Logs when the ActivityManagerService detects that an app died.
2243 *
2244 * Logged from:
2245 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2246 */
2247message AppDied {
2248 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002249 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002250}
2251
Howard Ro21a039c2018-08-06 14:55:47 -07002252/**
2253 * An atom for generic metrics logging. Available from Android Q.
2254 */
2255message GenericAtom {
2256 // The uid of the application that sent this custom atom.
2257 optional int32 uid = 1 [(is_uid) = true];
2258
2259 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002260 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002261}
2262
Tej Singhd6d6d772018-09-05 17:41:25 -07002263/**
2264 * Logs when a fingerprint acquire event occurs.
2265 *
2266 * Logged from:
2267 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2268 */
2269message FingerprintAcquired {
2270 // The associated user. Eg: 0 for owners, 10+ for others.
2271 // Defined in android/os/UserHandle.java
2272 optional int32 user = 1;
2273 // If this acquire is for a crypto fingerprint.
2274 // e.g. Secure purchases, unlock password storage.
2275 optional bool is_crypto = 2;
2276}
2277
2278/**
2279 * Logs when a fingerprint authentication event occurs.
2280 *
2281 * Logged from:
2282 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2283 */
2284message FingerprintAuthenticated {
2285 // The associated user. Eg: 0 for owners, 10+ for others.
2286 // Defined in android/os/UserHandle.java
2287 optional int32 user = 1;
2288 // If this authentication is for a crypto fingerprint.
2289 // e.g. Secure purchases, unlock password storage.
2290 optional bool is_crypto = 2;
2291 // Whether or not this authentication was successful.
2292 optional bool is_authenticated = 3;
2293}
2294
2295/**
2296 * Logs when a fingerprint error occurs.
2297 *
2298 * Logged from:
2299 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2300 */
2301message FingerprintErrorOccurred {
2302 // The associated user. Eg: 0 for owners, 10+ for others.
2303 // Defined in android/os/UserHandle.java
2304 optional int32 user = 1;
2305 // If this error is for a crypto fingerprint.
2306 // e.g. Secure purchases, unlock password storage.
2307 optional bool is_crypto = 2;
2308
2309 enum Error {
2310 UNKNOWN = 0;
2311 LOCKOUT = 1;
2312 PERMANENT_LOCKOUT = 2;
2313 }
2314 // The type of error.
2315 optional Error error = 3;
2316}
Howard Ro688ae182018-09-25 00:09:36 -07002317
2318message Notification {
2319
2320 // Type of notification event.
2321 enum Type {
2322 TYPE_UNKNOWN = 0;
2323 // Notification became visible to the user.
2324 TYPE_OPEN = 1;
2325 // Notification became hidden.
2326 TYPE_CLOSE = 2;
2327 // Notification switched to detail mode.
2328 TYPE_DETAIL = 3;
2329 // Notification was clicked.
2330 TYPE_ACTION = 4;
2331 // Notification was dismissed.
2332 TYPE_DISMISS = 5;
2333 // Notification switched to summary mode. The enum value of 14 is to
2334 // match that of metrics_constants.
2335 TYPE_COLLAPSE = 14;
2336 }
2337 optional Type type = 1;
2338
2339 // Package name associated with the notification.
2340 optional string package_name = 2;
2341
2342 // Tag associated with notification.
2343 optional string tag = 3;
2344
2345 // Application-supplied ID associated with the notification.
2346 optional int32 id = 4;
2347
2348 // Index of notification in the notification panel.
2349 optional int32 shade_index = 5;
2350
2351 // The number of notifications in the notification panel.
2352 optional int32 shade_count = 6;
2353
2354 // Importance for the notification.
2355 optional int32 importance = 7;
2356
2357 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002358 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002359
2360 // Importance for the notification channel.
2361 optional int32 channel_importance = 9;
2362
Howard Ro183c2bd2018-10-18 13:52:10 -07002363 // Application-supplied ID associated with the notifications group.
2364 optional string group_id = 10;
2365
Howard Ro688ae182018-09-25 00:09:36 -07002366 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002367 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002368
Howard Ro183c2bd2018-10-18 13:52:10 -07002369 // Reason for dismissal of a notification. This field is only meaningful for
2370 // TYPE_DISMISS events.
2371 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002372
Howard Ro183c2bd2018-10-18 13:52:10 -07002373 // The first post time of notification, stable across updates.
2374 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002375
Howard Ro183c2bd2018-10-18 13:52:10 -07002376 // The most recent interruption time, or the creation time if no updates.
2377 // Differs from update_millis because updates are filtered based on whether
2378 // they actually interrupted the user.
2379 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002380
Howard Ro183c2bd2018-10-18 13:52:10 -07002381 // The most recent update time, or the creation time if no updates.
2382 optional int64 update_millis = 15;
2383
2384 // The most recent visibility event.
2385 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002386}
2387
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002388/*
Yangster-macb89807e2018-11-15 21:10:57 -08002389 * Logs when a flag flip state changes.
2390 * Logged in P/h.
2391 */
2392message PhenotypeFlagStateChanged {
2393 // Mendel configuration name.
2394 optional string mendel_config_name = 1;
2395 // State
2396 enum State {
2397 STATE_UNKNOWN = 0;
2398 COMMITTED = 1;
2399 }
2400 optional State state = 2;
2401}
2402
2403/*
2404 * Logs when a binary push state changes.
2405 * Logged in Play store
2406 */
2407message BinaryPushStateChanged {
2408 // Binary package name.
2409 optional string binary_name = 1;
2410 // Version code.
2411 optional int64 version = 2;
2412 // State
2413 enum State {
2414 STATE_UNKNOWN = 0;
2415 DOWNLOAD_START = 1;
2416 DOWNLOAD_DONE = 2;
2417 INSTALL_START = 3;
2418 INSTALL_DONE = 4;
2419 REBOOT_START = 5;
2420 REBOOT_DONE = 6;
2421 }
2422 optional State state = 3;
2423}
2424
2425/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002426 * Logs when a connection becomes available and lost.
2427 * Logged in StatsCompanionService.java
2428 */
2429message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002430 // Id of the network.
2431 optional int32 net_id = 1;
2432
2433 enum State {
2434 UNKNOWN = 0;
2435 CONNECTED = 1;
2436 DISCONNECTED = 2;
2437 }
2438 // Connected state of a network.
2439 optional State state = 2;
2440}
2441
2442/**
2443 * Logs when a service starts and stops.
2444 * Logged from:
2445 * services/core/java/com/android/server/am/ActiveServices.java
2446 */
2447message ServiceStateChanged {
2448
2449 optional int32 uid = 1 [(is_uid) = true];
2450
2451 optional string package_name = 2;
2452
2453 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002454
2455 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002456 START = 1;
2457 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002458 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002459
2460 optional State state = 4;
2461}
2462
2463/**
2464 * Logs when a service is launched.
2465 * Logged from:
2466 * services/core/java/com/android/server/am/ActiveServices.java
2467 */
2468message ServiceLaunchReported {
2469
2470 optional int32 uid = 1 [(is_uid) = true];
2471
2472 optional string package_name = 2;
2473
2474 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002475}
Howard Ro688ae182018-09-25 00:09:36 -07002476
Chenjie Yubbcbc602018-02-05 16:51:52 -08002477//////////////////////////////////////////////////////////////////////
2478// Pulled atoms below this line //
2479//////////////////////////////////////////////////////////////////////
2480
2481/**
David Chenc8a43242017-10-17 16:23:28 -07002482 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2483 *
2484 * Pulled from:
2485 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2486 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002487message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002488 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002489
2490 optional int64 rx_bytes = 2;
2491
2492 optional int64 rx_packets = 3;
2493
2494 optional int64 tx_bytes = 4;
2495
2496 optional int64 tx_packets = 5;
2497}
2498
2499/**
2500 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2501 *
2502 * Pulled from:
2503 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2504 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002505message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002506 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002507
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002508 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2509 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002510
2511 optional int64 rx_bytes = 3;
2512
2513 optional int64 rx_packets = 4;
2514
2515 optional int64 tx_bytes = 5;
2516
2517 optional int64 tx_packets = 6;
2518}
2519
2520/**
2521 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2522 *
2523 * Pulled from:
2524 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2525 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002526message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002527 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002528
2529 optional int64 rx_bytes = 2;
2530
2531 optional int64 rx_packets = 3;
2532
2533 optional int64 tx_bytes = 4;
2534
2535 optional int64 tx_packets = 5;
2536}
2537
2538/**
2539 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2540 *
2541 * Pulled from:
2542 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2543 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002544message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002545 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002546
Yao Chenc40a19d2018-03-15 16:48:25 -07002547 // 1 denotes foreground and 0 denotes background. This is called Set in
2548 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002549 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002550
2551 optional int64 rx_bytes = 3;
2552
2553 optional int64 rx_packets = 4;
2554
2555 optional int64 tx_bytes = 5;
2556
2557 optional int64 tx_packets = 6;
2558}
2559
2560/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002561 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2562 *
2563 * Pulled from:
2564 * StatsCompanionService
2565 */
2566message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002567 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002568
2569 optional int64 rx_bytes = 2;
2570
2571 optional int64 tx_bytes = 3;
2572}
2573
2574/**
David Chenc8a43242017-10-17 16:23:28 -07002575 * Pulls the kernel wakelock durations. This atom is adapted from
2576 * android/internal/os/KernelWakelockStats.java
2577 *
2578 * Pulled from:
2579 * StatsCompanionService using KernelWakelockReader.
2580 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002581message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002582 optional string name = 1;
2583
2584 optional int32 count = 2;
2585
2586 optional int32 version = 3;
2587
Yangster-maca8a30442018-10-13 23:46:34 -07002588 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002589}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002590
Chenjie Yu05013b32017-11-21 10:21:41 -08002591/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002592 * Pulls low power state information. If power.stats HAL is not available, this
2593 * includes platform and subsystem sleep state information,
2594 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2595 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002596 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002597 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002598 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2599 * as defined in:
2600 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002601 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002602message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002603 // Subsystem name
2604 optional string subsystem_name = 1;
2605 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2606 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002607 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2608 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002609 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002610 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002611 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002612 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002613 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002614}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002615
Chenjie Yu05013b32017-11-21 10:21:41 -08002616/**
Bookatz92da2832018-11-01 18:10:03 -07002617 * Pulls on-device power measurement information.
2618 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2619 * Pulled from:
2620 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2621 */
2622message OnDevicePowerMeasurement {
2623 // Name of the subsystem (to which the rail belongs).
2624 optional string subsystem_name = 1;
2625
2626 // Rail name. The rail lies within the subsystem.
2627 optional string rail_name = 2;
2628
2629 // Time (in ms since boot) at which the rail energy value was measured.
2630 // This may differ slightly from the time that statsd logs this information.
2631 optional uint64 measurement_timestamp_millis = 3;
2632
2633 // Accumulated energy used via the rail since device boot in uWs.
2634 optional uint64 energy_microwatt_secs = 4;
2635}
2636
2637/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002638 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002639 * Pulls the time the cpu spend on the frequency index. Frequency index
2640 * starts from highest to lowest. The value should be monotonically
2641 * increasing since boot. However, if there is a cpu
2642 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002643 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002644message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002645 optional uint32 cluster = 1;
2646 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002647 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002648}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002649
Chenjie Yu05013b32017-11-21 10:21:41 -08002650/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002651 * Pulls Cpu Time Per Uid.
2652 * Note that isolated process uid time should be attributed to host uids.
2653 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002654message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002655 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002656 optional uint64 user_time_micros = 2;
2657 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002658}
2659
2660/**
2661 * Pulls Cpu Time Per Uid per frequency.
2662 * Note that isolated process uid time should be attributed to host uids.
2663 * For each uid, we order the time by descending frequencies.
2664 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002665message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002666 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002667 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002668 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002669}
Hugo Benichi884970e2017-11-14 22:42:46 +09002670
Chenjie Yu05013b32017-11-21 10:21:41 -08002671/**
2672 * Pulls Wifi Controller Activity Energy Info
2673 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002674message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002675 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002676 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002677 // stack reported state
2678 // TODO: replace this with proto enum
2679 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002680 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002681 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002682 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002683 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002684 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002685 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002686 // product of current(mA), voltage(V) and time(ms)
2687 optional uint64 controller_energy_used = 6;
2688}
2689
2690/**
2691 * Pulls Modem Activity Energy Info
2692 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002693message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002694 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002695 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002696 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002697 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002698 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002699 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002700 /**
2701 * Tx power index
2702 * index 0 = tx_power < 0dBm
2703 * index 1 = 0dBm < tx_power < 5dBm
2704 * index 2 = 5dBm < tx_power < 15dBm
2705 * index 3 = 15dBm < tx_power < 20dBm
2706 * index 4 = tx_power > 20dBm
2707 */
2708 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002709 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002710 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002711 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002712 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002713 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002714 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002715 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002716 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002717 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002718 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002719 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002720 // product of current(mA), voltage(V) and time(ms)
2721 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002722}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002723
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002724/**
2725 * Pulls Bluetooth Activity Energy Info
2726 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2727 */
2728message BluetoothActivityInfo {
2729 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002730 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002731 // bluetooth stack state
2732 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002733 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002734 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002735 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002736 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002737 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002738 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002739 // product of current(mA), voltage(V) and time(ms)
2740 optional uint64 energy_used = 6;
2741}
2742
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002743/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002744 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002745 *
2746 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002747 */
2748message ProcessMemoryState {
2749 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002750 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002751
2752 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002753 // Usually package name, "system" for system server.
2754 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002755 optional string process_name = 2;
2756
Rafal Slawikda51b932018-12-13 16:31:33 +00002757 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002758 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002759
2760 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002761 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002762
2763 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002764 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002765
Rajeev Kumar90235992018-01-29 11:06:48 -08002766 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002767 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2768 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002769 optional int64 rss_in_bytes = 6;
2770
2771 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002772 // Value is read from memory.stat, field total_cache if per-app memory
2773 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002774 optional int64 cache_in_bytes = 7;
2775
2776 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002777 // Value is read from memory.stat, field total_swap if per-app memory
2778 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002779 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002780
Rafal Slawikd03ae422018-11-20 11:27:45 +00002781 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002782 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002783
2784 // Elapsed real time when the process started.
2785 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2786 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002787}
2788
2789/*
Rafal Slawik08621582018-10-15 14:53:07 +01002790 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002791 *
2792 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002793 */
2794message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002795 // The uid if available. -1 means not available.
2796 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002797
Rafal Slawikbf67d072018-10-23 11:07:54 +01002798 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002799 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002800 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002801
Rafal Slawikbf67d072018-10-23 11:07:54 +01002802 // # of page-faults
2803 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002804
Rafal Slawikbf67d072018-10-23 11:07:54 +01002805 // # of major page-faults
2806 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002807
Rafal Slawikbf67d072018-10-23 11:07:54 +01002808 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002809 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002810 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002811
Rafal Slawikd03ae422018-11-20 11:27:45 +00002812 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002813 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002814
2815 // Elapsed real time when the process started.
2816 // Value is read from /proc/PID/stat, field 22.
2817 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002818}
2819
2820/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002821 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002822 *
2823 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
2824 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00002825 *
2826 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002827 */
2828message ProcessMemoryHighWaterMark {
2829 // The uid if available. -1 means not available.
2830 optional int32 uid = 1 [(is_uid) = true];
2831
Rafal Slawikda51b932018-12-13 16:31:33 +00002832 // The process name.
2833 // Usually package name or process cmdline.
2834 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002835 optional string process_name = 2;
2836
2837 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2838 // /proc/PID/status.
2839 optional int64 rss_high_water_mark_in_bytes = 3;
2840}
2841
2842/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002843 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002844 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002845message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002846 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002847}
2848
2849/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002850 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002851 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002852message SystemUptime {
2853 // Milliseconds since the system was booted.
2854 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2855 // for external input).
2856 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002857 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002858}
2859
2860/*
2861 * Reads from /proc/uid_concurrent_active_time which has the format:
2862 * active: X (X is # cores)
2863 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2864 * [uid1]: [time-0] [time-1] [time-2] ... ...
2865 * ...
2866 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2867 * The file contains a monotonically increasing count of time for a single boot.
2868 */
2869message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002870 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002871 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002872}
2873
2874/**
2875 * Reads from /proc/uid_concurrent_policy_time which has the format:
2876 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2877 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2878 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2879 * ...
2880 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2881 * The file contains a monotonically increasing count of time for a single boot.
2882 */
2883message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002884 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002885 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002886 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002887}
2888
2889/*
2890 * Pulls free disk space, for data, system partition and temporary directory.
2891 */
2892message DiskSpace {
2893 // available bytes in data partition
2894 optional uint64 data_available_bytes = 1;
2895 // available bytes in system partition
2896 optional uint64 system_available_bytes = 2;
2897 // available bytes in download cache or temp directories
2898 optional uint64 temp_available_bytes = 3;
2899}
Tej Singhbf972d92018-01-10 20:51:13 -08002900
2901/**
2902 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002903 * Pulled from:
2904 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002905 */
2906message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002907 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002908}
2909
2910/**
2911 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002912 * Pulled from:
2913 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002914 */
2915message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002916 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002917}
2918
2919/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002920 * Pulls battery voltage.
2921 * Pulled from:
2922 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2923 */
2924message BatteryVoltage {
2925 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07002926 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07002927}
2928
2929/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08002930 * Pulls battery level (percent full, from 0 to 100).
2931 *
2932 * Pulled from:
2933 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2934 */
2935message BatteryLevel {
2936 // Battery level. Should be in [0, 100].
2937 optional int32 battery_level = 1;
2938}
2939
2940/**
Tej Singhd89137e2018-03-26 14:51:40 -07002941 * Pulls the temperature of various parts of the device.
2942 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002943 *
2944 * Pulled from:
2945 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2946 */
2947message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08002948 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08002949 optional android.os.TemperatureTypeEnum sensor_location = 1;
2950
2951 // The name of the temperature source. Eg. CPU0
2952 optional string sensor_name = 2;
2953
Tej Singhd89137e2018-03-26 14:51:40 -07002954 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08002955 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07002956 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08002957}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002958
2959/**
2960 * Pulls the statistics of calls to Binder.
2961 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002962 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2963 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002964 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002965 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002966 */
2967message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002968 // UID of the process responsible for the binder transaction. It will be set if the process
2969 // executing the binder transaction attribute the transaction to another uid using
2970 // Binder.setThreadWorkSource().
2971 //
2972 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002973 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002974 // UID of the process executing the binder transaction.
2975 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002976 // Fully qualified class name of the API call.
2977 //
2978 // This is a system server class name.
2979 //
2980 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2981 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2982 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2983 // commonly used APIs.
2984 optional string service_class_name = 2;
2985 // Method name of the API call. It can also be a transaction code if we cannot
2986 // resolve it to a name. See Binder#getTransactionName.
2987 //
2988 // This is a system server method name.
2989 optional string service_method_name = 3;
2990 // Total number of API calls.
2991 optional int64 call_count = 4;
2992 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2993 optional bool screen_interactive = 13;
2994 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2995 // call_count will be equal to recorded_call_count.
2996 //
2997 // If recorded_call_count is different than call_count, it means data collection has been
2998 // sampled. All the fields below will be sampled in this case.
2999 optional int64 recorded_call_count = 12;
3000 // Number of exceptions thrown by the API.
3001 optional int64 recorded_exception_count = 5;
3002 // Total latency of all API calls.
3003 // Average can be computed using total_latency_micros / recorded_call_count.
3004 optional int64 recorded_total_latency_micros = 6;
3005 // Maximum latency of one API call.
3006 optional int64 recorded_max_latency_micros = 7;
3007 // Total CPU usage of all API calls.
3008 // Average can be computed using total_cpu_micros / recorded_call_count.
3009 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3010 optional int64 recorded_total_cpu_micros = 8;
3011 // Maximum CPU usage of one API call.
3012 optional int64 recorded_max_cpu_micros = 9;
3013 // Maximum parcel reply size of one API call.
3014 optional int64 recorded_max_reply_size_bytes = 10;
3015 // Maximum parcel request size of one API call.
3016 optional int64 recorded_max_request_size_bytes = 11;
3017}
3018
3019/**
3020 * Pulls the statistics of exceptions during calls to Binder.
3021 *
3022 * Binder stats are cumulative from boot unless somebody reset the data using
3023 * > adb shell dumpsys binder_calls_stats --reset
3024 */
3025message BinderCallsExceptions {
3026 // Exception class name, e.g. java.lang.IllegalArgumentException.
3027 //
3028 // This is an exception class name thrown by the system server.
3029 optional string exception_class_name = 1;
3030 // Total number of exceptions.
3031 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003032}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003033
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003034/**
3035 * Pulls the statistics of message dispatching on HandlerThreads.
3036 *
3037 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3038 * config on the device.
3039 *
3040 * Next tag: 11
3041 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003042message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003043 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003044 optional int32 uid = 1 [(is_uid) = true];
3045
3046 // Fully qualified class name of the handler target class.
3047 //
3048 // This field does not contain PII. This is a system server class name.
3049 optional string handler_class_name = 2;
3050
3051 // The name of the thread that runs the Looper.
3052 //
3053 // This field does not contain PII. This is a system server thread name.
3054 optional string looper_thread_name = 3;
3055
3056 // The name of the dispatched message.
3057 //
3058 // This field does not contain PII. This is a system server constant or class
3059 // name.
3060 optional string message_name = 4;
3061
3062 // Total number of successfully dispatched messages.
3063 optional int64 message_count = 5;
3064
3065 // Total number of messages that failed dispatching.
3066 optional int64 exception_count = 6;
3067
3068 // Total number of processed messages we have data recorded for. If we
3069 // collected data for all the messages, message_count will be equal to
3070 // recorded_message_count.
3071 //
3072 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003073 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003074 optional int64 recorded_message_count = 7;
3075
3076 // Total latency of all processed messages.
3077 // Average can be computed using recorded_total_latency_micros /
3078 // recorded_message_count.
3079 optional int64 recorded_total_latency_micros = 8;
3080
3081 // Total CPU usage of all processed message.
3082 // Average can be computed using recorded_total_cpu_micros /
3083 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003084 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003085 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003086
3087 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3088 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003089
3090 // Max recorded CPU usage of all processed messages.
3091 optional int64 recorded_max_cpu_micros = 11;
3092
3093 // Max recorded latency of all processed messages.
3094 optional int64 recorded_max_latency_micros = 12;
3095
3096 // Total number of messages we tracked the dispatching delay for. If we
3097 // collected data for all the messages, message_count will be equal to
3098 // recorded_delay_message_count.
3099 //
3100 // If recorded_delay_message_count is different than message_count, it means data
3101 // collection has been sampled or/and not all messages specified the target dispatch time.
3102 // The fields below will be sampled in this case.
3103 optional int64 recorded_delay_message_count = 13;
3104
3105 // Total dispatching delay of all processed messages.
3106 // Calculated as a difference between the target dispatching time (Message.when)
3107 // and the actual dispatching time.
3108 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3109 optional int64 recorded_total_delay_millis = 14;
3110
3111 // Max dispatching delay of all processed messages.
3112 // Calculated as a difference between the target dispatching time (Message.when)
3113 // and the actual dispatching time.
3114 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003115}
Tej Singh86dc9db2018-09-06 00:39:57 +00003116
3117/**
3118 * Pulls disk information, such as write speed and latency.
3119 */
3120message DiskStats {
3121 // Time taken to open, write 512B to, and close a file.
3122 // -1 if error performing the check.
3123 optional int64 data_write_latency_millis = 1;
3124
3125 optional bool file_based_encryption = 2;
3126
3127 // Recent disk write speed in kB/s.
3128 // -1 if error querying storageed.
3129 // 0 if data is unavailable.
3130 optional int32 recent_disk_write_speed = 3;
3131}
3132
3133
3134/**
3135 * Free and total bytes of the Data, Cache, and System partition.
3136 */
3137message DirectoryUsage {
3138 enum Directory {
3139 UNKNOWN = 0;
3140 DATA = 1;
3141 CACHE = 2;
3142 SYSTEM = 3;
3143 }
3144 optional Directory directory = 1;
3145 optional int64 free_bytes = 2;
3146 optional int64 total_bytes = 3;
3147}
3148
3149
3150/**
3151 * Size of an application: apk size, data size, and cache size.
3152 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3153 * Information is only reported for apps with the primary user (user 0).
3154 * Sizes are aggregated by package name.
3155 */
3156message AppSize {
3157 // Including uids will involve modifying diskstats logic.
3158 optional string package_name = 1;
3159 // App size in bytes. -1 if unavailable.
3160 optional int64 app_size_bytes = 2;
3161 // App data size in bytes. -1 if unavailable.
3162 optional int64 app_data_size_bytes = 3;
3163 // App cache size in bytes. -1 if unavailable.
3164 optional int64 app_cache_size_bytes = 4;
3165 // Time that the cache file was produced.
3166 // Uses System.currentTimeMillis(), which is wall clock time.
3167 optional int64 cache_time_millis = 5;
3168}
3169
3170
3171/**
3172 * Size of a particular category. Eg: photos, videos.
3173 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3174 */
3175message CategorySize {
3176 enum Category {
3177 UNKNOWN = 0;
3178 APP_SIZE = 1;
3179 APP_DATA_SIZE = 2;
3180 APP_CACHE_SIZE = 3;
3181 PHOTOS = 4;
3182 VIDEOS = 5;
3183 AUDIO = 6;
3184 DOWNLOADS = 7;
3185 SYSTEM = 8;
3186 OTHER = 9;
3187 }
3188 optional Category category = 1;
3189 // Category size in bytes.
3190 optional int64 size_bytes = 2;
3191 // Time that the cache file was produced.
3192 // Uses System.currentTimeMillis(), which is wall clock time.
3193 optional int64 cache_time_millis = 3;
3194}
Tej Singhd6d6d772018-09-05 17:41:25 -07003195
3196/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003197 * Pulls per uid I/O stats. The stats are cumulative since boot.
3198 *
3199 * Read/write bytes are I/O events from a storage device
3200 * Read/write chars are data requested by read/write syscalls, and can be
3201 * satisfied by caching.
3202 *
3203 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3204 */
3205message DiskIo {
3206 optional int32 uid = 1 [(is_uid) = true];
3207 optional int64 fg_chars_read = 2;
3208 optional int64 fg_chars_write = 3;
3209 optional int64 fg_bytes_read = 4;
3210 optional int64 fg_bytes_write = 5;
3211 optional int64 bg_chars_read = 6;
3212 optional int64 bg_chars_write = 7;
3213 optional int64 bg_bytes_read = 8;
3214 optional int64 bg_bytes_write = 9;
3215 optional int64 fg_fsync = 10;
3216 optional int64 bg_fsync= 11;
3217}
3218
3219
3220/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003221 * Pulls the number of fingerprints for each user.
3222 *
3223 * Pulled from StatsCompanionService, which queries FingerprintManager.
3224 */
3225message NumFingerprints {
3226 // The associated user. Eg: 0 for owners, 10+ for others.
3227 // Defined in android/os/UserHandle.java
3228 optional int32 user = 1;
3229 // Number of fingerprints registered to that user.
3230 optional int32 num_fingerprints = 2;
3231}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003232
Yangsteraf9aee72018-10-12 09:26:16 -07003233message AggStats {
3234 optional int64 min = 1;
3235
3236 optional int64 average = 2;
3237
3238 optional int64 max = 3;
3239}
3240
3241message ProcessStatsStateProto {
3242 optional android.service.procstats.ScreenState screen_state = 1;
3243
3244 optional android.service.procstats.MemoryState memory_state = 2;
3245
3246 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3247 // and not frameworks/base/core/java/android/app/ActivityManager.java
3248 optional android.service.procstats.ProcessState process_state = 3;
3249
3250 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003251 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003252
3253 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003254 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003255
3256 // # of samples taken
3257 optional int32 sample_size = 5;
3258
3259 // PSS is memory reserved for this process
3260 optional AggStats pss = 6;
3261
3262 // USS is memory shared between processes, divided evenly for accounting
3263 optional AggStats uss = 7;
3264
3265 // RSS is memory resident for this process
3266 optional AggStats rss = 8;
3267}
3268
3269// Next Tag: 7
3270message ProcessStatsProto {
3271 // Name of process.
3272 optional string process = 1;
3273
3274 // Uid of the process.
3275 optional int32 uid = 2;
3276
3277 // Information about how often kills occurred
3278 message Kill {
3279 // Count of excessive CPU kills
3280 optional int32 cpu = 1;
3281
3282 // Count of kills when cached
3283 optional int32 cached = 2;
3284
3285 // PSS stats during cached kill
3286 optional AggStats cached_pss = 3;
3287 }
3288 optional Kill kill = 3;
3289
3290 // Time and memory spent in various states.
3291 repeated ProcessStatsStateProto states = 5;
3292
3293 // Total time process has been running... screen_state, memory_state, and process_state
3294 // will not be set.
3295 optional ProcessStatsStateProto total_running_state = 6;
3296}
3297
3298message PackageServiceOperationStatsProto {
3299 // Operate enum: Started, Foreground, Bound, Executing
3300 optional android.service.procstats.ServiceOperationState operation = 1;
3301
3302 // Number of times the service was in this operation.
3303 optional int32 count = 2;
3304
3305 // Information about a state the service can be in.
3306 message StateStats {
3307 // Screen state enum.
3308 optional android.service.procstats.ScreenState screen_state = 1;
3309 // Memory state enum.
3310 optional android.service.procstats.MemoryState memory_state = 2;
3311
3312 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003313 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003314 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003315 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003316 }
3317 repeated StateStats state_stats = 3;
3318}
3319
3320message PackageServiceStatsProto {
3321 // Name of service component.
3322 optional string service_name = 1;
3323
3324 // The operation stats.
3325 // The package_name, package_uid, package_version, service_name will not be set to save space.
3326 repeated PackageServiceOperationStatsProto operation_stats = 2;
3327}
3328
3329message PackageAssociationSourceProcessStatsProto {
3330 // Uid of the process.
3331 optional int32 process_uid = 1;
3332 // Process name.
3333 optional string process_name = 2;
3334
3335 // Total count of the times this association appeared.
3336 optional int32 total_count = 3;
3337
3338 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003339 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003340
3341 // Total count of the times this association became actively impacting its target process.
3342 optional int32 active_count = 5;
3343
3344 // Information on one source in this association.
3345 message StateStats {
3346 // Process state enum.
3347 optional android.service.procstats.ProcessState process_state = 1;
3348 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003349 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003350 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003351 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003352 }
3353 repeated StateStats active_state_stats = 6;
3354}
3355
3356message PackageAssociationProcessStatsProto {
3357 // Name of the target component.
3358 optional string component_name = 1;
3359 // Information on one source in this association.
3360 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3361}
3362
3363
3364message ProcessStatsPackageProto {
3365 // Name of package.
3366 optional string package = 1;
3367
3368 // Uid of the package.
3369 optional int32 uid = 2;
3370
3371 // Version of the package.
3372 optional int64 version = 3;
3373
3374 // Stats for each process running with the package loaded in to it.
3375 repeated ProcessStatsProto process_stats = 4;
3376
3377 // Stats for each of the package's services.
3378 repeated PackageServiceStatsProto service_stats = 5;
3379
3380 // Stats for each association with the package.
3381 repeated PackageAssociationProcessStatsProto association_stats = 6;
3382}
3383
3384message ProcessStatsSectionProto {
3385 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003386 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003387
3388 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003389 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003390
3391 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003392 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003393
3394 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003395 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003396
3397 // System runtime library. e.g. "libdvm.so", "libart.so".
3398 optional string runtime = 5;
3399
3400 // whether kernel reports swapped pss.
3401 optional bool has_swapped_pss = 6;
3402
3403 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3404 enum Status {
3405 STATUS_UNKNOWN = 0;
3406 STATUS_COMPLETE = 1;
3407 STATUS_PARTIAL = 2;
3408 STATUS_SHUTDOWN = 3;
3409 STATUS_SYSPROPS = 4;
3410 }
3411 repeated Status status = 7;
3412
3413 // Stats for each process.
3414 repeated ProcessStatsProto process_stats = 8;
3415
3416 // Stats for each package.
3417 repeated ProcessStatsPackageProto package_stats = 9;
3418}
3419
Chenjie Yu12e5e672018-09-14 15:54:59 -07003420/**
3421 * Pulled from ProcessStatsService.java
3422 */
3423message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003424 optional ProcessStatsSectionProto proc_stats_section = 1;
3425}
3426
Chenjie Yuf910b7802019-01-11 16:08:20 -08003427/**
3428 * Pulled from ProcessStatsService.java
3429 */
3430message ProcStatsPkgProc {
3431 optional ProcessStatsSectionProto proc_stats_section = 1;
3432}
3433
Yangsteraf9aee72018-10-12 09:26:16 -07003434message PowerProfileProto {
3435 optional double cpu_suspend = 1;
3436
3437 optional double cpu_idle = 2;
3438
3439 optional double cpu_active = 3;
3440
3441 message CpuCluster {
3442 optional int32 id = 1;
3443 optional double cluster_power = 2;
3444 optional int32 cores = 3;
3445 repeated int64 speed = 4;
3446 repeated double core_power = 5;
3447 }
3448
3449 repeated CpuCluster cpu_cluster = 40;
3450
3451 optional double wifi_scan = 4;
3452
3453 optional double wifi_on = 5;
3454
3455 optional double wifi_active = 6;
3456
3457 optional double wifi_controller_idle = 7;
3458
3459 optional double wifi_controller_rx = 8;
3460
3461 optional double wifi_controller_tx = 9;
3462
3463 repeated double wifi_controller_tx_levels = 10;
3464
3465 optional double wifi_controller_operating_voltage = 11;
3466
3467 optional double bluetooth_controller_idle = 12;
3468
3469 optional double bluetooth_controller_rx = 13;
3470
3471 optional double bluetooth_controller_tx = 14;
3472
3473 optional double bluetooth_controller_operating_voltage = 15;
3474
3475 optional double modem_controller_sleep = 16;
3476
3477 optional double modem_controller_idle = 17;
3478
3479 optional double modem_controller_rx = 18;
3480
3481 repeated double modem_controller_tx = 19;
3482
3483 optional double modem_controller_operating_voltage = 20;
3484
3485 optional double gps_on = 21;
3486
3487 repeated double gps_signal_quality_based = 22;
3488
3489 optional double gps_operating_voltage = 23;
3490
3491 optional double bluetooth_on = 24;
3492
3493 optional double bluetooth_active = 25;
3494
3495 optional double bluetooth_at_cmd = 26;
3496
3497 optional double ambient_display = 27;
3498
3499 optional double screen_on = 28;
3500
3501 optional double radio_on = 29;
3502
3503 optional double radio_scanning = 30;
3504
3505 optional double radio_active = 31;
3506
3507 optional double screen_full = 32;
3508
3509 optional double audio = 33;
3510
3511 optional double video = 34;
3512
3513 optional double flashlight = 35;
3514
3515 optional double memory = 36;
3516
3517 optional double camera = 37;
3518
3519 optional double wifi_batched_scan = 38;
3520
3521 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003522}
Chenjie Yuab530202018-09-26 12:39:20 -07003523
3524/**
3525 * power_profile.xml and other constants for power model calculations.
3526 * Pulled from PowerProfile.java
3527 */
3528message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003529 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003530}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003531
3532/**
arangelovd5db50e2018-10-12 20:24:39 +01003533 * Logs when a user restriction was added or removed.
3534 *
3535 * Logged from:
3536 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3537 */
3538message UserRestrictionChanged {
3539 // The raw string of the user restriction as defined in UserManager.
3540 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3541 optional string restriction = 1;
3542 // Whether the restriction is enabled or disabled.
3543 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003544}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003545
3546/**
3547 * Pulls process user time and system time. Puller takes a snapshot of all pids
3548 * in the system and returns cpu stats for those that are working at the time.
3549 * Dead pids will be dropped. Kernel processes are excluded.
3550 * Min cool-down is 5 sec.
3551 */
3552message ProcessCpuTime {
3553 optional int32 uid = 1 [(is_uid) = true];
3554
3555 optional string process_name = 2;
3556 // Process cpu time in user space, cumulative from boot/process start
3557 optional int64 user_time_millis = 3;
3558 // Process cpu time in system space, cumulative from boot/process start
3559 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003560}
Misha Wagner5a51e002018-10-03 15:04:09 +01003561
3562/**
3563 * Pulls the CPU usage for each thread.
3564 *
3565 * Read from /proc/$PID/task/$TID/time_in_state files.
3566 *
3567 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3568 * time_in_state files not being present on some phones, have not been addressed. These should be
3569 * considered before a public release.
3570 */
3571message CpuTimePerThreadFreq {
3572 // UID that owns the process.
3573 optional int32 uid = 1 [(is_uid) = true];
3574 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003575 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003576 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003577 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003578 // Name of the process taken from `/proc/$PID/cmdline`.
3579 optional string process_name = 4;
3580 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3581 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003582
3583 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3584 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3585 // frequencies are given here as the alternative is sending eight separate atoms. This method
3586 // significantly reduces the amount of data created
3587 optional int32 frequency1_khz = 6;
3588 optional int32 time1_millis = 7;
3589 optional int32 frequency2_khz = 8;
3590 optional int32 time2_millis = 9;
3591 optional int32 frequency3_khz = 10;
3592 optional int32 time3_millis = 11;
3593 optional int32 frequency4_khz = 12;
3594 optional int32 time4_millis = 13;
3595 optional int32 frequency5_khz = 14;
3596 optional int32 time5_millis = 15;
3597 optional int32 frequency6_khz = 16;
3598 optional int32 time6_millis = 17;
3599 optional int32 frequency7_khz = 18;
3600 optional int32 time7_millis = 19;
3601 optional int32 frequency8_khz = 20;
3602 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003603}
Bookatz75ee6042018-11-09 12:27:37 -08003604
3605/**
Bookatz366a4432018-11-20 09:42:33 -08003606 * Pulls information about the device's build.
3607 */
3608message BuildInformation {
3609 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3610 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3611 optional string fingerprint = 1;
3612
3613 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3614 optional string brand = 2;
3615
3616 // Build.PRODUCT. The name of the overall product.
3617 optional string product = 3;
3618
3619 // Build.DEVICE. The name of the industrial design.
3620 optional string device = 4;
3621
3622 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3623 optional string version_release = 5;
3624
3625 // Build.ID. E.g. a label like "M4-rc20".
3626 optional string id = 6;
3627
3628 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3629 // represent this build.
3630 optional string version_incremental = 7;
3631
3632 // Build.TYPE. The type of build, like "user" or "eng".
3633 optional string type = 8;
3634
3635 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3636 optional string tags = 9;
3637}
3638
3639/**
Bookatz75ee6042018-11-09 12:27:37 -08003640 * Pulls on-device BatteryStats power use calculations for the overall device.
3641 */
3642message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08003643 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3644 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3645 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3646 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08003647}
3648
3649/**
3650 * Pulls on-device BatteryStats power use calculations broken down by uid.
3651 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3652 * that is attributed to non-uid items. They must all be included to get the total power use.
3653 */
3654message DeviceCalculatedPowerBlameUid {
3655 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3656 optional int32 uid = 1 [(is_uid) = true];
3657
Bookatz3dbc13a2018-12-21 12:16:51 -08003658 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3659 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3660 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08003661}
3662
3663/**
3664 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3665 * drain type.
3666 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3667 * is attributed uids. They must all be included to get the total power use.
3668 */
3669message DeviceCalculatedPowerBlameOther {
3670 // The type of item whose power use is being reported.
3671 enum DrainType {
3672 AMBIENT_DISPLAY = 0;
3673 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3674 BLUETOOTH = 2;
3675 CAMERA = 3;
3676 // Cell-standby
3677 CELL = 4;
3678 FLASHLIGHT = 5;
3679 IDLE = 6;
3680 MEMORY = 7;
3681 // Amount that total computed drain exceeded the drain estimated using the
3682 // battery level changes and capacity.
3683 OVERCOUNTED = 8;
3684 PHONE = 9;
3685 SCREEN = 10;
3686 // Amount that total computed drain was below the drain estimated using the
3687 // battery level changes and capacity.
3688 UNACCOUNTED = 11;
3689 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3690 WIFI = 13;
3691 }
3692 optional DrainType drain_type = 1;
3693
Bookatz3dbc13a2018-12-21 12:16:51 -08003694 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3695 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3696 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003697}
arangelov4e994062018-11-13 16:12:38 +00003698
3699/**
3700 * Logs device policy features.
3701 *
3702 * Logged from:
3703 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3704 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3705 */
3706message DevicePolicyEvent {
3707 // The event id - unique for each event.
3708 optional android.stats.devicepolicy.EventId event_id = 1;
3709 // The admin package name.
3710 optional string admin_package_name = 2;
3711 // A generic integer parameter.
3712 optional int32 integer_value = 3;
3713 // A generic boolean parameter.
3714 optional bool boolean_value = 4;
3715 // A parameter specifying a time period in milliseconds.
3716 optional uint64 time_period_millis = 5;
3717 // A parameter specifying a list of package names, bundle extras or string parameters.
3718 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3719}
shawnlinea5b66b2018-11-13 15:05:29 +08003720
3721/**
3722 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3723 *
3724 * Logged from:
3725 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3726 */
3727message DocsUILaunchReported {
3728 optional android.stats.docsui.LaunchAction launch_action = 1;
3729 optional bool has_initial_uri = 2;
3730 optional android.stats.docsui.MimeType mime_type = 3;
3731 optional android.stats.docsui.Root initial_root = 4;
3732}
3733
3734/**
3735 * Logs root/app visited event in file managers/picker. Call this when the user
3736 * taps on root/app in hamburger menu.
3737 *
3738 * Logged from:
3739 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3740 */
3741message DocsUIRootVisitedReported {
3742 optional android.stats.docsui.ContextScope scope = 1;
3743 optional android.stats.docsui.Root root = 2;
3744}
3745
3746/**
3747 * Logs file operation stats. Call this when a file operation has completed.
3748 *
3749 * Logged from:
3750 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3751 */
3752message DocsUIFileOperationReported {
3753 optional android.stats.docsui.Provider provider = 1;
3754 optional android.stats.docsui.FileOperation file_op = 2;
3755}
3756
3757/**
3758 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3759 * mode.
3760 *
3761 * Logged from:
3762 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3763 */
3764message DocsUIFileOperationCopyMoveModeReported {
3765 optional android.stats.docsui.FileOperation file_op = 1;
3766 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3767}
3768
3769
3770/**
3771 * Logs file sub operation stats. Call this when a file operation has failed.
3772 *
3773 * Logged from:
3774 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3775 */
3776message DocsUIFileOperationFailureReported {
3777 optional android.stats.docsui.Authority authority = 1;
3778 optional android.stats.docsui.SubFileOperation sub_op = 2;
3779}
3780
3781/**
3782* Logs the cancellation of a file operation. Call this when a job is canceled
3783*
3784* Logged from:
3785* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3786*/
3787message DocsUIFileOperationCanceledReported {
3788 optional android.stats.docsui.FileOperation file_op = 1;
3789}
3790
3791/**
3792 * Logs startup time in milliseconds.
3793 *
3794 * Logged from:
3795 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3796 */
3797message DocsUIStartupMsReported {
3798 optional int32 startup_millis = 1;
3799}
3800
3801/**
3802 * Logs the action that was started by user.
3803 *
3804 * Logged from:
3805 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3806 */
3807message DocsUIUserActionReported {
3808 optional android.stats.docsui.UserAction action = 1;
3809}
3810
3811/**
3812 * Logs the invalid type when invalid scoped access is requested.
3813 *
3814 * Logged from:
3815 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
3816 */
3817message DocsUIInvalidScopedAccessRequestReported {
3818 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00003819}
Ben Murdochbab399f2018-12-06 11:01:38 +00003820
3821/**
shawnlina75e82d2019-01-07 10:31:12 +08003822 * Logs the package name that launches docsui picker mode.
3823 *
3824 * Logged from:
3825 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3826 */
3827message DocsUIPickerLaunchedFromReported {
3828 optional string package_name = 1;
3829}
3830
3831/**
3832 * Logs the search type.
3833 *
3834 * Logged from:
3835 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3836 */
3837message DocsUISearchTypeReported {
3838 optional android.stats.docsui.SearchType search_type = 1;
3839}
3840
3841/**
3842 * Logs the search mode.
3843 *
3844 * Logged from:
3845 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3846 */
3847message DocsUISearchModeReported {
3848 optional android.stats.docsui.SearchMode search_mode = 1;
3849}
3850
3851/**
3852 * Logs the pick result information.
3853 *
3854 * Logged from:
3855 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3856 */
3857message DocsUIPickResultReported {
3858 optional int32 total_action_count = 1;
3859 optional int64 duration_millis = 2;
3860 optional int32 file_count= 3;
3861 optional bool is_searching = 4;
3862 optional android.stats.docsui.Root picked_from = 5;
3863 optional android.stats.docsui.MimeType mime_type = 6;
3864 optional int32 repeatedly_pick_times = 7;
3865}
3866
3867/**
Ben Murdochbab399f2018-12-06 11:01:38 +00003868 * Logs when an app's memory is compacted.
3869 *
3870 * Logged from:
3871 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3872 */
3873message AppCompacted {
3874 // The pid of the process being compacted.
3875 optional int32 pid = 1;
3876
3877 // The name of the process being compacted.
3878 optional string process_name = 2;
3879
3880 // The type of compaction.
3881 enum Action {
3882 UNKNOWN = 0;
3883 SOME = 1;
3884 FULL = 2;
3885 }
Ben Murdoch01720b82018-12-19 18:03:44 +00003886 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00003887
3888 // Total RSS in kilobytes consumed by the process prior to compaction.
3889 optional int64 before_rss_total_kilobytes = 4;
3890
3891 // File RSS in kilobytes consumed by the process prior to compaction.
3892 optional int64 before_rss_file_kilobytes = 5;
3893
3894 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
3895 optional int64 before_rss_anon_kilobytes = 6;
3896
3897 // Swap in kilobytes consumed by the process prior to compaction.
3898 optional int64 before_swap_kilobytes = 7;
3899
3900 // Total RSS in kilobytes consumed by the process after compaction.
3901 optional int64 after_rss_total_kilobytes = 8;
3902
3903 // File RSS in kilobytes consumed by the process after compaction.
3904 optional int64 after_rss_file_kilobytes = 9;
3905
3906 // Anonymous RSS in kilobytes consumed by the process after compaction.
3907 optional int64 after_rss_anon_kilobytes = 10;
3908
3909 // Swap in kilobytes consumed by the process after compaction.
3910 optional int64 after_swap_kilobytes = 11;
3911
3912 // The time taken to perform compaction in milliseconds.
3913 optional int64 time_to_compact_millis = 12;
3914
3915 // The last compaction action performed for this app.
3916 optional Action last_action = 13;
3917
Ben Murdoch01720b82018-12-19 18:03:44 +00003918 // The last time that compaction was attempted on this process in milliseconds
3919 // since boot, not including sleep (see SystemClock.uptimeMillis()).
3920 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00003921
Ben Murdoch01720b82018-12-19 18:03:44 +00003922 // The oom_score_adj at the time of compaction.
3923 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00003924
3925 // The process state at the time of compaction.
3926 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
3927}
lifr157fc552018-12-12 16:38:04 +08003928
3929/**
3930 * Logs the latency period(in microseconds) and the return code of
3931 * the DNS(Domain Name System) lookups.
3932 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
3933 * to get info(address or hostname) from DNS server(or DNS cache).
3934 * Logged from:
3935 * /system/netd/server/DnsProxyListener.cpp
3936 */
3937message NetworkDnsEventReported {
3938 // The types of the DNS lookups, as defined in
3939 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
3940 enum EventType {
3941 EVENT_UNKNOWN = 0;
3942 EVENT_GETADDRINFO = 1;
3943 EVENT_GETHOSTBYNAME = 2;
3944 EVENT_GETHOSTBYADDR = 3;
3945 EVENT_RES_NSEND = 4;
3946 }
3947 optional EventType event_type = 1;
3948
3949 // The return value of the DNS resolver for each DNS lookups.
3950 //bionic/libc/include/netdb.h
3951 //system/netd/resolv/include/netd_resolv/resolv.h
3952 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08003953 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08003954 EAI_ADDRFAMILY = 1;
3955 EAI_AGAIN = 2;
3956 EAI_BADFLAGS = 3;
3957 EAI_FAIL = 4;
3958 EAI_FAMILY = 5;
3959 EAI_MEMORY = 6;
3960 EAI_NODATA = 7;
3961 EAI_NONAME = 8;
3962 EAI_SERVICE = 9;
3963 EAI_SOCKTYPE = 10;
3964 EAI_SYSTEM = 11;
3965 EAI_BADHINTS = 12;
3966 EAI_PROTOCOL = 13;
3967 EAI_OVERFLOW = 14;
3968 RESOLV_TIMEOUT = 255;
3969 EAI_MAX = 256;
3970 }
3971 optional ReturnCode return_code = 2;
3972
3973 // The latency period(in microseconds) it took for this DNS lookup to complete.
3974 optional int32 latency_micros = 3;
3975}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08003976
3977/**
3978 * Logs when a data stall event occurs.
3979 *
3980 * Log from:
3981 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
3982 */
3983message DataStallEvent {
3984 // Data stall evaluation type.
3985 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
3986 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
3987 optional int32 evaluation_type = 1;
3988 // See definition in data_stall_event.proto.
3989 optional com.android.server.connectivity.ProbeResult validation_result = 2;
3990 // See definition in data_stall_event.proto.
3991 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
3992 // See definition in data_stall_event.proto.
3993 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
3994 // See definition in data_stall_event.proto.
3995 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
3996 // See definition in data_stall_event.proto.
3997 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
3998}
Christian Brunschenf86039e2018-12-21 12:26:14 +00003999
4000/*
4001 * Logs when RescueParty resets some set of experiment flags.
4002 *
4003 * Logged from:
4004 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4005 */
4006message RescuePartyResetReported {
4007 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4008 optional int32 rescue_level = 1;
4009}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004010
4011/**
4012 * Logs when signed config is received from an APK, and if that config was applied successfully.
4013 * Logged from:
4014 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4015 */
4016message SignedConfigReported {
4017 enum Type {
4018 UNKNOWN_TYPE = 0;
4019 GLOBAL_SETTINGS = 1;
4020 }
4021 optional Type type = 1;
4022
4023 // The final status of the signed config received.
4024 enum Status {
4025 UNKNOWN_STATUS = 0;
4026 APPLIED = 1;
4027 BASE64_FAILURE_CONFIG = 2;
4028 BASE64_FAILURE_SIGNATURE = 3;
4029 SECURITY_EXCEPTION = 4;
4030 INVALID_CONFIG = 5;
4031 OLD_CONFIG = 6;
4032 SIGNATURE_CHECK_FAILED = 7;
4033 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004034 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004035 }
4036 optional Status status = 2;
4037
4038 // The version of the signed config processed.
4039 optional int32 version = 3;
4040
4041 // The package name that the config was extracted from.
4042 optional string from_package = 4;
4043
4044 enum Key {
4045 NO_KEY = 0;
4046 DEBUG = 1;
4047 PRODUCTION = 2;
4048 }
4049 // Which key was used to verify the config.
4050 optional Key verified_with = 5;
4051}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004052
4053/*
4054 * Logs GNSS Network-Initiated (NI) location events.
4055 *
4056 * Logged from:
4057 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4058 */
4059message GnssNiEventReported {
4060 // The type of GnssNiEvent.
4061 enum EventType {
4062 UNKNOWN = 0;
4063 NI_REQUEST = 1;
4064 NI_RESPONSE = 2;
4065 }
4066 optional EventType event_type = 1;
4067
4068 // An ID generated by HAL to associate NI notifications and UI responses.
4069 optional int32 notification_id = 2;
4070
4071 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
4072 optional int32 ni_type = 3;
4073
4074 // NI requires notification.
4075 optional bool need_notify = 4;
4076
4077 // NI requires verification.
4078 optional bool need_verify = 5;
4079
4080 // NI requires privacy override, no notification/minimal trace.
4081 optional bool privacy_override = 6;
4082
4083 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4084 // seconds.
4085 optional int32 timeout = 7;
4086
4087 // Default response when timeout.
4088 optional int32 default_response = 8;
4089
4090 // String representing the requester of the network inititated location request.
4091 optional string requestor_id = 9;
4092
4093 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4094 // network initiated location request.
4095 optional string text = 10;
4096
4097 // requestorId decoding scheme.
4098 optional int32 requestor_id_encoding = 11;
4099
4100 // Notification message text decoding scheme.
4101 optional int32 text_encoding = 12;
4102
4103 // True if SUPL ES is enabled.
4104 optional bool is_supl_es_enabled = 13;
4105
4106 // True if GNSS location is enabled.
4107 optional bool is_location_enabled = 14;
4108
4109 // GNSS NI responses which define the response in NI structures.
4110 optional int32 user_response = 15;
4111}