blob: e97d6c3e22e10fcca7ccff794e442d6b2a15637e [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";
Bookatz1a1b0462018-01-12 11:47:03 -080028import "frameworks/base/core/proto/android/os/enums.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080029import "frameworks/base/core/proto/android/server/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080030import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070031import "frameworks/base/core/proto/android/service/procstats_enum.proto";
32import "frameworks/base/core/proto/android/stats/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070033import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080034import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080035import "frameworks/base/core/proto/android/telephony/enums.proto";
36import "frameworks/base/core/proto/android/view/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080037
Yao Chend54f9dd2017-10-17 17:37:48 +000038/**
Stefan Lafonae2df012017-11-14 09:17:21 -080039 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000040 * raw stats log events from the Android system, also known as "atoms."
41 *
42 * This field contains a single oneof with all of the available messages.
43 * The stats-log-api-gen tool runs as part of the Android build and
44 * generates the android.util.StatsLog class, which contains the constants
45 * and methods that Android uses to log.
46 *
Stefan Lafonae2df012017-11-14 09:17:21 -080047 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000048 * Instead, statsd on Android constructs these messages synthetically,
49 * in the format defined here and in stats_log.proto.
50 */
Stefan Lafonae2df012017-11-14 09:17:21 -080051message Atom {
52 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070053 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070054 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
55 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070056 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070057 BleScanResultReceived ble_scan_result_received = 4;
58 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080059 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070060 SyncStateChanged sync_state_changed = 7;
61 ScheduledJobStateChanged scheduled_job_state_changed = 8;
62 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070063 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080064 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
65 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
66 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070067 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
68 MemoryFactorStateChanged memory_factor_state_changed = 15;
69 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
70 CachedKillReported cached_kill_reported = 17;
71 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070072 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080073 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
74 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
75 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070076 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080077 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070078 CameraStateChanged camera_state_changed = 25;
79 FlashlightStateChanged flashlight_state_changed = 26;
80 UidProcessStateChanged uid_process_state_changed = 27;
81 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
82 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070083 BatteryLevelChanged battery_level_changed = 30;
84 ChargingStateChanged charging_state_changed = 31;
85 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070086 InteractiveStateChanged interactive_state_changed = 33;
87 // 34 is available
Bookatz8c6571b2017-10-24 15:04:41 -070088 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
89 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070090 WifiLockStateChanged wifi_lock_state_changed = 37;
91 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
92 WifiScanStateChanged wifi_scan_state_changed = 39;
93 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070094 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070095 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070096 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090097 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -070098 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -080099 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800100 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800101 AppStartOccurred app_start_occurred = 48;
102 AppStartCanceled app_start_canceled = 49;
103 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800104 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800105 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800106 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800107 LmkStateChanged lmk_state_changed = 54;
108 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800109 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800110 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800111 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800112 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800113 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800114 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800115 KeyguardStateChanged keyguard_state_changed = 62;
116 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
117 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800118 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800119 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800120 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
121 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800122 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700123 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800124 SpeakerImpedanceReported speaker_impedance_reported = 71;
125 HardwareFailed hardware_failed = 72;
126 PhysicalDropDetected physical_drop_detected = 73;
127 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800128 MobileConnectionStateChanged mobile_connection_state_changed = 75;
129 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700130 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800131 AppCrashOccurred app_crash_occurred = 78;
132 ANROccurred anr_occurred = 79;
133 WTFOccurred wtf_occurred = 80;
134 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700135 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700136 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700137 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700138 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700139 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700140 FingerprintAcquired fingerprint_acquired = 87;
141 FingerprintAuthenticated fingerprint_authenticated = 88;
142 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700143 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700144 BatteryHealthSnapshot battery_health_snapshot = 91;
145 SlowIo slow_io = 92;
146 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700147 PhoneServiceStateChanged phone_service_state_changed = 94;
148 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100149 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700150 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700151 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700152 // TODO: service state change is very noisy shortly after boot, as well
153 // as at other transitions - coming out of doze, device plugged in, etc.
154 // Consider removing this if it becomes a problem
155 ServiceStateChanged service_state_changed = 99;
156 ServiceLaunchReported service_launch_reported = 100;
Yangster-macb89807e2018-11-15 21:10:57 -0800157 PhenotypeFlagStateChanged phenotype_flag_state_changed = 101;
158 BinaryPushStateChanged binary_push_state_changed = 102;
Yao Chend54f9dd2017-10-17 17:37:48 +0000159 }
David Chenc8a43242017-10-17 16:23:28 -0700160
David Chen6e3e6cb2018-01-03 16:14:06 -0800161 // Pulled events will start at field 10000.
Rafal Slawik3bea8952018-11-15 12:39:33 +0000162 // Next: 10043
David Chenc8a43242017-10-17 16:23:28 -0700163 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800164 WifiBytesTransfer wifi_bytes_transfer = 10000;
165 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
166 MobileBytesTransfer mobile_bytes_transfer = 10002;
167 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800168 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800169 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800170 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800171 CpuTimePerFreq cpu_time_per_freq = 10008;
172 CpuTimePerUid cpu_time_per_uid = 10009;
173 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800174 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800175 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800176 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800177 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800178 SystemElapsedRealtime system_elapsed_realtime = 10014;
179 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800180 CpuActiveTime cpu_active_time = 10016;
181 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000182 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800183 RemainingBatteryCapacity remaining_battery_capacity = 10019;
184 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800185 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100186 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100187 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100188 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000189 DiskStats disk_stats = 10025;
190 DirectoryUsage directory_usage = 10026;
191 AppSize app_size = 10027;
192 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700193 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700194 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700195 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700196 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700197 PowerProfile power_profile = 10033;
Chenjie Yub52779e2018-10-05 12:03:36 -0700198 ProcStats proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700199 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100200 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100201 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700202 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800203 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
204 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
205 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000206 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800207 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800208 BuildInformation build_information = 10044;
David Chenc8a43242017-10-17 16:23:28 -0700209 }
yroa1fe77c2018-02-26 14:22:54 -0800210
Bookatz76aafcf2018-09-17 16:17:10 -0700211 // DO NOT USE field numbers above 100,000 in AOSP.
212 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
213 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700214}
215
Yao Chend54f9dd2017-10-17 17:37:48 +0000216/**
Yangster-mac20877162017-12-22 17:19:39 -0800217 * This proto represents a node of an attribution chain.
218 * Note: All attribution chains are represented as a repeated field of type
219 * AttributionNode. It is understood that in such arrays, the order is that
220 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000221 */
Yangster-mac20877162017-12-22 17:19:39 -0800222message AttributionNode {
223 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800224 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800225
Yangster-mac20877162017-12-22 17:19:39 -0800226 // The (optional) string tag for an element in the attribution chain. If the
227 // element has no tag, it is encoded as an empty string.
228 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700229}
230
Yangster-mac48b3d622018-08-18 12:38:11 -0700231message KeyValuePair {
232 optional int32 key = 1;
233 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700234 int32 value_int = 2;
235 int64 value_long = 3;
236 string value_str = 4;
237 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700238 }
239}
240
241message KeyValuePairsAtom {
242 optional int32 uid = 1;
243 repeated KeyValuePair pairs = 2;
244}
245
Yao Chend54f9dd2017-10-17 17:37:48 +0000246/*
247 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800248 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000249 *
250 * RULES:
251 * - The field ids for each atom must start at 1, and count upwards by 1.
252 * Skipping field ids is not allowed.
253 * - These form an API, so renaming, renumbering or removing fields is
254 * not allowed between android releases. (This is not currently enforced,
255 * but there will be a tool to enforce this restriction).
256 * - The types must be built-in protocol buffer types, namely, no sub-messages
257 * are allowed (yet). The bytes type is also not allowed.
258 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800259 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000260 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800261 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000262 * - A field that is a uid should be a string field, tagged with the [xxx]
263 * annotation. The generated code on android will be represented by UIDs,
264 * and those UIDs will be translated in xxx to those strings.
265 *
266 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700267 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000268 * - If there is a UID, it goes first. Think in an object-oriented fashion.
269 * *****************************************************************************
270 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700271
Yao Chend54f9dd2017-10-17 17:37:48 +0000272/**
Yangster-mace16189a2018-08-26 12:20:16 -0700273 * Logs when the Thermal service HAL notifies the throttling start/stop events.
274 *
275 * Logged from:
276 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
277 */
278message ThermalThrottlingStateChanged {
279 optional android.os.TemperatureTypeEnum sensor_type = 1;
280
281 enum State {
282 UNKNOWN = 0;
283 START = 1;
284 STOP = 2;
285 }
286
287 optional State state = 2;
288
289 optional float temperature = 3;
290}
291
292/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000293 * Logs when the screen state changes.
294 *
295 * Logged from:
296 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
297 */
298message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800299 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700300 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700301}
Yao Chend54f9dd2017-10-17 17:37:48 +0000302
303/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700304 * Logs that the process state of the uid, as determined by ActivityManager
305 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000306 *
307 * Logged from:
308 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
309 */
Bookatzc1a050a2017-10-10 15:49:28 -0700310message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700311 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000312
Bookatzdb026a22018-01-10 19:01:56 -0800313 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700314 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000315}
316
317/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700318 * Logs process state change of a process, as per the activity manager.
319 *
320 * Logged from:
321 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
322 */
323message ProcessStateChanged {
324 optional int32 uid = 1;
325 optional string process_name = 2;
326 optional string package_name = 3;
327 // TODO: remove this when validation is done
328 optional int64 version = 5;
329 // The state, from frameworks/base/core/proto/android/app/enums.proto.
330 optional android.app.ProcessStateEnum state = 4;
331}
332
333/**
334 * Logs when ActivityManagerService sleep state is changed.
335 *
336 * Logged from:
337 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
338 */
339message ActivityManagerSleepStateChanged {
340 // TODO: import frameworks proto
341 enum State {
342 UNKNOWN = 0;
343 ASLEEP = 1;
344 AWAKE = 2;
345 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700346 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700347}
348
349/**
350 * Logs when system memory state changes.
351 *
352 * Logged from:
353 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
354 */
355message MemoryFactorStateChanged {
356 // TODO: import frameworks proto
357 enum State {
358 MEMORY_UNKNOWN = 0;
359 NORMAL = 1; // normal.
360 MODERATE = 2; // moderate memory pressure.
361 LOW = 3; // low memory.
362 CRITICAL = 4; // critical memory.
363
364 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700365 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700366}
367
368/**
369 * Logs when app is using too much cpu, according to ActivityManagerService.
370 *
371 * Logged from:
372 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
373 */
374message ExcessiveCpuUsageReported {
375 optional int32 uid = 1;
376 optional string process_name = 2;
377 optional string package_name = 3;
378 // package version. TODO: remove this when validation is done
379 optional int64 version = 4;
380}
381
382/**
383 * Logs when a cached process is killed, along with its pss.
384 *
385 * Logged from:
386 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
387 */
388message CachedKillReported {
389 optional int32 uid = 1;
390 optional string process_name = 2;
391 optional string package_name = 3;
392 // TODO: remove this when validation is done
393 optional int64 version = 5;
394 optional int64 pss = 4;
395}
396
397/**
398 * Logs when memory stats of a process is reported.
399 *
400 * Logged from:
401 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
402 */
403message ProcessMemoryStatReported {
404 optional int32 uid = 1;
405 optional string process_name = 2;
406 optional string package_name = 3;
407 //TODO: remove this when validation is done
408 optional int64 version = 9;
409 optional int64 pss = 4;
410 optional int64 uss = 5;
411 optional int64 rss = 6;
412 enum Type {
413 ADD_PSS_INTERNAL_SINGLE = 0;
414 ADD_PSS_INTERNAL_ALL_MEM = 1;
415 ADD_PSS_INTERNAL_ALL_POLL = 2;
416 ADD_PSS_EXTERNAL = 3;
417 ADD_PSS_EXTERNAL_SLOW = 4;
418 }
419 optional Type type = 7;
420 optional int64 duration = 8;
421}
422
423/**
Bookatzc1a050a2017-10-10 15:49:28 -0700424 * Logs that a process started, finished, crashed, or ANRed.
425 *
426 * Logged from:
427 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
428 */
429message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700430 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700431
David Chen0b5c90c2018-01-25 16:51:49 -0800432 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800433 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700434
Bookatzddccf0a2017-11-28 16:48:14 -0800435 // What lifecycle state the process changed to.
436 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800437 enum State {
438 FINISHED = 0;
439 STARTED = 1;
440 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800441 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800442 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700443}
444
Bookatzc1a050a2017-10-10 15:49:28 -0700445/**
446 * Logs when the ble scan state changes.
447 *
448 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700449 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700450 */
451message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800452 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700453
454 enum State {
455 OFF = 0;
456 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700457 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
458 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700459 }
460 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700461
Bookatze5ec0b42018-03-26 13:34:56 -0700462 // Does the scan have a filter.
463 optional bool is_filtered = 3;
464 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
465 optional bool is_first_match = 4;
466 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
467 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700468}
469
470/**
471 * Logs reporting of a ble scan finding results.
472 *
473 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700474 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700475 */
Bookatzae6738e2018-09-13 11:38:56 -0700476// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700477message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800478 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700479
480 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800481 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700482}
483
484/**
485 * Logs when a sensor state changes.
486 *
487 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700488 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700489 */
490message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800491 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700492
Bookatzc1a050a2017-10-10 15:49:28 -0700493 // The id (int) of the sensor.
494 optional int32 sensor_id = 2;
495
496 enum State {
497 OFF = 0;
498 ON = 1;
499 }
500 optional State state = 3;
501}
502
Bookatzc1a050a2017-10-10 15:49:28 -0700503/**
504 * Logs when GPS state changes.
505 *
506 * Logged from:
507 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
508 */
509message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800510 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700511
512 enum State {
513 OFF = 0;
514 ON = 1;
515 }
516 optional State state = 2;
517}
518
Bookatz48d362e2018-11-06 15:49:08 -0800519/**
520 * Logs when GPS signal quality.
521 *
522 * Logged from:
523 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
524 */
525message GpsSignalQualityChanged {
526 optional android.server.location.GpsSignalQualityEnum level = 1;
527}
528
Bookatzc1a050a2017-10-10 15:49:28 -0700529
530/**
531 * Logs when a sync manager sync state changes.
532 *
533 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700534 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700535 */
536message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800537 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700538
David Chen0b5c90c2018-01-25 16:51:49 -0800539 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800540 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700541
542 enum State {
543 OFF = 0;
544 ON = 1;
545 }
546 optional State state = 3;
547}
548
Yangster-mac96353002018-09-05 11:18:55 -0700549/*
550 * Deferred job stats.
551 *
552 * Logged from:
553 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
554*/
555message DeferredJobStatsReported {
556 repeated AttributionNode attribution_node = 1;
557
558 // Number of jobs deferred.
559 optional int32 num_jobs_deferred = 2;
560
561 // Time since the last job runs.
562 optional int64 time_since_last_job_millis = 3;
563}
564
Bookatzc1a050a2017-10-10 15:49:28 -0700565/**
566 * Logs when a job scheduler job state changes.
567 *
568 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700569 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700570 */
571message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800572 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700573
574 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800575 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700576
577 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800578 FINISHED = 0;
579 STARTED = 1;
580 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700581 }
582 optional State state = 3;
583
Tej Singh33a412b2018-03-16 18:43:59 -0700584 // The reason a job has stopped.
585 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700586 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700587 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700588}
589
590/**
591 * Logs when the audio state changes.
592 *
593 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700594 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700595 */
596message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800597 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700598
599 enum State {
600 OFF = 0;
601 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700602 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
603 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700604 }
605 optional State state = 2;
606}
607
608/**
609 * Logs when the video codec state changes.
610 *
611 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700612 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700613 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800614message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800615 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700616
617 enum State {
618 OFF = 0;
619 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700620 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
621 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700622 }
623 optional State state = 2;
624}
625
626/**
627 * Logs when the flashlight state changes.
628 *
629 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700630 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700631 */
632message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800633 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700634
635 enum State {
636 OFF = 0;
637 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700638 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
639 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700640 }
641 optional State state = 2;
642}
643
644/**
645 * Logs when the camera state changes.
646 *
647 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700648 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700649 */
650message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800651 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700652
653 enum State {
654 OFF = 0;
655 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700656 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
657 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700658 }
659 optional State state = 2;
660}
661
662/**
663 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000664 *
665 * Logged from:
666 * TODO
667 */
Bookatzd6746242017-10-24 18:39:35 -0700668message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800669 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000670
Bookatz1a1b0462018-01-12 11:47:03 -0800671 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
672 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700673 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700674
675 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
676 optional string tag = 3;
677
678 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800679 RELEASE = 0;
680 ACQUIRE = 1;
681 CHANGE_RELEASE = 2;
682 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700683 }
684 optional State state = 4;
685}
686
687/**
Bookatzc1a050a2017-10-10 15:49:28 -0700688 * Logs when a partial wakelock is considered 'long' (over 1 min).
689 *
690 * Logged from:
691 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
692 */
693message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800694 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700695
Yao Chend54f9dd2017-10-17 17:37:48 +0000696 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
697 optional string tag = 2;
698
Bookatzc1a050a2017-10-10 15:49:28 -0700699 // TODO: I have no idea what this is.
700 optional string history_tag = 3;
701
702 enum State {
703 OFF = 0;
704 ON = 1;
705 }
706 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000707}
708
Bookatzc1a050a2017-10-10 15:49:28 -0700709/**
Bookatza66083f2018-09-20 17:24:00 -0700710 * Logs when the device is interactive, according to the PowerManager Notifier.
711 *
712 * Logged from:
713 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
714 */
715message InteractiveStateChanged {
716 enum State {
717 OFF = 0;
718 ON = 1;
719 }
720 optional State state = 1;
721}
722
723/**
Bookatzc1a050a2017-10-10 15:49:28 -0700724 * Logs Battery Saver state change.
725 *
726 * Logged from:
727 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
728 */
729message BatterySaverModeStateChanged {
730 enum State {
731 OFF = 0;
732 ON = 1;
733 }
734 optional State state = 1;
735}
736
737/**
738 * Logs Doze mode state change.
739 *
740 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800741 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700742 */
743message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800744 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800745}
746
747
748/**
749 * Logs state change of Doze mode including maintenance windows.
750 *
751 * Logged from:
752 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
753 */
754message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800755 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700756}
757
758/**
759 * Logs screen brightness level.
760 *
761 * Logged from:
762 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
763 */
764message ScreenBrightnessChanged {
765 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
766 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700767}
768
769/**
770 * Logs battery level (percent full, from 0 to 100).
771 *
772 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700773 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700774 */
775message BatteryLevelChanged {
776 // Battery level. Should be in [0, 100].
777 optional int32 battery_level = 1;
778}
779
780/**
781 * Logs change in charging status of the device.
782 *
783 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700784 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700785 */
786message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800787 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
788 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700789}
790
791/**
792 * Logs whether the device is plugged in, and what power source it is using.
793 *
794 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700795 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700796 */
797message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800798 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
799 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700800}
801
Bookatz8c6571b2017-10-24 15:04:41 -0700802/**
803 * Logs when an app's wakeup alarm fires.
804 *
805 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700806 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700807 */
808message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800809 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800810
811 // Name of the wakeup alarm.
812 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700813
814 // Name of source package (for historical reasons, since BatteryStats tracked it).
815 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800816}
817
818/**
819 * Logs when an an app causes the mobile radio to change state.
820 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
821 *
822 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700823 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800824 */
825message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800826 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800827
Bookatz1a1b0462018-01-12 11:47:03 -0800828 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
829 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800830}
831
832/**
833 * Logs when an an app causes the wifi radio to change state.
834 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
835 *
836 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700837 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800838 */
839message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800840 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800841
Bookatz1a1b0462018-01-12 11:47:03 -0800842 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
843 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700844}
845
846/**
847 * Logs kernel wakeup reasons and aborts.
848 *
849 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700850 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700851 */
852message KernelWakeupReported {
853 // Name of the kernel wakeup reason (or abort).
854 optional string wakeup_reason_name = 1;
855
856 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800857 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700858}
859
860/**
861 * Logs wifi locks held by an app.
862 *
863 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700864 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700865 */
866message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800867 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700868
869 enum State {
870 OFF = 0;
871 ON = 1;
872 }
873 optional State state = 2;
874}
875
876/**
877 * Logs wifi signal strength changes.
878 *
879 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700880 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700881 */
882message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800883 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
884 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700885}
886
887/**
888 * Logs wifi scans performed by an app.
889 *
890 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700891 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700892 */
893message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800894 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700895
896 enum State {
897 OFF = 0;
898 ON = 1;
899 }
900 optional State state = 2;
901}
902
903/**
Tej Singh4503e102018-01-04 14:35:01 -0800904 * Logs wifi multicast locks held by an app
905 *
906 * Logged from:
907 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
908 */
909message WifiMulticastLockStateChanged {
910 repeated AttributionNode attribution_node = 1;
911
912 enum State {
913 OFF = 0;
914 ON = 1;
915 }
916 optional State state = 2;
917}
918
919/**
Tej Singh1ea42892018-01-19 09:27:00 -0800920 * Logs shutdown reason and duration on next boot.
921 *
922 * Logged from:
923 * frameworks/base/core/java/com/android/server/BootReceiver.java
924 */
925message ShutdownSequenceReported {
926 // True if shutdown is for a reboot. Default: false if we do not know.
927 optional bool reboot = 1;
928
929 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
930 optional string reason = 2;
931
932 // Beginning of shutdown time in ms using wall clock time since unix epoch.
933 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800934 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800935
936 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800937 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800938}
939
Tej Singh6483ea42018-01-25 17:45:49 -0800940
941/**
942 * Logs boot reason and duration.
943 *
944 * Logged from:
945 * system/core/bootstat/bootstat.cpp
946 */
947message BootSequenceReported {
948 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
949 // Default: "<EMPTY>" if not available.
950 optional string bootloader_reason = 1;
951
952 // Reason for system boot. Eg. bootloader, reboot,userrequested
953 // Default: "<EMPTY>" if not available.
954 optional string system_reason = 2;
955
956 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800957 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800958
959 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800960 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800961
962 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800963 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800964
965 // Time since last boot in ms. Default: 0 if not available.
966 optional int64 time_since_last_boot = 6;
967}
968
Tej Singhc477d9c2018-02-05 18:31:39 -0800969
970/**
971 * Logs call state and disconnect cause (if applicable).
972 *
973 * Logged from:
974 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
975 */
976message CallStateChanged {
977 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
978 // From frameworks/base/core/proto/android/telecomm/enums.proto.
979 optional android.telecom.CallStateEnum call_state = 1;
980
981 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
982 // This value is only applicable when the call_state is DISCONNECTED, and
983 // should always be UNKNOWN if the call_state is not DISCONNECTED.
984 // From frameworks/base/core/proto/android/telecomm/enums.proto.
985 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
986
987 // True if the call is self-managed, which are apps that use the
988 // telecom infrastructure to make their own calls.
989 optional bool self_managed = 3;
990
991 // True if call is external. External calls are calls on connected Wear
992 // devices but show up in Telecom so the user can pull them onto the device.
993 optional bool external_call = 4;
994}
995
Tej Singh1ea42892018-01-19 09:27:00 -0800996/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800997 * Logs keyguard state. The keyguard is the lock screen.
998 *
999 * Logged from:
1000 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1001 */
1002message KeyguardStateChanged {
1003 enum State {
1004 UNKNOWN = 0;
1005 // The keyguard is hidden when the phone is unlocked.
1006 HIDDEN = 1;
1007 // The keyguard is shown when the phone is locked (screen turns off).
1008 SHOWN= 2;
1009 // The keyguard is occluded when something is overlaying the keyguard.
1010 // Eg. Opening the camera while on the lock screen.
1011 OCCLUDED = 3;
1012 }
1013 optional State state = 1;
1014}
1015
1016/**
1017 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1018 * prompts the user to enter a password (pattern, pin, etc).
1019 *
1020 * Logged from:
1021 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1022 */
1023
1024message KeyguardBouncerStateChanged {
1025 enum State {
1026 UNKNOWN = 0;
1027 // Bouncer is hidden, either as a result of successfully entering the
1028 // password, screen timing out, or user going back to lock screen.
1029 HIDDEN = 1;
1030 // This is when the user is being prompted to enter the password.
1031 SHOWN = 2;
1032 }
1033 optional State state = 1;
1034}
1035
1036/**
1037 * Logs the result of entering a password into the keyguard bouncer.
1038 *
1039 * Logged from:
1040 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1041 */
1042message KeyguardBouncerPasswordEntered {
1043 enum BouncerResult {
1044 UNKNOWN = 0;
1045 // The password entered was incorrect.
1046 FAILURE = 1;
1047 // The password entered was correct.
1048 SUCCESS = 2;
1049 }
1050 optional BouncerResult result = 1;
1051}
1052
Tej Singha883b372018-02-15 11:30:01 -08001053/*
1054 * Logs changes to the configuration of the device. The configuration is defined
1055 * in frameworks/base/core/java/android/content/res/Configuration.java
1056 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1057 * Please go there to interpret the possible values each field can be.
1058 *
1059 * Logged from:
1060 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1061 */
1062message ResourceConfigurationChanged {
1063 // Bit mask of color capabilities of the screen.
1064 // Contains information about the color gamut and hdr mode of the screen.
1065 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001066 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001067
1068 // The target screen density being rendered to.
1069 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001070 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001071
1072 // Current user preference for the scaling factor for fonts,
1073 // relative to the base density scaling.
1074 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001075 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001076
1077 // Flag indicating whether the hard keyboard is hidden.
1078 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001079 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001080
1081 // The type of keyboard attached to the device.
1082 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1083 optional int32 keyboard = 5;
1084
1085 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1086 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001087 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001088
1089 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1090 // 0 if undefined.
1091 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1092 optional int32 mcc = 7;
1093
1094 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1095 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1096 // MNC_ZERO symbol defined in Configuration.java.
1097 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1098 optional int32 mnc = 8;
1099
1100 // The kind of navigation available on the device.
1101 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1102 optional int32 navigation = 9;
1103
1104 // Flag indicating whether the navigation is available.
1105 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001106 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001107
1108 // Overall orientation of the screen.
1109 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1110 optional int32 orientation = 11;
1111
1112 // The current height of the available screen space, in dp units.
1113 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001114 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001115
1116 // Bit mask of overall layout of the screen.
1117 // Contains information about screen size, whether the screen is wider/taller
1118 // than normal, whether the screen layout is right-tl-left or left-to-right,
1119 // and whether the screen has a rounded shape.
1120 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001121 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001122
1123 // Current width of the available screen space, in dp units.
1124 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001125 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001126
1127 // The smallest screen size an application will see in normal operation.
1128 // This is the smallest value of both screenWidthDp and screenHeightDp
1129 // in portrait and landscape.
1130 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001131 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001132
1133 // The type of touch screen attached to the device.
1134 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1135 optional int32 touchscreen = 16;
1136
1137 // Bit mask of the ui mode.
1138 // Contains information about the overall ui mode of the device.
1139 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1140 // Also contains information about whether the device is in night mode.
1141 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001142 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001143}
1144
Tej Singheee317b2018-03-07 19:28:05 -08001145
1146/**
1147 * Logs changes in the connection state of the mobile radio.
1148 *
1149 * Logged from:
1150 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1151 */
1152message MobileConnectionStateChanged {
1153 // States are from the state machine DataConnection.java.
1154 enum State {
1155 UNKNOWN = 0;
1156 // The connection is inactive, or disconnected.
1157 INACTIVE = 1;
1158 // The connection is being activated, or connecting.
1159 ACTIVATING = 2;
1160 // The connection is active, or connected.
1161 ACTIVE = 3;
1162 // The connection is disconnecting.
1163 DISCONNECTING = 4;
1164 // The connection is disconnecting after creating a connection.
1165 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1166 }
1167 optional State state = 1;
1168 // For multi-sim phones, this distinguishes between the sim cards.
1169 optional int32 sim_slot_index = 2;
1170 // Used to identify the connection. Starts at 0 and increments by 1 for
1171 // every new network created. Resets whenever the device reboots.
1172 optional int32 data_connection_id = 3;
1173 // A bitmask for the capabilities of this connection.
1174 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1175 // Default value (if we have no information): 0
1176 optional int64 capabilities = 4;
1177 // If this connection has internet.
1178 // This just checks if the DEFAULT bit of capabilities is set.
1179 optional bool has_internet = 5;
1180}
1181
1182/**
1183 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1184 *
1185 * Logged from:
1186 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1187 */
1188message MobileRadioTechnologyChanged {
1189 optional android.telephony.NetworkTypeEnum state = 1;
1190 // For multi-sim phones, this distinguishes between the sim cards.
1191 optional int32 sim_slot_index = 2;
1192}
1193
Andrew Chantb56388b2018-03-22 21:07:33 -07001194/**
1195 * Logs the VID and PID of any connected USB devices.
1196 *
1197 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1198 *
1199 * Logged by Vendor.
1200 */
1201message UsbDeviceAttached {
1202 optional int32 vid = 1;
1203 optional int32 pid = 2;
1204 optional bool has_audio = 3;
1205 optional bool has_hid = 4;
1206 optional bool has_storage = 5;
1207}
1208
Tej Singheee317b2018-03-07 19:28:05 -08001209
Tej Singhdd7bd352018-02-09 19:33:15 -08001210/**
Tej Singh5d991e12018-03-09 19:48:11 -08001211 * Logs when Bluetooth is enabled and disabled.
1212 *
1213 * Logged from:
1214 * services/core/java/com/android/server/BluetoothManagerService.java
1215 */
1216message BluetoothEnabledStateChanged {
1217 repeated AttributionNode attribution_node = 1;
1218 // Whether or not bluetooth is enabled on the device.
1219 enum State {
1220 UNKNOWN = 0;
1221 ENABLED = 1;
1222 DISABLED = 2;
1223 }
1224 optional State state = 2;
1225 // The reason for being enabled/disabled.
1226 // Eg. Airplane mode, crash, application request.
1227 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1228 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001229 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001230}
1231
1232/**
1233 * Logs when a Bluetooth device connects and disconnects.
1234 *
1235 * Logged from:
1236 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1237 */
1238message BluetoothConnectionStateChanged {
1239 // The state of the connection.
1240 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1241 optional android.bluetooth.ConnectionStateEnum state = 1;
1242 // An identifier that can be used to match connect and disconnect events.
1243 // Currently is last two bytes of a hash of a device level ID and
1244 // the mac address of the bluetooth device that is connected.
1245 optional int32 obfuscated_id = 2;
1246 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1247 // From android.bluetooth.BluetoothAdapter.java
1248 optional int32 bt_profile = 3;
1249}
1250
1251/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001252 * Logs when something is plugged into or removed from the USB-C connector.
1253 *
1254 * Logged from:
1255 * Vendor USB HAL.
1256 */
1257message UsbConnectorStateChanged {
1258 enum State {
1259 DISCONNECTED = 0;
1260 CONNECTED = 1;
1261 }
1262 optional State state = 1;
1263}
1264
1265/**
1266 * Logs the reported speaker impedance.
1267 *
1268 * Logged from:
1269 * Vendor audio implementation.
1270 */
1271message SpeakerImpedanceReported {
1272 optional int32 speaker_location = 1;
1273 optional int32 impedance = 2;
1274}
1275
1276/**
1277 * Logs the report of a failed hardware.
1278 *
1279 * Logged from:
1280 * Vendor HALs.
1281 *
1282 */
1283message HardwareFailed {
1284 enum HardwareType {
1285 HARDWARE_FAILED_UNKNOWN = 0;
1286 HARDWARE_FAILED_MICROPHONE = 1;
1287 HARDWARE_FAILED_CODEC = 2;
1288 HARDWARE_FAILED_SPEAKER = 3;
1289 HARDWARE_FAILED_FINGERPRINT = 4;
1290 }
1291 optional HardwareType hardware_type = 1;
1292
1293 /* hardware_location allows vendors to differentiate between multiple instances of
1294 * the same hardware_type. The specific locations are vendor defined integers,
1295 * referring to board-specific numbering schemes.
1296 */
1297 optional int32 hardware_location = 2;
1298
1299 /* failure_code is specific to the HardwareType of the failed hardware.
1300 * It should use the enum values defined below.
1301 */
1302 enum MicrophoneFailureCode {
1303 MICROPHONE_FAILURE_COMPLETE = 0;
1304 }
1305 enum CodecFailureCode {
1306 CODEC_FAILURE_COMPLETE = 0;
1307 }
1308 enum SpeakerFailureCode {
1309 SPEAKER_FAILURE_COMPLETE = 0;
1310 SPEAKER_FAILURE_HIGH_Z = 1;
1311 SPEAKER_FAILURE_SHORT = 2;
1312 }
1313 enum FingerprintFailureCode {
1314 FINGERPRINT_FAILURE_COMPLETE = 0;
1315 FINGERPRINT_SENSOR_BROKEN = 1;
1316 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1317 }
1318 optional int32 failure_code = 3;
1319}
1320
1321/**
1322 * Log an event when the device has been physically dropped.
1323 * Reported from the /vendor partition.
1324 */
1325message PhysicalDropDetected {
1326 // Confidence that the event was actually a drop, 0 -> 100
1327 optional int32 confidence_pctg = 1;
1328 // Peak acceleration of the drop, in 1/1000s of a g.
1329 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001330 // Duration of freefall in ms
1331 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001332}
1333
1334/**
1335 * Log bucketed battery charge cycles.
1336 *
1337 * Each bucket represents cycles of the battery past
1338 * a given charge point. For example, bucket 1 is the
1339 * lowest 1/8th of the battery, and bucket 8 is 100%.
1340 *
1341 * Logged from:
1342 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1343 */
1344message ChargeCyclesReported {
1345 optional int32 cycle_bucket_1 = 1;
1346 optional int32 cycle_bucket_2 = 2;
1347 optional int32 cycle_bucket_3 = 3;
1348 optional int32 cycle_bucket_4 = 4;
1349 optional int32 cycle_bucket_5 = 5;
1350 optional int32 cycle_bucket_6 = 6;
1351 optional int32 cycle_bucket_7 = 7;
1352 optional int32 cycle_bucket_8 = 8;
1353}
1354
1355/**
Howard Roa46b6582018-09-18 16:45:02 -07001356 * Log battery health snapshot.
1357 *
1358 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1359 * are snapshotted periodically over 24hrs.
1360 */
1361message BatteryHealthSnapshot {
1362 enum BatterySnapshotType {
1363 UNKNOWN = 0;
1364 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1365 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1366 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1367 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1368 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1369 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1370 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1371 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1372 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1373 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1374 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1375 }
1376 optional BatterySnapshotType type = 1;
1377 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001378 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001379 // Voltage Battery Voltage, in microVolts.
1380 optional int32 voltage_micro_volt = 3;
1381 // Current Battery current, in microAmps.
1382 optional int32 current_micro_amps = 4;
1383 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1384 optional int32 open_circuit_micro_volt = 5;
1385 // Resistance Battery Resistance, in microOhms.
1386 optional int32 resistance_micro_ohm = 6;
1387 // Level Battery Level, as % of full.
1388 optional int32 level_percent = 7;
1389}
1390
1391/**
1392 * Log slow I/O operations on the primary storage.
1393 */
1394message SlowIo {
1395 // Classifications of IO Operations.
1396 enum IoOperation {
1397 UNKNOWN = 0;
1398 READ = 1;
1399 WRITE = 2;
1400 UNMAP = 3;
1401 SYNC = 4;
1402 }
1403 optional IoOperation operation = 1;
1404
1405 // The number of slow IO operations of this type over 24 hours.
1406 optional int32 count = 2;
1407}
1408
1409/**
1410 * Log battery caused shutdown with the last recorded voltage.
1411 */
1412message BatteryCausedShutdown {
1413 // The last recorded battery voltage prior to shutdown.
1414 optional int32 last_recorded_micro_volt = 1;
1415}
1416
1417/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001418 * Logs the duration of a davey (jank of >=700ms) when it occurs
1419 *
1420 * Logged from:
1421 * frameworks/base/libs/hwui/JankTracker.cpp
1422 */
1423message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001424 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001425 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001426
Tej Singhbb8554a2018-01-26 11:59:14 -08001427 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001428 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001429}
1430
1431/**
Bookatze5885242017-10-24 20:10:31 -07001432 * Logs phone signal strength changes.
1433 *
1434 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001435 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001436 */
1437message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001438 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1439 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001440}
1441
Yangster4ccebea2018-10-09 17:09:02 -07001442
1443/**
1444 * Logs when the phone state, sim state or signal strength changes
1445 *
1446 * Logged from:
1447 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1448 */
1449message PhoneServiceStateChanged {
1450 optional android.telephony.ServiceStateEnum state = 1;
1451 optional android.telephony.SimStateEnum sim_state = 2;
1452 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1453}
1454
1455/**
1456 * Logs when the phone becomes on or off.
1457 *
1458 * Logged from:
1459 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1460 */
1461message PhoneStateChanged {
1462 enum State {
1463 OFF = 0;
1464 ON = 1;
1465 }
1466 optional State state = 1;
1467}
1468
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001469message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001470 optional android.stats.launcher.LauncherAction action = 1;
1471 optional android.stats.launcher.LauncherState src_state = 2;
1472 optional android.stats.launcher.LauncherState dst_state = 3;
1473 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001474 optional bool is_swipe_up_enabled = 5;
1475}
1476
David Chenc28b2bb2017-10-24 12:52:52 -07001477/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001478 * Logs when Settings UI has changed.
1479 *
1480 * Logged from:
1481 * packages/apps/Settings
1482 */
1483message SettingsUIChanged {
1484 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001485 * Where this SettingsUIChange event comes from. For example, if
1486 * it's a PAGE_VISIBLE event, where the page is opened from.
1487 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001488 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001489
1490 /**
1491 * What the UI action is.
1492 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001493 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001494
1495 /**
1496 * Where the action is happening
1497 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001498 optional android.app.settings.PageId pageId = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001499
1500 /**
1501 * What preference changed in this event.
1502 */
1503 optional string changedPreferenceKey = 4;
1504
1505 /**
1506 * The new value of the changed preference.
1507 */
1508 optional int64 changedPreferenceIntValue = 5;
1509}
1510
1511/**
David Chenc28b2bb2017-10-24 12:52:52 -07001512 * Logs that a setting was updated.
1513 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001514 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001515 * The tag and is_default allow resetting of settings to default values based on the specified
1516 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1517 */
1518message SettingChanged {
1519 // The name of the setting.
1520 optional string setting = 1;
1521
1522 // The change being imposed on this setting. May represent a number, eg "3".
1523 optional string value = 2;
1524
1525 // The new value of this setting. For most settings, this is same as value. For some settings,
1526 // value is +X or -X where X represents an element in a set. For example, if the previous value
1527 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1528 // The +/- feature is currently only used for location_providers_allowed.
1529 optional string new_value = 3;
1530
1531 // The previous value of this setting.
1532 optional string prev_value = 4;
1533
1534 // The tag used with the is_default for resetting sets of settings. This is generally null.
1535 optional string tag = 5;
1536
Bookatz90867622018-01-31 15:05:57 -08001537 // True if this setting with tag should be resettable.
1538 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001539
David Chenbd789912018-03-16 17:19:55 -07001540 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001541 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001542
1543 enum ChangeReason {
1544 UPDATED = 1; // Updated can be an insertion or an update.
1545 DELETED = 2;
1546 }
1547 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001548}
Chenjie Yub3dda412017-10-24 13:41:59 -07001549
Chenjie Yu05013b32017-11-21 10:21:41 -08001550/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001551 * Logs activity going to foreground or background
1552 *
1553 * Logged from:
1554 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1555 */
1556message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001557 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001558 optional string pkg_name = 2;
1559 optional string class_name = 3;
1560
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001561 enum State {
1562 BACKGROUND = 0;
1563 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001564 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001565 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001566}
David Chenc8a43242017-10-17 16:23:28 -07001567
1568/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001569 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001570 * Logged from:
1571 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1572 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001573message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001574 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001575
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001576 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001577
1578 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001579 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001580 optional string process_name = 3;
1581
1582 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001583 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001584
1585 optional string package_name = 5;
1586
1587 enum InstantApp {
1588 UNAVAILABLE = 0;
1589 FALSE = 1;
1590 TRUE = 2;
1591 }
1592 optional InstantApp is_instant_app = 6;
1593
1594 enum ForegroundState {
1595 UNKNOWN = 0;
1596 BACKGROUND = 1;
1597 FOREGROUND = 2;
1598 }
1599 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001600
1601 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001602}
David Chen9e3808c2017-11-20 17:25:34 -08001603
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001604/**
1605 * Logs when a WTF (What a Terrible Failure) happened.
1606 * Logged from:
1607 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1608 */
1609message WTFOccurred {
1610 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001611
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001612 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001613
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001614 // The name of the process.
1615 // system_server if it is not by an app
1616 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001617
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001618 // The pid if available. -1 means not available.
1619 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001620
1621 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001622}
1623
1624/**
1625 * Logs when system server reports low memory.
1626 * Logged from:
1627 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1628 */
1629message LowMemReported {
1630}
1631
1632/**
1633 * Logs when an app ANR (App Not Responding) occurs.
1634 * Logged from:
1635 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1636 */
1637message ANROccurred {
1638 optional int32 uid = 1 [(is_uid) = true];
1639
1640 optional string process_name = 2;
1641
1642 optional string short_component_name = 3;
1643
1644 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001645
1646 enum InstantApp {
1647 UNAVAILABLE = 0;
1648 FALSE = 1;
1649 TRUE = 2;
1650 }
1651 optional InstantApp is_instant_app = 5;
1652
1653 enum ForegroundState {
1654 UNKNOWN = 0;
1655 BACKGROUND = 1;
1656 FOREGROUND = 2;
1657 }
1658 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001659
1660 optional android.server.ErrorSource error_source = 7;
1661
1662 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001663}
1664
Bookatza7020bd2018-08-28 16:29:35 -07001665/**
1666 * Logs when the vibrator state changes.
1667 * Logged from:
1668 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1669 */
1670message VibratorStateChanged {
1671 repeated AttributionNode attribution_node = 1;
1672
1673 enum State {
1674 OFF = 0;
1675 ON = 1;
1676 }
1677 optional State state = 2;
1678
1679 // Duration (in milliseconds) requested to keep the vibrator on.
1680 // Only applicable for State == ON.
1681 optional int64 duration_millis = 3;
1682}
1683
David Chen0a368b22017-12-06 16:28:16 -08001684/*
1685 * Allows other apps to push events into statsd.
1686 * Logged from:
1687 * frameworks/base/core/java/android/util/StatsLog.java
1688 */
David Chen0b5c90c2018-01-25 16:51:49 -08001689message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001690 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001691 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001692
1693 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1694 optional int32 label = 2;
1695
1696 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1697 // predicates for the metrics).
1698 enum State {
1699 UNKNOWN = 0;
1700 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1701 STOP = 2;
1702 START = 3;
1703 }
1704 optional State state = 3;
1705}
1706
David Chen9e3808c2017-11-20 17:25:34 -08001707/**
Bookatz7948c872018-09-04 12:58:33 -07001708 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1709 * For example, this could be due to the user manually changing the time.
1710 *
1711 * Logged from:
1712 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1713 */
1714message WallClockTimeShifted {
1715 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1716 optional int64 wall_clock_timestamp_millis = 1;
1717}
1718
1719/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001720 * Logs when statsd detects an anomaly.
1721 *
1722 * Logged from:
1723 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1724 */
1725message AnomalyDetected {
1726 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001727 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001728
Yangster-mac94e197c2018-01-02 16:03:03 -08001729 // Id of the config whose anomaly detection alert fired.
1730 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001731
Yangster-mac94e197c2018-01-02 16:03:03 -08001732 // Id of the alert (i.e. name of the anomaly that was detected).
1733 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001734}
1735
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001736message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001737 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001738 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001739
1740 // The app package name.
1741 optional string pkg_name = 2;
1742
1743 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001744 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001745 WARM = 1;
1746 HOT = 2;
1747 COLD = 3;
1748 }
1749 // The transition type.
1750 optional TransitionType type = 3;
1751
1752 // The activity name.
1753 optional string activity_name = 4;
1754
1755 // The name of the calling app. Empty if not set.
1756 optional string calling_pkg_name = 5;
1757
1758 // Whether the app is an instant app.
1759 optional bool is_instant_app = 6;
1760
1761 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001762 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001763
Bookatz80d11a02018-01-16 10:46:35 -08001764 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001765
David Chen0b5c90c2018-01-25 16:51:49 -08001766 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001767 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001768 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001769 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001770 optional int32 bind_application_delay_millis = 11;
1771 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001772
1773 // Empty if not set.
1774 optional string launch_token = 13;
1775
Calin Juravle759fbda2018-02-20 19:52:30 +00001776 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001777 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001778
1779 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001780 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001781}
1782
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001783message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001784 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001785 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001786
1787 // The app package name.
1788 optional string pkg_name = 2;
1789
1790 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001791 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001792 WARM = 1;
1793 HOT = 2;
1794 COLD = 3;
1795 }
1796 // The transition type.
1797 optional TransitionType type = 3;
1798
1799 // The activity name.
1800 optional string activity_name = 4;
1801}
1802
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001803message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001804 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001805 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001806
1807 // The app package name.
1808 optional string pkg_name = 2;
1809
1810 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001811 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001812 WITH_BUNDLE = 1;
1813 WITHOUT_BUNDLE = 2;
1814 }
1815 // The transition type.
1816 optional TransitionType type = 3;
1817
1818 // The activity name.
1819 optional string activity_name = 4;
1820
1821 optional bool transition_process_running = 5;
1822
1823 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001824 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001825}
1826
Bookatz8fcd09a2017-12-18 13:01:10 -08001827/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001828 * Logs a picture-in-picture action
1829 * Logged from:
1830 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1831 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1832 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1833 */
1834message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001835 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001836 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001837
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001838 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001839
Chenjie Yu52cacc62017-12-08 18:11:45 -08001840 enum State {
1841 ENTERED = 1;
1842 EXPANDED_TO_FULL_SCREEN = 2;
1843 MINIMIZED = 3;
1844 DISMISSED = 4;
1845 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001846 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001847}
1848
1849/**
Chenjie Yue8904192017-12-08 19:12:57 -08001850 * Logs overlay action
1851 * Logged from:
1852 * services/core/java/com/android/server/wm/Session.java
1853 */
1854message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001855 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001856
1857 optional string package_name = 2;
1858
1859 optional bool using_alert_window = 3;
1860
1861 enum State {
1862 ENTERED = 1;
1863 EXITED = 2;
1864 }
1865 optional State state = 4;
1866}
1867
Chenjie Yuccfe6452018-01-30 11:33:21 -08001868/*
1869 * Logs foreground service starts and stops.
1870 * Note that this is not when a service starts or stops, but when it is
1871 * considered foreground.
1872 * Logged from
1873 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1874 */
1875message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001876 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001877 // package_name + "/" + class_name
1878 optional string short_name = 2;
1879
1880 enum State {
1881 ENTER = 1;
1882 EXIT = 2;
1883 }
1884 optional State state = 3;
1885}
1886
Chenjie Yue8904192017-12-08 19:12:57 -08001887/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001888 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1889 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1890 * attributed back to the parent (host) uid. One example is Chrome.
1891 *
1892 * Logged from:
1893 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1894 */
1895message IsolatedUidChanged {
1896 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001897 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001898 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001899 optional int32 parent_uid = 1;
1900
1901 optional int32 isolated_uid = 2;
1902
1903 // We expect an isolated uid to be removed before if it's used for another parent uid.
1904 enum Event {
1905 REMOVED = 0;
1906 CREATED = 1;
1907 }
1908 optional Event event = 3;
1909}
1910
1911/*
1912 * Logs the reception of an incoming network packet causing the main system to wake up for
1913 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1914 * and processed by WakeupController.cpp.
1915 */
1916message PacketWakeupOccurred {
1917 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1918 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001919 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001920 // The interface name on which the packet was received.
1921 optional string iface = 2;
1922 // The ethertype value of the packet.
1923 optional int32 ethertype = 3;
1924 // String representation of the destination MAC address of the packet.
1925 optional string destination_hardware_address = 4;
1926 // String representation of the source address of the packet if this was an IP packet.
1927 optional string source_ip = 5;
1928 // String representation of the destination address of the packet if this was an IP packet.
1929 optional string destination_ip = 6;
1930 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1931 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1932 // families.
1933 optional int32 ip_next_header = 7;
1934 // The source port if this was a TCP or UDP packet.
1935 optional int32 source_port = 8;
1936 // The destination port if this was a TCP or UDP packet.
1937 optional int32 destination_port = 9;
1938}
1939
1940/*
1941 * Logs the memory stats for an app on startup.
1942 * Logged from:
1943 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1944 */
1945message AppStartMemoryStateCaptured {
1946 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001947 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001948
1949 // The process name.
1950 optional string process_name = 2;
1951
1952 // The activity name.
1953 optional string activity_name = 3;
1954
1955 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001956 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001957
1958 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001959 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001960
1961 // RSS
1962 optional int64 rss_in_bytes = 6;
1963
1964 // CACHE
1965 optional int64 cache_in_bytes = 7;
1966
1967 // SWAP
1968 optional int64 swap_in_bytes = 8;
1969}
1970
1971/*
1972 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1973 * for LMK event.
1974 * Logged from:
1975 * system/core/lmkd/lmkd.c
1976 */
1977message LmkStateChanged {
1978 enum State {
1979 UNKNOWN = 0;
1980 START = 1;
1981 STOP = 2;
1982 }
1983 optional State state = 1;
1984}
1985
1986/*
1987 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1988 * Logged from:
1989 * system/core/lmkd/lmkd.c
1990 */
1991message LmkKillOccurred {
1992 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001993 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001994
1995 // The process name.
1996 optional string process_name = 2;
1997
1998 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07001999 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002000
2001 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002002 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002003
2004 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002005 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002006
2007 // RSS
2008 optional int64 rss_in_bytes = 6;
2009
2010 // CACHE
2011 optional int64 cache_in_bytes = 7;
2012
2013 // SWAP
2014 optional int64 swap_in_bytes = 8;
2015}
2016
Rajeev Kumar51b54602018-03-01 12:18:26 -08002017/*
2018 * Logs when the ActivityManagerService detects that an app died.
2019 *
2020 * Logged from:
2021 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2022 */
2023message AppDied {
2024 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002025 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002026}
2027
Howard Ro21a039c2018-08-06 14:55:47 -07002028/**
2029 * An atom for generic metrics logging. Available from Android Q.
2030 */
2031message GenericAtom {
2032 // The uid of the application that sent this custom atom.
2033 optional int32 uid = 1 [(is_uid) = true];
2034
2035 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002036 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002037}
2038
Tej Singhd6d6d772018-09-05 17:41:25 -07002039/**
2040 * Logs when a fingerprint acquire event occurs.
2041 *
2042 * Logged from:
2043 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2044 */
2045message FingerprintAcquired {
2046 // The associated user. Eg: 0 for owners, 10+ for others.
2047 // Defined in android/os/UserHandle.java
2048 optional int32 user = 1;
2049 // If this acquire is for a crypto fingerprint.
2050 // e.g. Secure purchases, unlock password storage.
2051 optional bool is_crypto = 2;
2052}
2053
2054/**
2055 * Logs when a fingerprint authentication event occurs.
2056 *
2057 * Logged from:
2058 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2059 */
2060message FingerprintAuthenticated {
2061 // The associated user. Eg: 0 for owners, 10+ for others.
2062 // Defined in android/os/UserHandle.java
2063 optional int32 user = 1;
2064 // If this authentication is for a crypto fingerprint.
2065 // e.g. Secure purchases, unlock password storage.
2066 optional bool is_crypto = 2;
2067 // Whether or not this authentication was successful.
2068 optional bool is_authenticated = 3;
2069}
2070
2071/**
2072 * Logs when a fingerprint error occurs.
2073 *
2074 * Logged from:
2075 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2076 */
2077message FingerprintErrorOccurred {
2078 // The associated user. Eg: 0 for owners, 10+ for others.
2079 // Defined in android/os/UserHandle.java
2080 optional int32 user = 1;
2081 // If this error is for a crypto fingerprint.
2082 // e.g. Secure purchases, unlock password storage.
2083 optional bool is_crypto = 2;
2084
2085 enum Error {
2086 UNKNOWN = 0;
2087 LOCKOUT = 1;
2088 PERMANENT_LOCKOUT = 2;
2089 }
2090 // The type of error.
2091 optional Error error = 3;
2092}
Howard Ro688ae182018-09-25 00:09:36 -07002093
2094message Notification {
2095
2096 // Type of notification event.
2097 enum Type {
2098 TYPE_UNKNOWN = 0;
2099 // Notification became visible to the user.
2100 TYPE_OPEN = 1;
2101 // Notification became hidden.
2102 TYPE_CLOSE = 2;
2103 // Notification switched to detail mode.
2104 TYPE_DETAIL = 3;
2105 // Notification was clicked.
2106 TYPE_ACTION = 4;
2107 // Notification was dismissed.
2108 TYPE_DISMISS = 5;
2109 // Notification switched to summary mode. The enum value of 14 is to
2110 // match that of metrics_constants.
2111 TYPE_COLLAPSE = 14;
2112 }
2113 optional Type type = 1;
2114
2115 // Package name associated with the notification.
2116 optional string package_name = 2;
2117
2118 // Tag associated with notification.
2119 optional string tag = 3;
2120
2121 // Application-supplied ID associated with the notification.
2122 optional int32 id = 4;
2123
2124 // Index of notification in the notification panel.
2125 optional int32 shade_index = 5;
2126
2127 // The number of notifications in the notification panel.
2128 optional int32 shade_count = 6;
2129
2130 // Importance for the notification.
2131 optional int32 importance = 7;
2132
2133 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002134 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002135
2136 // Importance for the notification channel.
2137 optional int32 channel_importance = 9;
2138
Howard Ro183c2bd2018-10-18 13:52:10 -07002139 // Application-supplied ID associated with the notifications group.
2140 optional string group_id = 10;
2141
Howard Ro688ae182018-09-25 00:09:36 -07002142 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002143 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002144
Howard Ro183c2bd2018-10-18 13:52:10 -07002145 // Reason for dismissal of a notification. This field is only meaningful for
2146 // TYPE_DISMISS events.
2147 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002148
Howard Ro183c2bd2018-10-18 13:52:10 -07002149 // The first post time of notification, stable across updates.
2150 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002151
Howard Ro183c2bd2018-10-18 13:52:10 -07002152 // The most recent interruption time, or the creation time if no updates.
2153 // Differs from update_millis because updates are filtered based on whether
2154 // they actually interrupted the user.
2155 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002156
Howard Ro183c2bd2018-10-18 13:52:10 -07002157 // The most recent update time, or the creation time if no updates.
2158 optional int64 update_millis = 15;
2159
2160 // The most recent visibility event.
2161 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002162}
2163
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002164/*
Yangster-macb89807e2018-11-15 21:10:57 -08002165 * Logs when a flag flip state changes.
2166 * Logged in P/h.
2167 */
2168message PhenotypeFlagStateChanged {
2169 // Mendel configuration name.
2170 optional string mendel_config_name = 1;
2171 // State
2172 enum State {
2173 STATE_UNKNOWN = 0;
2174 COMMITTED = 1;
2175 }
2176 optional State state = 2;
2177}
2178
2179/*
2180 * Logs when a binary push state changes.
2181 * Logged in Play store
2182 */
2183message BinaryPushStateChanged {
2184 // Binary package name.
2185 optional string binary_name = 1;
2186 // Version code.
2187 optional int64 version = 2;
2188 // State
2189 enum State {
2190 STATE_UNKNOWN = 0;
2191 DOWNLOAD_START = 1;
2192 DOWNLOAD_DONE = 2;
2193 INSTALL_START = 3;
2194 INSTALL_DONE = 4;
2195 REBOOT_START = 5;
2196 REBOOT_DONE = 6;
2197 }
2198 optional State state = 3;
2199}
2200
2201/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002202 * Logs when a connection becomes available and lost.
2203 * Logged in StatsCompanionService.java
2204 */
2205message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002206 // Id of the network.
2207 optional int32 net_id = 1;
2208
2209 enum State {
2210 UNKNOWN = 0;
2211 CONNECTED = 1;
2212 DISCONNECTED = 2;
2213 }
2214 // Connected state of a network.
2215 optional State state = 2;
2216}
2217
2218/**
2219 * Logs when a service starts and stops.
2220 * Logged from:
2221 * services/core/java/com/android/server/am/ActiveServices.java
2222 */
2223message ServiceStateChanged {
2224
2225 optional int32 uid = 1 [(is_uid) = true];
2226
2227 optional string package_name = 2;
2228
2229 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002230
2231 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002232 START = 1;
2233 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002234 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002235
2236 optional State state = 4;
2237}
2238
2239/**
2240 * Logs when a service is launched.
2241 * Logged from:
2242 * services/core/java/com/android/server/am/ActiveServices.java
2243 */
2244message ServiceLaunchReported {
2245
2246 optional int32 uid = 1 [(is_uid) = true];
2247
2248 optional string package_name = 2;
2249
2250 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002251}
Howard Ro688ae182018-09-25 00:09:36 -07002252
Chenjie Yubbcbc602018-02-05 16:51:52 -08002253//////////////////////////////////////////////////////////////////////
2254// Pulled atoms below this line //
2255//////////////////////////////////////////////////////////////////////
2256
2257/**
David Chenc8a43242017-10-17 16:23:28 -07002258 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2259 *
2260 * Pulled from:
2261 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2262 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002263message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002264 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002265
2266 optional int64 rx_bytes = 2;
2267
2268 optional int64 rx_packets = 3;
2269
2270 optional int64 tx_bytes = 4;
2271
2272 optional int64 tx_packets = 5;
2273}
2274
2275/**
2276 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2277 *
2278 * Pulled from:
2279 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2280 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002281message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002282 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002283
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002284 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2285 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002286
2287 optional int64 rx_bytes = 3;
2288
2289 optional int64 rx_packets = 4;
2290
2291 optional int64 tx_bytes = 5;
2292
2293 optional int64 tx_packets = 6;
2294}
2295
2296/**
2297 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2298 *
2299 * Pulled from:
2300 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2301 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002302message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002303 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002304
2305 optional int64 rx_bytes = 2;
2306
2307 optional int64 rx_packets = 3;
2308
2309 optional int64 tx_bytes = 4;
2310
2311 optional int64 tx_packets = 5;
2312}
2313
2314/**
2315 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2316 *
2317 * Pulled from:
2318 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2319 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002320message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002321 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002322
Yao Chenc40a19d2018-03-15 16:48:25 -07002323 // 1 denotes foreground and 0 denotes background. This is called Set in
2324 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002325 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002326
2327 optional int64 rx_bytes = 3;
2328
2329 optional int64 rx_packets = 4;
2330
2331 optional int64 tx_bytes = 5;
2332
2333 optional int64 tx_packets = 6;
2334}
2335
2336/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002337 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2338 *
2339 * Pulled from:
2340 * StatsCompanionService
2341 */
2342message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002343 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002344
2345 optional int64 rx_bytes = 2;
2346
2347 optional int64 tx_bytes = 3;
2348}
2349
2350/**
David Chenc8a43242017-10-17 16:23:28 -07002351 * Pulls the kernel wakelock durations. This atom is adapted from
2352 * android/internal/os/KernelWakelockStats.java
2353 *
2354 * Pulled from:
2355 * StatsCompanionService using KernelWakelockReader.
2356 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002357message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002358 optional string name = 1;
2359
2360 optional int32 count = 2;
2361
2362 optional int32 version = 3;
2363
Yangster-maca8a30442018-10-13 23:46:34 -07002364 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002365}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002366
Chenjie Yu05013b32017-11-21 10:21:41 -08002367/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002368 * Pulls low power state information. This includes platform and subsystem sleep state information,
2369 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002370 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002371 * hardware/interfaces/power/1.1/types.hal
2372 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002373message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002374 // Subsystem name
2375 optional string subsystem_name = 1;
2376 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2377 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2378 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002379 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002380 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002381 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002382 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002383}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002384
Chenjie Yu05013b32017-11-21 10:21:41 -08002385/**
Bookatz92da2832018-11-01 18:10:03 -07002386 * Pulls on-device power measurement information.
2387 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2388 * Pulled from:
2389 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2390 */
2391message OnDevicePowerMeasurement {
2392 // Name of the subsystem (to which the rail belongs).
2393 optional string subsystem_name = 1;
2394
2395 // Rail name. The rail lies within the subsystem.
2396 optional string rail_name = 2;
2397
2398 // Time (in ms since boot) at which the rail energy value was measured.
2399 // This may differ slightly from the time that statsd logs this information.
2400 optional uint64 measurement_timestamp_millis = 3;
2401
2402 // Accumulated energy used via the rail since device boot in uWs.
2403 optional uint64 energy_microwatt_secs = 4;
2404}
2405
2406/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002407 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002408 * Pulls the time the cpu spend on the frequency index. Frequency index
2409 * starts from highest to lowest. The value should be monotonically
2410 * increasing since boot. However, if there is a cpu
2411 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002412 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002413message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002414 optional uint32 cluster = 1;
2415 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002416 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002417}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002418
Chenjie Yu05013b32017-11-21 10:21:41 -08002419/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002420 * Pulls Cpu Time Per Uid.
2421 * Note that isolated process uid time should be attributed to host uids.
2422 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002423message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002424 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002425 optional uint64 user_time_micros = 2;
2426 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002427}
2428
2429/**
2430 * Pulls Cpu Time Per Uid per frequency.
2431 * Note that isolated process uid time should be attributed to host uids.
2432 * For each uid, we order the time by descending frequencies.
2433 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002434message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002435 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002436 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002437 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002438}
Hugo Benichi884970e2017-11-14 22:42:46 +09002439
Chenjie Yu05013b32017-11-21 10:21:41 -08002440/**
2441 * Pulls Wifi Controller Activity Energy Info
2442 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002443message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002444 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002445 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002446 // stack reported state
2447 // TODO: replace this with proto enum
2448 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002449 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002450 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002451 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002452 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002453 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002454 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002455 // product of current(mA), voltage(V) and time(ms)
2456 optional uint64 controller_energy_used = 6;
2457}
2458
2459/**
2460 * Pulls Modem Activity Energy Info
2461 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002462message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002463 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002464 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002465 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002466 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002467 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002468 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002469 /**
2470 * Tx power index
2471 * index 0 = tx_power < 0dBm
2472 * index 1 = 0dBm < tx_power < 5dBm
2473 * index 2 = 5dBm < tx_power < 15dBm
2474 * index 3 = 15dBm < tx_power < 20dBm
2475 * index 4 = tx_power > 20dBm
2476 */
2477 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002478 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002479 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002480 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002481 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002482 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002483 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002484 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002485 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002486 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002487 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002488 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002489 // product of current(mA), voltage(V) and time(ms)
2490 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002491}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002492
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002493/**
2494 * Pulls Bluetooth Activity Energy Info
2495 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2496 */
2497message BluetoothActivityInfo {
2498 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002499 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002500 // bluetooth stack state
2501 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002502 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002503 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002504 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002505 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002506 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002507 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002508 // product of current(mA), voltage(V) and time(ms)
2509 optional uint64 energy_used = 6;
2510}
2511
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002512/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002513 * Logs the memory stats for a process.
2514 */
2515message ProcessMemoryState {
2516 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002517 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002518
2519 // The process name.
2520 optional string process_name = 2;
2521
2522 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002523 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002524
2525 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002526 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002527
2528 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002529 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002530
Rajeev Kumar90235992018-01-29 11:06:48 -08002531 // RSS
2532 optional int64 rss_in_bytes = 6;
2533
2534 // CACHE
2535 optional int64 cache_in_bytes = 7;
2536
2537 // SWAP
2538 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002539
2540 // RSS high watermark.
2541 // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status or
2542 // from memory.max_usage_in_bytes under /dev/memcg if the device uses per-app memory cgroups.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002543 // Deprecated: use ProcessMemoryHighWaterMark atom instead.
2544 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002545
2546 // Elapsed real time when the process started.
2547 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2548 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002549}
2550
2551/*
Rafal Slawik08621582018-10-15 14:53:07 +01002552 * Logs the memory stats for a native process (from procfs).
2553 */
2554message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002555 // The uid if available. -1 means not available.
2556 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002557
Rafal Slawikbf67d072018-10-23 11:07:54 +01002558 // The process name.
2559 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002560
Rafal Slawikbf67d072018-10-23 11:07:54 +01002561 // # of page-faults
2562 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002563
Rafal Slawikbf67d072018-10-23 11:07:54 +01002564 // # of major page-faults
2565 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002566
Rafal Slawikbf67d072018-10-23 11:07:54 +01002567 // RSS
2568 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002569
Rafal Slawikbf67d072018-10-23 11:07:54 +01002570 // RSS high watermark.
2571 // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002572 // Deprecated: use ProcessMemoryHighWaterMark atom instead.
2573 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002574
2575 // Elapsed real time when the process started.
2576 // Value is read from /proc/PID/stat, field 22.
2577 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002578}
2579
2580/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002581 * Logs the memory high-water mark for a process.
2582 * Recorded in ActivityManagerService.
2583 */
2584message ProcessMemoryHighWaterMark {
2585 // The uid if available. -1 means not available.
2586 optional int32 uid = 1 [(is_uid) = true];
2587
2588 // The process name. Provided by ActivityManagerService or read from /proc/PID/cmdline.
2589 optional string process_name = 2;
2590
2591 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2592 // /proc/PID/status.
2593 optional int64 rss_high_water_mark_in_bytes = 3;
2594}
2595
2596/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002597 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002598 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002599message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002600 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002601}
2602
2603/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002604 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002605 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002606message SystemUptime {
2607 // Milliseconds since the system was booted.
2608 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2609 // for external input).
2610 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002611 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002612}
2613
2614/*
2615 * Reads from /proc/uid_concurrent_active_time which has the format:
2616 * active: X (X is # cores)
2617 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2618 * [uid1]: [time-0] [time-1] [time-2] ... ...
2619 * ...
2620 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2621 * The file contains a monotonically increasing count of time for a single boot.
2622 */
2623message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002624 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002625 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002626}
2627
2628/**
2629 * Reads from /proc/uid_concurrent_policy_time which has the format:
2630 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2631 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2632 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2633 * ...
2634 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2635 * The file contains a monotonically increasing count of time for a single boot.
2636 */
2637message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002638 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002639 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002640 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002641}
2642
2643/*
2644 * Pulls free disk space, for data, system partition and temporary directory.
2645 */
2646message DiskSpace {
2647 // available bytes in data partition
2648 optional uint64 data_available_bytes = 1;
2649 // available bytes in system partition
2650 optional uint64 system_available_bytes = 2;
2651 // available bytes in download cache or temp directories
2652 optional uint64 temp_available_bytes = 3;
2653}
Tej Singhbf972d92018-01-10 20:51:13 -08002654
2655/**
2656 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002657 * Pulled from:
2658 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002659 */
2660message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002661 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002662}
2663
2664/**
2665 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002666 * Pulled from:
2667 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002668 */
2669message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002670 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002671}
2672
2673/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002674 * Pulls battery voltage.
2675 * Pulled from:
2676 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2677 */
2678message BatteryVoltage {
2679 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07002680 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07002681}
2682
2683/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08002684 * Pulls battery level (percent full, from 0 to 100).
2685 *
2686 * Pulled from:
2687 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2688 */
2689message BatteryLevel {
2690 // Battery level. Should be in [0, 100].
2691 optional int32 battery_level = 1;
2692}
2693
2694/**
Tej Singhd89137e2018-03-26 14:51:40 -07002695 * Pulls the temperature of various parts of the device.
2696 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002697 *
2698 * Pulled from:
2699 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2700 */
2701message Temperature {
2702 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2703 optional android.os.TemperatureTypeEnum sensor_location = 1;
2704
2705 // The name of the temperature source. Eg. CPU0
2706 optional string sensor_name = 2;
2707
Tej Singhd89137e2018-03-26 14:51:40 -07002708 // Temperature in tenths of a degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002709 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08002710}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002711
2712/**
2713 * Pulls the statistics of calls to Binder.
2714 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002715 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2716 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002717 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002718 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002719 */
2720message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002721 // UID of the process responsible for the binder transaction. It will be set if the process
2722 // executing the binder transaction attribute the transaction to another uid using
2723 // Binder.setThreadWorkSource().
2724 //
2725 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002726 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002727 // UID of the process executing the binder transaction.
2728 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002729 // Fully qualified class name of the API call.
2730 //
2731 // This is a system server class name.
2732 //
2733 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2734 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2735 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2736 // commonly used APIs.
2737 optional string service_class_name = 2;
2738 // Method name of the API call. It can also be a transaction code if we cannot
2739 // resolve it to a name. See Binder#getTransactionName.
2740 //
2741 // This is a system server method name.
2742 optional string service_method_name = 3;
2743 // Total number of API calls.
2744 optional int64 call_count = 4;
2745 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2746 optional bool screen_interactive = 13;
2747 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2748 // call_count will be equal to recorded_call_count.
2749 //
2750 // If recorded_call_count is different than call_count, it means data collection has been
2751 // sampled. All the fields below will be sampled in this case.
2752 optional int64 recorded_call_count = 12;
2753 // Number of exceptions thrown by the API.
2754 optional int64 recorded_exception_count = 5;
2755 // Total latency of all API calls.
2756 // Average can be computed using total_latency_micros / recorded_call_count.
2757 optional int64 recorded_total_latency_micros = 6;
2758 // Maximum latency of one API call.
2759 optional int64 recorded_max_latency_micros = 7;
2760 // Total CPU usage of all API calls.
2761 // Average can be computed using total_cpu_micros / recorded_call_count.
2762 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2763 optional int64 recorded_total_cpu_micros = 8;
2764 // Maximum CPU usage of one API call.
2765 optional int64 recorded_max_cpu_micros = 9;
2766 // Maximum parcel reply size of one API call.
2767 optional int64 recorded_max_reply_size_bytes = 10;
2768 // Maximum parcel request size of one API call.
2769 optional int64 recorded_max_request_size_bytes = 11;
2770}
2771
2772/**
2773 * Pulls the statistics of exceptions during calls to Binder.
2774 *
2775 * Binder stats are cumulative from boot unless somebody reset the data using
2776 * > adb shell dumpsys binder_calls_stats --reset
2777 */
2778message BinderCallsExceptions {
2779 // Exception class name, e.g. java.lang.IllegalArgumentException.
2780 //
2781 // This is an exception class name thrown by the system server.
2782 optional string exception_class_name = 1;
2783 // Total number of exceptions.
2784 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002785}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002786
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002787/**
2788 * Pulls the statistics of message dispatching on HandlerThreads.
2789 *
2790 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2791 * config on the device.
2792 *
2793 * Next tag: 11
2794 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002795message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002796 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002797 optional int32 uid = 1 [(is_uid) = true];
2798
2799 // Fully qualified class name of the handler target class.
2800 //
2801 // This field does not contain PII. This is a system server class name.
2802 optional string handler_class_name = 2;
2803
2804 // The name of the thread that runs the Looper.
2805 //
2806 // This field does not contain PII. This is a system server thread name.
2807 optional string looper_thread_name = 3;
2808
2809 // The name of the dispatched message.
2810 //
2811 // This field does not contain PII. This is a system server constant or class
2812 // name.
2813 optional string message_name = 4;
2814
2815 // Total number of successfully dispatched messages.
2816 optional int64 message_count = 5;
2817
2818 // Total number of messages that failed dispatching.
2819 optional int64 exception_count = 6;
2820
2821 // Total number of processed messages we have data recorded for. If we
2822 // collected data for all the messages, message_count will be equal to
2823 // recorded_message_count.
2824 //
2825 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002826 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002827 optional int64 recorded_message_count = 7;
2828
2829 // Total latency of all processed messages.
2830 // Average can be computed using recorded_total_latency_micros /
2831 // recorded_message_count.
2832 optional int64 recorded_total_latency_micros = 8;
2833
2834 // Total CPU usage of all processed message.
2835 // Average can be computed using recorded_total_cpu_micros /
2836 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002837 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002838 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002839
2840 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2841 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002842
2843 // Max recorded CPU usage of all processed messages.
2844 optional int64 recorded_max_cpu_micros = 11;
2845
2846 // Max recorded latency of all processed messages.
2847 optional int64 recorded_max_latency_micros = 12;
2848
2849 // Total number of messages we tracked the dispatching delay for. If we
2850 // collected data for all the messages, message_count will be equal to
2851 // recorded_delay_message_count.
2852 //
2853 // If recorded_delay_message_count is different than message_count, it means data
2854 // collection has been sampled or/and not all messages specified the target dispatch time.
2855 // The fields below will be sampled in this case.
2856 optional int64 recorded_delay_message_count = 13;
2857
2858 // Total dispatching delay of all processed messages.
2859 // Calculated as a difference between the target dispatching time (Message.when)
2860 // and the actual dispatching time.
2861 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
2862 optional int64 recorded_total_delay_millis = 14;
2863
2864 // Max dispatching delay of all processed messages.
2865 // Calculated as a difference between the target dispatching time (Message.when)
2866 // and the actual dispatching time.
2867 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002868}
Tej Singh86dc9db2018-09-06 00:39:57 +00002869
2870/**
2871 * Pulls disk information, such as write speed and latency.
2872 */
2873message DiskStats {
2874 // Time taken to open, write 512B to, and close a file.
2875 // -1 if error performing the check.
2876 optional int64 data_write_latency_millis = 1;
2877
2878 optional bool file_based_encryption = 2;
2879
2880 // Recent disk write speed in kB/s.
2881 // -1 if error querying storageed.
2882 // 0 if data is unavailable.
2883 optional int32 recent_disk_write_speed = 3;
2884}
2885
2886
2887/**
2888 * Free and total bytes of the Data, Cache, and System partition.
2889 */
2890message DirectoryUsage {
2891 enum Directory {
2892 UNKNOWN = 0;
2893 DATA = 1;
2894 CACHE = 2;
2895 SYSTEM = 3;
2896 }
2897 optional Directory directory = 1;
2898 optional int64 free_bytes = 2;
2899 optional int64 total_bytes = 3;
2900}
2901
2902
2903/**
2904 * Size of an application: apk size, data size, and cache size.
2905 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2906 * Information is only reported for apps with the primary user (user 0).
2907 * Sizes are aggregated by package name.
2908 */
2909message AppSize {
2910 // Including uids will involve modifying diskstats logic.
2911 optional string package_name = 1;
2912 // App size in bytes. -1 if unavailable.
2913 optional int64 app_size_bytes = 2;
2914 // App data size in bytes. -1 if unavailable.
2915 optional int64 app_data_size_bytes = 3;
2916 // App cache size in bytes. -1 if unavailable.
2917 optional int64 app_cache_size_bytes = 4;
2918 // Time that the cache file was produced.
2919 // Uses System.currentTimeMillis(), which is wall clock time.
2920 optional int64 cache_time_millis = 5;
2921}
2922
2923
2924/**
2925 * Size of a particular category. Eg: photos, videos.
2926 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2927 */
2928message CategorySize {
2929 enum Category {
2930 UNKNOWN = 0;
2931 APP_SIZE = 1;
2932 APP_DATA_SIZE = 2;
2933 APP_CACHE_SIZE = 3;
2934 PHOTOS = 4;
2935 VIDEOS = 5;
2936 AUDIO = 6;
2937 DOWNLOADS = 7;
2938 SYSTEM = 8;
2939 OTHER = 9;
2940 }
2941 optional Category category = 1;
2942 // Category size in bytes.
2943 optional int64 size_bytes = 2;
2944 // Time that the cache file was produced.
2945 // Uses System.currentTimeMillis(), which is wall clock time.
2946 optional int64 cache_time_millis = 3;
2947}
Tej Singhd6d6d772018-09-05 17:41:25 -07002948
2949/**
Tej Singhe7726dc2018-09-21 11:42:12 -07002950 * Pulls per uid I/O stats. The stats are cumulative since boot.
2951 *
2952 * Read/write bytes are I/O events from a storage device
2953 * Read/write chars are data requested by read/write syscalls, and can be
2954 * satisfied by caching.
2955 *
2956 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
2957 */
2958message DiskIo {
2959 optional int32 uid = 1 [(is_uid) = true];
2960 optional int64 fg_chars_read = 2;
2961 optional int64 fg_chars_write = 3;
2962 optional int64 fg_bytes_read = 4;
2963 optional int64 fg_bytes_write = 5;
2964 optional int64 bg_chars_read = 6;
2965 optional int64 bg_chars_write = 7;
2966 optional int64 bg_bytes_read = 8;
2967 optional int64 bg_bytes_write = 9;
2968 optional int64 fg_fsync = 10;
2969 optional int64 bg_fsync= 11;
2970}
2971
2972
2973/**
Tej Singhd6d6d772018-09-05 17:41:25 -07002974 * Pulls the number of fingerprints for each user.
2975 *
2976 * Pulled from StatsCompanionService, which queries FingerprintManager.
2977 */
2978message NumFingerprints {
2979 // The associated user. Eg: 0 for owners, 10+ for others.
2980 // Defined in android/os/UserHandle.java
2981 optional int32 user = 1;
2982 // Number of fingerprints registered to that user.
2983 optional int32 num_fingerprints = 2;
2984}
Chenjie Yu12e5e672018-09-14 15:54:59 -07002985
Yangsteraf9aee72018-10-12 09:26:16 -07002986message AggStats {
2987 optional int64 min = 1;
2988
2989 optional int64 average = 2;
2990
2991 optional int64 max = 3;
2992}
2993
2994message ProcessStatsStateProto {
2995 optional android.service.procstats.ScreenState screen_state = 1;
2996
2997 optional android.service.procstats.MemoryState memory_state = 2;
2998
2999 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3000 // and not frameworks/base/core/java/android/app/ActivityManager.java
3001 optional android.service.procstats.ProcessState process_state = 3;
3002
3003 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003004 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003005
3006 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003007 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003008
3009 // # of samples taken
3010 optional int32 sample_size = 5;
3011
3012 // PSS is memory reserved for this process
3013 optional AggStats pss = 6;
3014
3015 // USS is memory shared between processes, divided evenly for accounting
3016 optional AggStats uss = 7;
3017
3018 // RSS is memory resident for this process
3019 optional AggStats rss = 8;
3020}
3021
3022// Next Tag: 7
3023message ProcessStatsProto {
3024 // Name of process.
3025 optional string process = 1;
3026
3027 // Uid of the process.
3028 optional int32 uid = 2;
3029
3030 // Information about how often kills occurred
3031 message Kill {
3032 // Count of excessive CPU kills
3033 optional int32 cpu = 1;
3034
3035 // Count of kills when cached
3036 optional int32 cached = 2;
3037
3038 // PSS stats during cached kill
3039 optional AggStats cached_pss = 3;
3040 }
3041 optional Kill kill = 3;
3042
3043 // Time and memory spent in various states.
3044 repeated ProcessStatsStateProto states = 5;
3045
3046 // Total time process has been running... screen_state, memory_state, and process_state
3047 // will not be set.
3048 optional ProcessStatsStateProto total_running_state = 6;
3049}
3050
3051message PackageServiceOperationStatsProto {
3052 // Operate enum: Started, Foreground, Bound, Executing
3053 optional android.service.procstats.ServiceOperationState operation = 1;
3054
3055 // Number of times the service was in this operation.
3056 optional int32 count = 2;
3057
3058 // Information about a state the service can be in.
3059 message StateStats {
3060 // Screen state enum.
3061 optional android.service.procstats.ScreenState screen_state = 1;
3062 // Memory state enum.
3063 optional android.service.procstats.MemoryState memory_state = 2;
3064
3065 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003066 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003067 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003068 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003069 }
3070 repeated StateStats state_stats = 3;
3071}
3072
3073message PackageServiceStatsProto {
3074 // Name of service component.
3075 optional string service_name = 1;
3076
3077 // The operation stats.
3078 // The package_name, package_uid, package_version, service_name will not be set to save space.
3079 repeated PackageServiceOperationStatsProto operation_stats = 2;
3080}
3081
3082message PackageAssociationSourceProcessStatsProto {
3083 // Uid of the process.
3084 optional int32 process_uid = 1;
3085 // Process name.
3086 optional string process_name = 2;
3087
3088 // Total count of the times this association appeared.
3089 optional int32 total_count = 3;
3090
3091 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003092 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003093
3094 // Total count of the times this association became actively impacting its target process.
3095 optional int32 active_count = 5;
3096
3097 // Information on one source in this association.
3098 message StateStats {
3099 // Process state enum.
3100 optional android.service.procstats.ProcessState process_state = 1;
3101 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003102 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003103 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003104 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003105 }
3106 repeated StateStats active_state_stats = 6;
3107}
3108
3109message PackageAssociationProcessStatsProto {
3110 // Name of the target component.
3111 optional string component_name = 1;
3112 // Information on one source in this association.
3113 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3114}
3115
3116
3117message ProcessStatsPackageProto {
3118 // Name of package.
3119 optional string package = 1;
3120
3121 // Uid of the package.
3122 optional int32 uid = 2;
3123
3124 // Version of the package.
3125 optional int64 version = 3;
3126
3127 // Stats for each process running with the package loaded in to it.
3128 repeated ProcessStatsProto process_stats = 4;
3129
3130 // Stats for each of the package's services.
3131 repeated PackageServiceStatsProto service_stats = 5;
3132
3133 // Stats for each association with the package.
3134 repeated PackageAssociationProcessStatsProto association_stats = 6;
3135}
3136
3137message ProcessStatsSectionProto {
3138 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003139 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003140
3141 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003142 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003143
3144 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003145 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003146
3147 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003148 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003149
3150 // System runtime library. e.g. "libdvm.so", "libart.so".
3151 optional string runtime = 5;
3152
3153 // whether kernel reports swapped pss.
3154 optional bool has_swapped_pss = 6;
3155
3156 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3157 enum Status {
3158 STATUS_UNKNOWN = 0;
3159 STATUS_COMPLETE = 1;
3160 STATUS_PARTIAL = 2;
3161 STATUS_SHUTDOWN = 3;
3162 STATUS_SYSPROPS = 4;
3163 }
3164 repeated Status status = 7;
3165
3166 // Stats for each process.
3167 repeated ProcessStatsProto process_stats = 8;
3168
3169 // Stats for each package.
3170 repeated ProcessStatsPackageProto package_stats = 9;
3171}
3172
Chenjie Yu12e5e672018-09-14 15:54:59 -07003173/**
3174 * Pulled from ProcessStatsService.java
3175 */
3176message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003177 optional ProcessStatsSectionProto proc_stats_section = 1;
3178}
3179
3180message PowerProfileProto {
3181 optional double cpu_suspend = 1;
3182
3183 optional double cpu_idle = 2;
3184
3185 optional double cpu_active = 3;
3186
3187 message CpuCluster {
3188 optional int32 id = 1;
3189 optional double cluster_power = 2;
3190 optional int32 cores = 3;
3191 repeated int64 speed = 4;
3192 repeated double core_power = 5;
3193 }
3194
3195 repeated CpuCluster cpu_cluster = 40;
3196
3197 optional double wifi_scan = 4;
3198
3199 optional double wifi_on = 5;
3200
3201 optional double wifi_active = 6;
3202
3203 optional double wifi_controller_idle = 7;
3204
3205 optional double wifi_controller_rx = 8;
3206
3207 optional double wifi_controller_tx = 9;
3208
3209 repeated double wifi_controller_tx_levels = 10;
3210
3211 optional double wifi_controller_operating_voltage = 11;
3212
3213 optional double bluetooth_controller_idle = 12;
3214
3215 optional double bluetooth_controller_rx = 13;
3216
3217 optional double bluetooth_controller_tx = 14;
3218
3219 optional double bluetooth_controller_operating_voltage = 15;
3220
3221 optional double modem_controller_sleep = 16;
3222
3223 optional double modem_controller_idle = 17;
3224
3225 optional double modem_controller_rx = 18;
3226
3227 repeated double modem_controller_tx = 19;
3228
3229 optional double modem_controller_operating_voltage = 20;
3230
3231 optional double gps_on = 21;
3232
3233 repeated double gps_signal_quality_based = 22;
3234
3235 optional double gps_operating_voltage = 23;
3236
3237 optional double bluetooth_on = 24;
3238
3239 optional double bluetooth_active = 25;
3240
3241 optional double bluetooth_at_cmd = 26;
3242
3243 optional double ambient_display = 27;
3244
3245 optional double screen_on = 28;
3246
3247 optional double radio_on = 29;
3248
3249 optional double radio_scanning = 30;
3250
3251 optional double radio_active = 31;
3252
3253 optional double screen_full = 32;
3254
3255 optional double audio = 33;
3256
3257 optional double video = 34;
3258
3259 optional double flashlight = 35;
3260
3261 optional double memory = 36;
3262
3263 optional double camera = 37;
3264
3265 optional double wifi_batched_scan = 38;
3266
3267 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003268}
Chenjie Yuab530202018-09-26 12:39:20 -07003269
3270/**
3271 * power_profile.xml and other constants for power model calculations.
3272 * Pulled from PowerProfile.java
3273 */
3274message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003275 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003276}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003277
3278/**
arangelovd5db50e2018-10-12 20:24:39 +01003279 * Logs when a user restriction was added or removed.
3280 *
3281 * Logged from:
3282 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3283 */
3284message UserRestrictionChanged {
3285 // The raw string of the user restriction as defined in UserManager.
3286 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3287 optional string restriction = 1;
3288 // Whether the restriction is enabled or disabled.
3289 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003290}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003291
3292/**
3293 * Pulls process user time and system time. Puller takes a snapshot of all pids
3294 * in the system and returns cpu stats for those that are working at the time.
3295 * Dead pids will be dropped. Kernel processes are excluded.
3296 * Min cool-down is 5 sec.
3297 */
3298message ProcessCpuTime {
3299 optional int32 uid = 1 [(is_uid) = true];
3300
3301 optional string process_name = 2;
3302 // Process cpu time in user space, cumulative from boot/process start
3303 optional int64 user_time_millis = 3;
3304 // Process cpu time in system space, cumulative from boot/process start
3305 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003306}
Misha Wagner5a51e002018-10-03 15:04:09 +01003307
3308/**
3309 * Pulls the CPU usage for each thread.
3310 *
3311 * Read from /proc/$PID/task/$TID/time_in_state files.
3312 *
3313 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3314 * time_in_state files not being present on some phones, have not been addressed. These should be
3315 * considered before a public release.
3316 */
3317message CpuTimePerThreadFreq {
3318 // UID that owns the process.
3319 optional int32 uid = 1 [(is_uid) = true];
3320 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003321 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003322 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003323 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003324 // Name of the process taken from `/proc/$PID/cmdline`.
3325 optional string process_name = 4;
3326 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3327 optional string thread_name = 5;
3328 // What frequency the CPU was running at, in KHz
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003329 optional int32 frequency_khz = 6;
Misha Wagner5a51e002018-10-03 15:04:09 +01003330 // Time spent in frequency in milliseconds, since thread start.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003331 optional int32 time_millis = 7;
Misha Wagner5a51e002018-10-03 15:04:09 +01003332}
Bookatz75ee6042018-11-09 12:27:37 -08003333
3334/**
Bookatz366a4432018-11-20 09:42:33 -08003335 * Pulls information about the device's build.
3336 */
3337message BuildInformation {
3338 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3339 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3340 optional string fingerprint = 1;
3341
3342 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3343 optional string brand = 2;
3344
3345 // Build.PRODUCT. The name of the overall product.
3346 optional string product = 3;
3347
3348 // Build.DEVICE. The name of the industrial design.
3349 optional string device = 4;
3350
3351 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3352 optional string version_release = 5;
3353
3354 // Build.ID. E.g. a label like "M4-rc20".
3355 optional string id = 6;
3356
3357 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3358 // represent this build.
3359 optional string version_incremental = 7;
3360
3361 // Build.TYPE. The type of build, like "user" or "eng".
3362 optional string type = 8;
3363
3364 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3365 optional string tags = 9;
3366}
3367
3368/**
Bookatz75ee6042018-11-09 12:27:37 -08003369 * Pulls on-device BatteryStats power use calculations for the overall device.
3370 */
3371message DeviceCalculatedPowerUse {
3372 // Power used by the device in mAh, as computed by BatteryStats, since BatteryStats last reset
3373 // (i.e. roughly since device was last significantly charged).
3374 // Currently, this is BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3375 optional float computed_power_milli_amp_hours = 1;
3376}
3377
3378/**
3379 * Pulls on-device BatteryStats power use calculations broken down by uid.
3380 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3381 * that is attributed to non-uid items. They must all be included to get the total power use.
3382 */
3383message DeviceCalculatedPowerBlameUid {
3384 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3385 optional int32 uid = 1 [(is_uid) = true];
3386
3387 // Power used by this uid in mAh, as computed by BatteryStats, since BatteryStats last reset
3388 // (i.e. roughly since device was last significantly charged).
3389 optional float power_milli_amp_hours = 2;
3390}
3391
3392/**
3393 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3394 * drain type.
3395 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3396 * is attributed uids. They must all be included to get the total power use.
3397 */
3398message DeviceCalculatedPowerBlameOther {
3399 // The type of item whose power use is being reported.
3400 enum DrainType {
3401 AMBIENT_DISPLAY = 0;
3402 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3403 BLUETOOTH = 2;
3404 CAMERA = 3;
3405 // Cell-standby
3406 CELL = 4;
3407 FLASHLIGHT = 5;
3408 IDLE = 6;
3409 MEMORY = 7;
3410 // Amount that total computed drain exceeded the drain estimated using the
3411 // battery level changes and capacity.
3412 OVERCOUNTED = 8;
3413 PHONE = 9;
3414 SCREEN = 10;
3415 // Amount that total computed drain was below the drain estimated using the
3416 // battery level changes and capacity.
3417 UNACCOUNTED = 11;
3418 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3419 WIFI = 13;
3420 }
3421 optional DrainType drain_type = 1;
3422
3423 // Power used by this item in mAh, as computed by BatteryStats, since BatteryStats last reset
3424 // (i.e. roughly since device was last significantly charged).
3425 optional float power_milli_amp_hours = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003426}