blob: 3c53c97caf09d4d5d27946b5cb35cd9eb3329d65 [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";
arangelov4e994062018-11-13 16:12:38 +000037import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
38import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080039
Yao Chend54f9dd2017-10-17 17:37:48 +000040/**
Stefan Lafonae2df012017-11-14 09:17:21 -080041 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000042 * raw stats log events from the Android system, also known as "atoms."
43 *
44 * This field contains a single oneof with all of the available messages.
45 * The stats-log-api-gen tool runs as part of the Android build and
46 * generates the android.util.StatsLog class, which contains the constants
47 * and methods that Android uses to log.
48 *
Stefan Lafonae2df012017-11-14 09:17:21 -080049 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000050 * Instead, statsd on Android constructs these messages synthetically,
51 * in the format defined here and in stats_log.proto.
52 */
Stefan Lafonae2df012017-11-14 09:17:21 -080053message Atom {
54 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070055 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070056 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
57 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070058 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070059 BleScanResultReceived ble_scan_result_received = 4;
60 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080061 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070062 SyncStateChanged sync_state_changed = 7;
63 ScheduledJobStateChanged scheduled_job_state_changed = 8;
64 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070065 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080066 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
67 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
68 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070069 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
70 MemoryFactorStateChanged memory_factor_state_changed = 15;
71 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
72 CachedKillReported cached_kill_reported = 17;
73 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070074 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080075 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
76 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
77 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070078 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080079 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070080 CameraStateChanged camera_state_changed = 25;
81 FlashlightStateChanged flashlight_state_changed = 26;
82 UidProcessStateChanged uid_process_state_changed = 27;
83 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
84 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070085 BatteryLevelChanged battery_level_changed = 30;
86 ChargingStateChanged charging_state_changed = 31;
87 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070088 InteractiveStateChanged interactive_state_changed = 33;
89 // 34 is available
Bookatz8c6571b2017-10-24 15:04:41 -070090 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
91 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070092 WifiLockStateChanged wifi_lock_state_changed = 37;
93 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
94 WifiScanStateChanged wifi_scan_state_changed = 39;
95 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070096 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070097 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070098 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090099 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700100 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800101 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800102 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800103 AppStartOccurred app_start_occurred = 48;
104 AppStartCanceled app_start_canceled = 49;
105 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800106 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800107 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800108 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800109 LmkStateChanged lmk_state_changed = 54;
110 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800111 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800112 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800113 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800114 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800115 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800116 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800117 KeyguardStateChanged keyguard_state_changed = 62;
118 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
119 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800120 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800121 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800122 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
123 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800124 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700125 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800126 SpeakerImpedanceReported speaker_impedance_reported = 71;
127 HardwareFailed hardware_failed = 72;
128 PhysicalDropDetected physical_drop_detected = 73;
129 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800130 MobileConnectionStateChanged mobile_connection_state_changed = 75;
131 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700132 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800133 AppCrashOccurred app_crash_occurred = 78;
134 ANROccurred anr_occurred = 79;
135 WTFOccurred wtf_occurred = 80;
136 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700137 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700138 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700139 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700140 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700141 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700142 FingerprintAcquired fingerprint_acquired = 87;
143 FingerprintAuthenticated fingerprint_authenticated = 88;
144 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700145 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700146 BatteryHealthSnapshot battery_health_snapshot = 91;
147 SlowIo slow_io = 92;
148 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700149 PhoneServiceStateChanged phone_service_state_changed = 94;
150 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100151 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700152 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700153 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700154 // TODO: service state change is very noisy shortly after boot, as well
155 // as at other transitions - coming out of doze, device plugged in, etc.
156 // Consider removing this if it becomes a problem
157 ServiceStateChanged service_state_changed = 99;
158 ServiceLaunchReported service_launch_reported = 100;
Yangster-macb89807e2018-11-15 21:10:57 -0800159 PhenotypeFlagStateChanged phenotype_flag_state_changed = 101;
160 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000161 DevicePolicyEvent device_policy_event = 103;
Yao Chend54f9dd2017-10-17 17:37:48 +0000162 }
David Chenc8a43242017-10-17 16:23:28 -0700163
David Chen6e3e6cb2018-01-03 16:14:06 -0800164 // Pulled events will start at field 10000.
Rafal Slawik3bea8952018-11-15 12:39:33 +0000165 // Next: 10043
David Chenc8a43242017-10-17 16:23:28 -0700166 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800167 WifiBytesTransfer wifi_bytes_transfer = 10000;
168 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
169 MobileBytesTransfer mobile_bytes_transfer = 10002;
170 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800171 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800172 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800173 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800174 CpuTimePerFreq cpu_time_per_freq = 10008;
175 CpuTimePerUid cpu_time_per_uid = 10009;
176 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800177 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800178 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800179 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800180 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800181 SystemElapsedRealtime system_elapsed_realtime = 10014;
182 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800183 CpuActiveTime cpu_active_time = 10016;
184 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000185 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800186 RemainingBatteryCapacity remaining_battery_capacity = 10019;
187 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800188 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100189 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100190 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100191 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000192 DiskStats disk_stats = 10025;
193 DirectoryUsage directory_usage = 10026;
194 AppSize app_size = 10027;
195 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700196 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700197 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700198 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700199 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700200 PowerProfile power_profile = 10033;
Chenjie Yub52779e2018-10-05 12:03:36 -0700201 ProcStats proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700202 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100203 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100204 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700205 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800206 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
207 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
208 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000209 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800210 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800211 BuildInformation build_information = 10044;
David Chenc8a43242017-10-17 16:23:28 -0700212 }
yroa1fe77c2018-02-26 14:22:54 -0800213
Bookatz76aafcf2018-09-17 16:17:10 -0700214 // DO NOT USE field numbers above 100,000 in AOSP.
215 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
216 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700217}
218
Yao Chend54f9dd2017-10-17 17:37:48 +0000219/**
Yangster-mac20877162017-12-22 17:19:39 -0800220 * This proto represents a node of an attribution chain.
221 * Note: All attribution chains are represented as a repeated field of type
222 * AttributionNode. It is understood that in such arrays, the order is that
223 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000224 */
Yangster-mac20877162017-12-22 17:19:39 -0800225message AttributionNode {
226 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800227 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800228
Yangster-mac20877162017-12-22 17:19:39 -0800229 // The (optional) string tag for an element in the attribution chain. If the
230 // element has no tag, it is encoded as an empty string.
231 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700232}
233
Yangster-mac48b3d622018-08-18 12:38:11 -0700234message KeyValuePair {
235 optional int32 key = 1;
236 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700237 int32 value_int = 2;
238 int64 value_long = 3;
239 string value_str = 4;
240 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700241 }
242}
243
244message KeyValuePairsAtom {
245 optional int32 uid = 1;
246 repeated KeyValuePair pairs = 2;
247}
248
Yao Chend54f9dd2017-10-17 17:37:48 +0000249/*
250 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800251 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000252 *
253 * RULES:
254 * - The field ids for each atom must start at 1, and count upwards by 1.
255 * Skipping field ids is not allowed.
256 * - These form an API, so renaming, renumbering or removing fields is
257 * not allowed between android releases. (This is not currently enforced,
258 * but there will be a tool to enforce this restriction).
259 * - The types must be built-in protocol buffer types, namely, no sub-messages
260 * are allowed (yet). The bytes type is also not allowed.
261 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800262 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000263 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800264 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000265 * - A field that is a uid should be a string field, tagged with the [xxx]
266 * annotation. The generated code on android will be represented by UIDs,
267 * and those UIDs will be translated in xxx to those strings.
268 *
269 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700270 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000271 * - If there is a UID, it goes first. Think in an object-oriented fashion.
272 * *****************************************************************************
273 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700274
Yao Chend54f9dd2017-10-17 17:37:48 +0000275/**
Yangster-mace16189a2018-08-26 12:20:16 -0700276 * Logs when the Thermal service HAL notifies the throttling start/stop events.
277 *
278 * Logged from:
279 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
280 */
281message ThermalThrottlingStateChanged {
282 optional android.os.TemperatureTypeEnum sensor_type = 1;
283
284 enum State {
285 UNKNOWN = 0;
286 START = 1;
287 STOP = 2;
288 }
289
290 optional State state = 2;
291
292 optional float temperature = 3;
293}
294
295/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000296 * Logs when the screen state changes.
297 *
298 * Logged from:
299 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
300 */
301message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800302 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700303 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700304}
Yao Chend54f9dd2017-10-17 17:37:48 +0000305
306/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700307 * Logs that the process state of the uid, as determined by ActivityManager
308 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000309 *
310 * Logged from:
311 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
312 */
Bookatzc1a050a2017-10-10 15:49:28 -0700313message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700314 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000315
Bookatzdb026a22018-01-10 19:01:56 -0800316 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700317 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000318}
319
320/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700321 * Logs process state change of a process, as per the activity manager.
322 *
323 * Logged from:
324 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
325 */
326message ProcessStateChanged {
327 optional int32 uid = 1;
328 optional string process_name = 2;
329 optional string package_name = 3;
330 // TODO: remove this when validation is done
331 optional int64 version = 5;
332 // The state, from frameworks/base/core/proto/android/app/enums.proto.
333 optional android.app.ProcessStateEnum state = 4;
334}
335
336/**
337 * Logs when ActivityManagerService sleep state is changed.
338 *
339 * Logged from:
340 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
341 */
342message ActivityManagerSleepStateChanged {
343 // TODO: import frameworks proto
344 enum State {
345 UNKNOWN = 0;
346 ASLEEP = 1;
347 AWAKE = 2;
348 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700349 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700350}
351
352/**
353 * Logs when system memory state changes.
354 *
355 * Logged from:
356 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
357 */
358message MemoryFactorStateChanged {
359 // TODO: import frameworks proto
360 enum State {
361 MEMORY_UNKNOWN = 0;
362 NORMAL = 1; // normal.
363 MODERATE = 2; // moderate memory pressure.
364 LOW = 3; // low memory.
365 CRITICAL = 4; // critical memory.
366
367 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700368 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700369}
370
371/**
372 * Logs when app is using too much cpu, according to ActivityManagerService.
373 *
374 * Logged from:
375 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
376 */
377message ExcessiveCpuUsageReported {
378 optional int32 uid = 1;
379 optional string process_name = 2;
380 optional string package_name = 3;
381 // package version. TODO: remove this when validation is done
382 optional int64 version = 4;
383}
384
385/**
386 * Logs when a cached process is killed, along with its pss.
387 *
388 * Logged from:
389 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
390 */
391message CachedKillReported {
392 optional int32 uid = 1;
393 optional string process_name = 2;
394 optional string package_name = 3;
395 // TODO: remove this when validation is done
396 optional int64 version = 5;
397 optional int64 pss = 4;
398}
399
400/**
401 * Logs when memory stats of a process is reported.
402 *
403 * Logged from:
404 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
405 */
406message ProcessMemoryStatReported {
407 optional int32 uid = 1;
408 optional string process_name = 2;
409 optional string package_name = 3;
410 //TODO: remove this when validation is done
411 optional int64 version = 9;
412 optional int64 pss = 4;
413 optional int64 uss = 5;
414 optional int64 rss = 6;
415 enum Type {
416 ADD_PSS_INTERNAL_SINGLE = 0;
417 ADD_PSS_INTERNAL_ALL_MEM = 1;
418 ADD_PSS_INTERNAL_ALL_POLL = 2;
419 ADD_PSS_EXTERNAL = 3;
420 ADD_PSS_EXTERNAL_SLOW = 4;
421 }
422 optional Type type = 7;
423 optional int64 duration = 8;
424}
425
426/**
Bookatzc1a050a2017-10-10 15:49:28 -0700427 * Logs that a process started, finished, crashed, or ANRed.
428 *
429 * Logged from:
430 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
431 */
432message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700433 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700434
David Chen0b5c90c2018-01-25 16:51:49 -0800435 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800436 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700437
Bookatzddccf0a2017-11-28 16:48:14 -0800438 // What lifecycle state the process changed to.
439 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800440 enum State {
441 FINISHED = 0;
442 STARTED = 1;
443 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800444 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800445 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700446}
447
Bookatzc1a050a2017-10-10 15:49:28 -0700448/**
449 * Logs when the ble scan state changes.
450 *
451 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700452 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700453 */
454message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800455 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700456
457 enum State {
458 OFF = 0;
459 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700460 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
461 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700462 }
463 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700464
Bookatze5ec0b42018-03-26 13:34:56 -0700465 // Does the scan have a filter.
466 optional bool is_filtered = 3;
467 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
468 optional bool is_first_match = 4;
469 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
470 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700471}
472
473/**
474 * Logs reporting of a ble scan finding results.
475 *
476 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700477 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700478 */
Bookatzae6738e2018-09-13 11:38:56 -0700479// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700480message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800481 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700482
483 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800484 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700485}
486
487/**
488 * Logs when a sensor state changes.
489 *
490 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700491 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700492 */
493message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800494 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700495
Bookatzc1a050a2017-10-10 15:49:28 -0700496 // The id (int) of the sensor.
497 optional int32 sensor_id = 2;
498
499 enum State {
500 OFF = 0;
501 ON = 1;
502 }
503 optional State state = 3;
504}
505
Bookatzc1a050a2017-10-10 15:49:28 -0700506/**
507 * Logs when GPS state changes.
508 *
509 * Logged from:
510 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
511 */
512message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800513 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700514
515 enum State {
516 OFF = 0;
517 ON = 1;
518 }
519 optional State state = 2;
520}
521
Bookatz48d362e2018-11-06 15:49:08 -0800522/**
523 * Logs when GPS signal quality.
524 *
525 * Logged from:
526 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
527 */
528message GpsSignalQualityChanged {
529 optional android.server.location.GpsSignalQualityEnum level = 1;
530}
531
Bookatzc1a050a2017-10-10 15:49:28 -0700532
533/**
534 * Logs when a sync manager sync state changes.
535 *
536 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700537 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700538 */
539message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800540 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700541
David Chen0b5c90c2018-01-25 16:51:49 -0800542 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800543 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700544
545 enum State {
546 OFF = 0;
547 ON = 1;
548 }
549 optional State state = 3;
550}
551
Yangster-mac96353002018-09-05 11:18:55 -0700552/*
553 * Deferred job stats.
554 *
555 * Logged from:
556 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
557*/
558message DeferredJobStatsReported {
559 repeated AttributionNode attribution_node = 1;
560
561 // Number of jobs deferred.
562 optional int32 num_jobs_deferred = 2;
563
564 // Time since the last job runs.
565 optional int64 time_since_last_job_millis = 3;
566}
567
Bookatzc1a050a2017-10-10 15:49:28 -0700568/**
569 * Logs when a job scheduler job state changes.
570 *
571 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700572 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700573 */
574message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800575 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700576
577 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800578 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700579
580 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800581 FINISHED = 0;
582 STARTED = 1;
583 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700584 }
585 optional State state = 3;
586
Tej Singh33a412b2018-03-16 18:43:59 -0700587 // The reason a job has stopped.
588 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700589 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700590 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700591}
592
593/**
594 * Logs when the audio state changes.
595 *
596 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700597 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700598 */
599message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800600 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700601
602 enum State {
603 OFF = 0;
604 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700605 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
606 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700607 }
608 optional State state = 2;
609}
610
611/**
612 * Logs when the video codec state changes.
613 *
614 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700615 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700616 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800617message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800618 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700619
620 enum State {
621 OFF = 0;
622 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700623 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
624 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700625 }
626 optional State state = 2;
627}
628
629/**
630 * Logs when the flashlight state changes.
631 *
632 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700633 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700634 */
635message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800636 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700637
638 enum State {
639 OFF = 0;
640 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700641 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
642 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700643 }
644 optional State state = 2;
645}
646
647/**
648 * Logs when the camera state changes.
649 *
650 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700651 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700652 */
653message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800654 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700655
656 enum State {
657 OFF = 0;
658 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700659 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
660 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700661 }
662 optional State state = 2;
663}
664
665/**
666 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000667 *
668 * Logged from:
669 * TODO
670 */
Bookatzd6746242017-10-24 18:39:35 -0700671message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800672 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000673
Bookatz1a1b0462018-01-12 11:47:03 -0800674 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
675 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700676 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700677
678 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
679 optional string tag = 3;
680
681 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800682 RELEASE = 0;
683 ACQUIRE = 1;
684 CHANGE_RELEASE = 2;
685 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700686 }
687 optional State state = 4;
688}
689
690/**
Bookatzc1a050a2017-10-10 15:49:28 -0700691 * Logs when a partial wakelock is considered 'long' (over 1 min).
692 *
693 * Logged from:
694 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
695 */
696message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800697 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700698
Yao Chend54f9dd2017-10-17 17:37:48 +0000699 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
700 optional string tag = 2;
701
Bookatzc1a050a2017-10-10 15:49:28 -0700702 // TODO: I have no idea what this is.
703 optional string history_tag = 3;
704
705 enum State {
706 OFF = 0;
707 ON = 1;
708 }
709 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000710}
711
Bookatzc1a050a2017-10-10 15:49:28 -0700712/**
Bookatza66083f2018-09-20 17:24:00 -0700713 * Logs when the device is interactive, according to the PowerManager Notifier.
714 *
715 * Logged from:
716 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
717 */
718message InteractiveStateChanged {
719 enum State {
720 OFF = 0;
721 ON = 1;
722 }
723 optional State state = 1;
724}
725
726/**
Bookatzc1a050a2017-10-10 15:49:28 -0700727 * Logs Battery Saver state change.
728 *
729 * Logged from:
730 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
731 */
732message BatterySaverModeStateChanged {
733 enum State {
734 OFF = 0;
735 ON = 1;
736 }
737 optional State state = 1;
738}
739
740/**
741 * Logs Doze mode state change.
742 *
743 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800744 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700745 */
746message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800747 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800748}
749
750
751/**
752 * Logs state change of Doze mode including maintenance windows.
753 *
754 * Logged from:
755 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
756 */
757message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800758 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700759}
760
761/**
762 * Logs screen brightness level.
763 *
764 * Logged from:
765 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
766 */
767message ScreenBrightnessChanged {
768 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
769 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700770}
771
772/**
773 * Logs battery level (percent full, from 0 to 100).
774 *
775 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700776 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700777 */
778message BatteryLevelChanged {
779 // Battery level. Should be in [0, 100].
780 optional int32 battery_level = 1;
781}
782
783/**
784 * Logs change in charging status of the device.
785 *
786 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700787 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700788 */
789message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800790 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
791 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700792}
793
794/**
795 * Logs whether the device is plugged in, and what power source it is using.
796 *
797 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700798 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700799 */
800message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800801 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
802 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700803}
804
Bookatz8c6571b2017-10-24 15:04:41 -0700805/**
806 * Logs when an app's wakeup alarm fires.
807 *
808 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700809 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700810 */
811message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800812 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800813
814 // Name of the wakeup alarm.
815 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700816
817 // Name of source package (for historical reasons, since BatteryStats tracked it).
818 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800819}
820
821/**
822 * Logs when an an app causes the mobile radio to change state.
823 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
824 *
825 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700826 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800827 */
828message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800829 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800830
Bookatz1a1b0462018-01-12 11:47:03 -0800831 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
832 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800833}
834
835/**
836 * Logs when an an app causes the wifi radio to change state.
837 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
838 *
839 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700840 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800841 */
842message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800843 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800844
Bookatz1a1b0462018-01-12 11:47:03 -0800845 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
846 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700847}
848
849/**
850 * Logs kernel wakeup reasons and aborts.
851 *
852 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700853 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700854 */
855message KernelWakeupReported {
856 // Name of the kernel wakeup reason (or abort).
857 optional string wakeup_reason_name = 1;
858
859 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800860 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700861}
862
863/**
864 * Logs wifi locks held by an app.
865 *
866 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700867 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700868 */
869message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800870 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700871
872 enum State {
873 OFF = 0;
874 ON = 1;
875 }
876 optional State state = 2;
877}
878
879/**
880 * Logs wifi signal strength changes.
881 *
882 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700883 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700884 */
885message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800886 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
887 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700888}
889
890/**
891 * Logs wifi scans performed by an app.
892 *
893 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700894 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700895 */
896message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800897 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700898
899 enum State {
900 OFF = 0;
901 ON = 1;
902 }
903 optional State state = 2;
904}
905
906/**
Tej Singh4503e102018-01-04 14:35:01 -0800907 * Logs wifi multicast locks held by an app
908 *
909 * Logged from:
910 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
911 */
912message WifiMulticastLockStateChanged {
913 repeated AttributionNode attribution_node = 1;
914
915 enum State {
916 OFF = 0;
917 ON = 1;
918 }
919 optional State state = 2;
920}
921
922/**
Tej Singh1ea42892018-01-19 09:27:00 -0800923 * Logs shutdown reason and duration on next boot.
924 *
925 * Logged from:
926 * frameworks/base/core/java/com/android/server/BootReceiver.java
927 */
928message ShutdownSequenceReported {
929 // True if shutdown is for a reboot. Default: false if we do not know.
930 optional bool reboot = 1;
931
932 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
933 optional string reason = 2;
934
935 // Beginning of shutdown time in ms using wall clock time since unix epoch.
936 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800937 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800938
939 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800940 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800941}
942
Tej Singh6483ea42018-01-25 17:45:49 -0800943
944/**
945 * Logs boot reason and duration.
946 *
947 * Logged from:
948 * system/core/bootstat/bootstat.cpp
949 */
950message BootSequenceReported {
951 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
952 // Default: "<EMPTY>" if not available.
953 optional string bootloader_reason = 1;
954
955 // Reason for system boot. Eg. bootloader, reboot,userrequested
956 // Default: "<EMPTY>" if not available.
957 optional string system_reason = 2;
958
959 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800960 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800961
962 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800963 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800964
965 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800966 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800967
968 // Time since last boot in ms. Default: 0 if not available.
969 optional int64 time_since_last_boot = 6;
970}
971
Tej Singhc477d9c2018-02-05 18:31:39 -0800972
973/**
974 * Logs call state and disconnect cause (if applicable).
975 *
976 * Logged from:
977 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
978 */
979message CallStateChanged {
980 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
981 // From frameworks/base/core/proto/android/telecomm/enums.proto.
982 optional android.telecom.CallStateEnum call_state = 1;
983
984 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
985 // This value is only applicable when the call_state is DISCONNECTED, and
986 // should always be UNKNOWN if the call_state is not DISCONNECTED.
987 // From frameworks/base/core/proto/android/telecomm/enums.proto.
988 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
989
990 // True if the call is self-managed, which are apps that use the
991 // telecom infrastructure to make their own calls.
992 optional bool self_managed = 3;
993
994 // True if call is external. External calls are calls on connected Wear
995 // devices but show up in Telecom so the user can pull them onto the device.
996 optional bool external_call = 4;
997}
998
Tej Singh1ea42892018-01-19 09:27:00 -0800999/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001000 * Logs keyguard state. The keyguard is the lock screen.
1001 *
1002 * Logged from:
1003 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1004 */
1005message KeyguardStateChanged {
1006 enum State {
1007 UNKNOWN = 0;
1008 // The keyguard is hidden when the phone is unlocked.
1009 HIDDEN = 1;
1010 // The keyguard is shown when the phone is locked (screen turns off).
1011 SHOWN= 2;
1012 // The keyguard is occluded when something is overlaying the keyguard.
1013 // Eg. Opening the camera while on the lock screen.
1014 OCCLUDED = 3;
1015 }
1016 optional State state = 1;
1017}
1018
1019/**
1020 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1021 * prompts the user to enter a password (pattern, pin, etc).
1022 *
1023 * Logged from:
1024 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1025 */
1026
1027message KeyguardBouncerStateChanged {
1028 enum State {
1029 UNKNOWN = 0;
1030 // Bouncer is hidden, either as a result of successfully entering the
1031 // password, screen timing out, or user going back to lock screen.
1032 HIDDEN = 1;
1033 // This is when the user is being prompted to enter the password.
1034 SHOWN = 2;
1035 }
1036 optional State state = 1;
1037}
1038
1039/**
1040 * Logs the result of entering a password into the keyguard bouncer.
1041 *
1042 * Logged from:
1043 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1044 */
1045message KeyguardBouncerPasswordEntered {
1046 enum BouncerResult {
1047 UNKNOWN = 0;
1048 // The password entered was incorrect.
1049 FAILURE = 1;
1050 // The password entered was correct.
1051 SUCCESS = 2;
1052 }
1053 optional BouncerResult result = 1;
1054}
1055
Tej Singha883b372018-02-15 11:30:01 -08001056/*
1057 * Logs changes to the configuration of the device. The configuration is defined
1058 * in frameworks/base/core/java/android/content/res/Configuration.java
1059 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1060 * Please go there to interpret the possible values each field can be.
1061 *
1062 * Logged from:
1063 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1064 */
1065message ResourceConfigurationChanged {
1066 // Bit mask of color capabilities of the screen.
1067 // Contains information about the color gamut and hdr mode of the screen.
1068 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001069 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001070
1071 // The target screen density being rendered to.
1072 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001073 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001074
1075 // Current user preference for the scaling factor for fonts,
1076 // relative to the base density scaling.
1077 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001078 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001079
1080 // Flag indicating whether the hard keyboard is hidden.
1081 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001082 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001083
1084 // The type of keyboard attached to the device.
1085 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1086 optional int32 keyboard = 5;
1087
1088 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1089 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001090 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001091
1092 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1093 // 0 if undefined.
1094 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1095 optional int32 mcc = 7;
1096
1097 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1098 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1099 // MNC_ZERO symbol defined in Configuration.java.
1100 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1101 optional int32 mnc = 8;
1102
1103 // The kind of navigation available on the device.
1104 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1105 optional int32 navigation = 9;
1106
1107 // Flag indicating whether the navigation is available.
1108 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001109 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001110
1111 // Overall orientation of the screen.
1112 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1113 optional int32 orientation = 11;
1114
1115 // The current height of the available screen space, in dp units.
1116 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001117 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001118
1119 // Bit mask of overall layout of the screen.
1120 // Contains information about screen size, whether the screen is wider/taller
1121 // than normal, whether the screen layout is right-tl-left or left-to-right,
1122 // and whether the screen has a rounded shape.
1123 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001124 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001125
1126 // Current width of the available screen space, in dp units.
1127 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001128 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001129
1130 // The smallest screen size an application will see in normal operation.
1131 // This is the smallest value of both screenWidthDp and screenHeightDp
1132 // in portrait and landscape.
1133 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001134 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001135
1136 // The type of touch screen attached to the device.
1137 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1138 optional int32 touchscreen = 16;
1139
1140 // Bit mask of the ui mode.
1141 // Contains information about the overall ui mode of the device.
1142 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1143 // Also contains information about whether the device is in night mode.
1144 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001145 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001146}
1147
Tej Singheee317b2018-03-07 19:28:05 -08001148
1149/**
1150 * Logs changes in the connection state of the mobile radio.
1151 *
1152 * Logged from:
1153 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1154 */
1155message MobileConnectionStateChanged {
1156 // States are from the state machine DataConnection.java.
1157 enum State {
1158 UNKNOWN = 0;
1159 // The connection is inactive, or disconnected.
1160 INACTIVE = 1;
1161 // The connection is being activated, or connecting.
1162 ACTIVATING = 2;
1163 // The connection is active, or connected.
1164 ACTIVE = 3;
1165 // The connection is disconnecting.
1166 DISCONNECTING = 4;
1167 // The connection is disconnecting after creating a connection.
1168 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1169 }
1170 optional State state = 1;
1171 // For multi-sim phones, this distinguishes between the sim cards.
1172 optional int32 sim_slot_index = 2;
1173 // Used to identify the connection. Starts at 0 and increments by 1 for
1174 // every new network created. Resets whenever the device reboots.
1175 optional int32 data_connection_id = 3;
1176 // A bitmask for the capabilities of this connection.
1177 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1178 // Default value (if we have no information): 0
1179 optional int64 capabilities = 4;
1180 // If this connection has internet.
1181 // This just checks if the DEFAULT bit of capabilities is set.
1182 optional bool has_internet = 5;
1183}
1184
1185/**
1186 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1187 *
1188 * Logged from:
1189 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1190 */
1191message MobileRadioTechnologyChanged {
1192 optional android.telephony.NetworkTypeEnum state = 1;
1193 // For multi-sim phones, this distinguishes between the sim cards.
1194 optional int32 sim_slot_index = 2;
1195}
1196
Andrew Chantb56388b2018-03-22 21:07:33 -07001197/**
1198 * Logs the VID and PID of any connected USB devices.
1199 *
1200 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1201 *
1202 * Logged by Vendor.
1203 */
1204message UsbDeviceAttached {
1205 optional int32 vid = 1;
1206 optional int32 pid = 2;
1207 optional bool has_audio = 3;
1208 optional bool has_hid = 4;
1209 optional bool has_storage = 5;
1210}
1211
Tej Singheee317b2018-03-07 19:28:05 -08001212
Tej Singhdd7bd352018-02-09 19:33:15 -08001213/**
Tej Singh5d991e12018-03-09 19:48:11 -08001214 * Logs when Bluetooth is enabled and disabled.
1215 *
1216 * Logged from:
1217 * services/core/java/com/android/server/BluetoothManagerService.java
1218 */
1219message BluetoothEnabledStateChanged {
1220 repeated AttributionNode attribution_node = 1;
1221 // Whether or not bluetooth is enabled on the device.
1222 enum State {
1223 UNKNOWN = 0;
1224 ENABLED = 1;
1225 DISABLED = 2;
1226 }
1227 optional State state = 2;
1228 // The reason for being enabled/disabled.
1229 // Eg. Airplane mode, crash, application request.
1230 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1231 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001232 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001233}
1234
1235/**
1236 * Logs when a Bluetooth device connects and disconnects.
1237 *
1238 * Logged from:
1239 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1240 */
1241message BluetoothConnectionStateChanged {
1242 // The state of the connection.
1243 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1244 optional android.bluetooth.ConnectionStateEnum state = 1;
1245 // An identifier that can be used to match connect and disconnect events.
1246 // Currently is last two bytes of a hash of a device level ID and
1247 // the mac address of the bluetooth device that is connected.
1248 optional int32 obfuscated_id = 2;
1249 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1250 // From android.bluetooth.BluetoothAdapter.java
1251 optional int32 bt_profile = 3;
1252}
1253
1254/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001255 * Logs when something is plugged into or removed from the USB-C connector.
1256 *
1257 * Logged from:
1258 * Vendor USB HAL.
1259 */
1260message UsbConnectorStateChanged {
1261 enum State {
1262 DISCONNECTED = 0;
1263 CONNECTED = 1;
1264 }
1265 optional State state = 1;
1266}
1267
1268/**
1269 * Logs the reported speaker impedance.
1270 *
1271 * Logged from:
1272 * Vendor audio implementation.
1273 */
1274message SpeakerImpedanceReported {
1275 optional int32 speaker_location = 1;
1276 optional int32 impedance = 2;
1277}
1278
1279/**
1280 * Logs the report of a failed hardware.
1281 *
1282 * Logged from:
1283 * Vendor HALs.
1284 *
1285 */
1286message HardwareFailed {
1287 enum HardwareType {
1288 HARDWARE_FAILED_UNKNOWN = 0;
1289 HARDWARE_FAILED_MICROPHONE = 1;
1290 HARDWARE_FAILED_CODEC = 2;
1291 HARDWARE_FAILED_SPEAKER = 3;
1292 HARDWARE_FAILED_FINGERPRINT = 4;
1293 }
1294 optional HardwareType hardware_type = 1;
1295
1296 /* hardware_location allows vendors to differentiate between multiple instances of
1297 * the same hardware_type. The specific locations are vendor defined integers,
1298 * referring to board-specific numbering schemes.
1299 */
1300 optional int32 hardware_location = 2;
1301
1302 /* failure_code is specific to the HardwareType of the failed hardware.
1303 * It should use the enum values defined below.
1304 */
1305 enum MicrophoneFailureCode {
1306 MICROPHONE_FAILURE_COMPLETE = 0;
1307 }
1308 enum CodecFailureCode {
1309 CODEC_FAILURE_COMPLETE = 0;
1310 }
1311 enum SpeakerFailureCode {
1312 SPEAKER_FAILURE_COMPLETE = 0;
1313 SPEAKER_FAILURE_HIGH_Z = 1;
1314 SPEAKER_FAILURE_SHORT = 2;
1315 }
1316 enum FingerprintFailureCode {
1317 FINGERPRINT_FAILURE_COMPLETE = 0;
1318 FINGERPRINT_SENSOR_BROKEN = 1;
1319 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1320 }
1321 optional int32 failure_code = 3;
1322}
1323
1324/**
1325 * Log an event when the device has been physically dropped.
1326 * Reported from the /vendor partition.
1327 */
1328message PhysicalDropDetected {
1329 // Confidence that the event was actually a drop, 0 -> 100
1330 optional int32 confidence_pctg = 1;
1331 // Peak acceleration of the drop, in 1/1000s of a g.
1332 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001333 // Duration of freefall in ms
1334 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001335}
1336
1337/**
1338 * Log bucketed battery charge cycles.
1339 *
1340 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001341 * a given charge point. For example, if 10 cycle buckets are
1342 * initialized, bucket 1 is the lowest 1/10th of the battery,
1343 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001344 *
1345 * Logged from:
1346 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1347 */
1348message ChargeCyclesReported {
1349 optional int32 cycle_bucket_1 = 1;
1350 optional int32 cycle_bucket_2 = 2;
1351 optional int32 cycle_bucket_3 = 3;
1352 optional int32 cycle_bucket_4 = 4;
1353 optional int32 cycle_bucket_5 = 5;
1354 optional int32 cycle_bucket_6 = 6;
1355 optional int32 cycle_bucket_7 = 7;
1356 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001357 optional int32 cycle_bucket_9 = 9;
1358 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001359}
1360
1361/**
Howard Roa46b6582018-09-18 16:45:02 -07001362 * Log battery health snapshot.
1363 *
1364 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1365 * are snapshotted periodically over 24hrs.
1366 */
1367message BatteryHealthSnapshot {
1368 enum BatterySnapshotType {
1369 UNKNOWN = 0;
1370 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1371 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1372 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1373 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1374 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1375 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1376 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1377 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1378 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1379 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1380 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1381 }
1382 optional BatterySnapshotType type = 1;
1383 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001384 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001385 // Voltage Battery Voltage, in microVolts.
1386 optional int32 voltage_micro_volt = 3;
1387 // Current Battery current, in microAmps.
1388 optional int32 current_micro_amps = 4;
1389 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1390 optional int32 open_circuit_micro_volt = 5;
1391 // Resistance Battery Resistance, in microOhms.
1392 optional int32 resistance_micro_ohm = 6;
1393 // Level Battery Level, as % of full.
1394 optional int32 level_percent = 7;
1395}
1396
1397/**
1398 * Log slow I/O operations on the primary storage.
1399 */
1400message SlowIo {
1401 // Classifications of IO Operations.
1402 enum IoOperation {
1403 UNKNOWN = 0;
1404 READ = 1;
1405 WRITE = 2;
1406 UNMAP = 3;
1407 SYNC = 4;
1408 }
1409 optional IoOperation operation = 1;
1410
1411 // The number of slow IO operations of this type over 24 hours.
1412 optional int32 count = 2;
1413}
1414
1415/**
1416 * Log battery caused shutdown with the last recorded voltage.
1417 */
1418message BatteryCausedShutdown {
1419 // The last recorded battery voltage prior to shutdown.
1420 optional int32 last_recorded_micro_volt = 1;
1421}
1422
1423/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001424 * Logs the duration of a davey (jank of >=700ms) when it occurs
1425 *
1426 * Logged from:
1427 * frameworks/base/libs/hwui/JankTracker.cpp
1428 */
1429message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001430 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001431 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001432
Tej Singhbb8554a2018-01-26 11:59:14 -08001433 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001434 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001435}
1436
1437/**
Bookatze5885242017-10-24 20:10:31 -07001438 * Logs phone signal strength changes.
1439 *
1440 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001441 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001442 */
1443message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001444 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1445 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001446}
1447
Yangster4ccebea2018-10-09 17:09:02 -07001448
1449/**
1450 * Logs when the phone state, sim state or signal strength changes
1451 *
1452 * Logged from:
1453 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1454 */
1455message PhoneServiceStateChanged {
1456 optional android.telephony.ServiceStateEnum state = 1;
1457 optional android.telephony.SimStateEnum sim_state = 2;
1458 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1459}
1460
1461/**
1462 * Logs when the phone becomes on or off.
1463 *
1464 * Logged from:
1465 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1466 */
1467message PhoneStateChanged {
1468 enum State {
1469 OFF = 0;
1470 ON = 1;
1471 }
1472 optional State state = 1;
1473}
1474
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001475message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001476 optional android.stats.launcher.LauncherAction action = 1;
1477 optional android.stats.launcher.LauncherState src_state = 2;
1478 optional android.stats.launcher.LauncherState dst_state = 3;
1479 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001480 optional bool is_swipe_up_enabled = 5;
1481}
1482
David Chenc28b2bb2017-10-24 12:52:52 -07001483/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001484 * Logs when Settings UI has changed.
1485 *
1486 * Logged from:
1487 * packages/apps/Settings
1488 */
1489message SettingsUIChanged {
1490 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001491 * Where this SettingsUIChange event comes from. For example, if
1492 * it's a PAGE_VISIBLE event, where the page is opened from.
1493 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001494 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001495
1496 /**
1497 * What the UI action is.
1498 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001499 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001500
1501 /**
1502 * Where the action is happening
1503 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001504 optional android.app.settings.PageId pageId = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001505
1506 /**
1507 * What preference changed in this event.
1508 */
1509 optional string changedPreferenceKey = 4;
1510
1511 /**
1512 * The new value of the changed preference.
1513 */
1514 optional int64 changedPreferenceIntValue = 5;
1515}
1516
1517/**
David Chenc28b2bb2017-10-24 12:52:52 -07001518 * Logs that a setting was updated.
1519 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001520 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001521 * The tag and is_default allow resetting of settings to default values based on the specified
1522 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1523 */
1524message SettingChanged {
1525 // The name of the setting.
1526 optional string setting = 1;
1527
1528 // The change being imposed on this setting. May represent a number, eg "3".
1529 optional string value = 2;
1530
1531 // The new value of this setting. For most settings, this is same as value. For some settings,
1532 // value is +X or -X where X represents an element in a set. For example, if the previous value
1533 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1534 // The +/- feature is currently only used for location_providers_allowed.
1535 optional string new_value = 3;
1536
1537 // The previous value of this setting.
1538 optional string prev_value = 4;
1539
1540 // The tag used with the is_default for resetting sets of settings. This is generally null.
1541 optional string tag = 5;
1542
Bookatz90867622018-01-31 15:05:57 -08001543 // True if this setting with tag should be resettable.
1544 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001545
David Chenbd789912018-03-16 17:19:55 -07001546 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001547 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001548
1549 enum ChangeReason {
1550 UPDATED = 1; // Updated can be an insertion or an update.
1551 DELETED = 2;
1552 }
1553 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001554}
Chenjie Yub3dda412017-10-24 13:41:59 -07001555
Chenjie Yu05013b32017-11-21 10:21:41 -08001556/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001557 * Logs activity going to foreground or background
1558 *
1559 * Logged from:
1560 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1561 */
1562message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001563 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001564 optional string pkg_name = 2;
1565 optional string class_name = 3;
1566
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001567 enum State {
1568 BACKGROUND = 0;
1569 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001570 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001571 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001572}
David Chenc8a43242017-10-17 16:23:28 -07001573
1574/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001575 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001576 * Logged from:
1577 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1578 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001579message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001580 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001581
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001582 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001583
1584 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001585 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001586 optional string process_name = 3;
1587
1588 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001589 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001590
1591 optional string package_name = 5;
1592
1593 enum InstantApp {
1594 UNAVAILABLE = 0;
1595 FALSE = 1;
1596 TRUE = 2;
1597 }
1598 optional InstantApp is_instant_app = 6;
1599
1600 enum ForegroundState {
1601 UNKNOWN = 0;
1602 BACKGROUND = 1;
1603 FOREGROUND = 2;
1604 }
1605 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001606
1607 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001608}
David Chen9e3808c2017-11-20 17:25:34 -08001609
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001610/**
1611 * Logs when a WTF (What a Terrible Failure) happened.
1612 * Logged from:
1613 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1614 */
1615message WTFOccurred {
1616 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001617
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001618 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001619
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001620 // The name of the process.
1621 // system_server if it is not by an app
1622 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001623
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001624 // The pid if available. -1 means not available.
1625 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001626
1627 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001628}
1629
1630/**
1631 * Logs when system server reports low memory.
1632 * Logged from:
1633 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1634 */
1635message LowMemReported {
1636}
1637
1638/**
1639 * Logs when an app ANR (App Not Responding) occurs.
1640 * Logged from:
1641 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1642 */
1643message ANROccurred {
1644 optional int32 uid = 1 [(is_uid) = true];
1645
1646 optional string process_name = 2;
1647
1648 optional string short_component_name = 3;
1649
1650 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001651
1652 enum InstantApp {
1653 UNAVAILABLE = 0;
1654 FALSE = 1;
1655 TRUE = 2;
1656 }
1657 optional InstantApp is_instant_app = 5;
1658
1659 enum ForegroundState {
1660 UNKNOWN = 0;
1661 BACKGROUND = 1;
1662 FOREGROUND = 2;
1663 }
1664 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001665
1666 optional android.server.ErrorSource error_source = 7;
1667
1668 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001669}
1670
Bookatza7020bd2018-08-28 16:29:35 -07001671/**
1672 * Logs when the vibrator state changes.
1673 * Logged from:
1674 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1675 */
1676message VibratorStateChanged {
1677 repeated AttributionNode attribution_node = 1;
1678
1679 enum State {
1680 OFF = 0;
1681 ON = 1;
1682 }
1683 optional State state = 2;
1684
1685 // Duration (in milliseconds) requested to keep the vibrator on.
1686 // Only applicable for State == ON.
1687 optional int64 duration_millis = 3;
1688}
1689
David Chen0a368b22017-12-06 16:28:16 -08001690/*
1691 * Allows other apps to push events into statsd.
1692 * Logged from:
1693 * frameworks/base/core/java/android/util/StatsLog.java
1694 */
David Chen0b5c90c2018-01-25 16:51:49 -08001695message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001696 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001697 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001698
1699 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1700 optional int32 label = 2;
1701
1702 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1703 // predicates for the metrics).
1704 enum State {
1705 UNKNOWN = 0;
1706 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1707 STOP = 2;
1708 START = 3;
1709 }
1710 optional State state = 3;
1711}
1712
David Chen9e3808c2017-11-20 17:25:34 -08001713/**
Bookatz7948c872018-09-04 12:58:33 -07001714 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1715 * For example, this could be due to the user manually changing the time.
1716 *
1717 * Logged from:
1718 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1719 */
1720message WallClockTimeShifted {
1721 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1722 optional int64 wall_clock_timestamp_millis = 1;
1723}
1724
1725/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001726 * Logs when statsd detects an anomaly.
1727 *
1728 * Logged from:
1729 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1730 */
1731message AnomalyDetected {
1732 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001733 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001734
Yangster-mac94e197c2018-01-02 16:03:03 -08001735 // Id of the config whose anomaly detection alert fired.
1736 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001737
Yangster-mac94e197c2018-01-02 16:03:03 -08001738 // Id of the alert (i.e. name of the anomaly that was detected).
1739 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001740}
1741
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001742message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001743 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001744 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001745
1746 // The app package name.
1747 optional string pkg_name = 2;
1748
1749 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001750 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001751 WARM = 1;
1752 HOT = 2;
1753 COLD = 3;
1754 }
1755 // The transition type.
1756 optional TransitionType type = 3;
1757
1758 // The activity name.
1759 optional string activity_name = 4;
1760
1761 // The name of the calling app. Empty if not set.
1762 optional string calling_pkg_name = 5;
1763
1764 // Whether the app is an instant app.
1765 optional bool is_instant_app = 6;
1766
1767 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001768 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001769
Bookatz80d11a02018-01-16 10:46:35 -08001770 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001771
David Chen0b5c90c2018-01-25 16:51:49 -08001772 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001773 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001774 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001775 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001776 optional int32 bind_application_delay_millis = 11;
1777 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001778
1779 // Empty if not set.
1780 optional string launch_token = 13;
1781
Calin Juravle759fbda2018-02-20 19:52:30 +00001782 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001783 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001784
1785 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001786 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001787}
1788
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001789message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001790 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001791 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001792
1793 // The app package name.
1794 optional string pkg_name = 2;
1795
1796 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001797 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001798 WARM = 1;
1799 HOT = 2;
1800 COLD = 3;
1801 }
1802 // The transition type.
1803 optional TransitionType type = 3;
1804
1805 // The activity name.
1806 optional string activity_name = 4;
1807}
1808
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001809message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001810 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001811 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001812
1813 // The app package name.
1814 optional string pkg_name = 2;
1815
1816 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001817 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001818 WITH_BUNDLE = 1;
1819 WITHOUT_BUNDLE = 2;
1820 }
1821 // The transition type.
1822 optional TransitionType type = 3;
1823
1824 // The activity name.
1825 optional string activity_name = 4;
1826
1827 optional bool transition_process_running = 5;
1828
1829 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001830 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001831}
1832
Bookatz8fcd09a2017-12-18 13:01:10 -08001833/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001834 * Logs a picture-in-picture action
1835 * Logged from:
1836 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1837 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1838 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1839 */
1840message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001841 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001842 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001843
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001844 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001845
Chenjie Yu52cacc62017-12-08 18:11:45 -08001846 enum State {
1847 ENTERED = 1;
1848 EXPANDED_TO_FULL_SCREEN = 2;
1849 MINIMIZED = 3;
1850 DISMISSED = 4;
1851 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001852 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001853}
1854
1855/**
Chenjie Yue8904192017-12-08 19:12:57 -08001856 * Logs overlay action
1857 * Logged from:
1858 * services/core/java/com/android/server/wm/Session.java
1859 */
1860message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001861 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001862
1863 optional string package_name = 2;
1864
1865 optional bool using_alert_window = 3;
1866
1867 enum State {
1868 ENTERED = 1;
1869 EXITED = 2;
1870 }
1871 optional State state = 4;
1872}
1873
Chenjie Yuccfe6452018-01-30 11:33:21 -08001874/*
1875 * Logs foreground service starts and stops.
1876 * Note that this is not when a service starts or stops, but when it is
1877 * considered foreground.
1878 * Logged from
1879 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1880 */
1881message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001882 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001883 // package_name + "/" + class_name
1884 optional string short_name = 2;
1885
1886 enum State {
1887 ENTER = 1;
1888 EXIT = 2;
1889 }
1890 optional State state = 3;
1891}
1892
Chenjie Yue8904192017-12-08 19:12:57 -08001893/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001894 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1895 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1896 * attributed back to the parent (host) uid. One example is Chrome.
1897 *
1898 * Logged from:
1899 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1900 */
1901message IsolatedUidChanged {
1902 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001903 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001904 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001905 optional int32 parent_uid = 1;
1906
1907 optional int32 isolated_uid = 2;
1908
1909 // We expect an isolated uid to be removed before if it's used for another parent uid.
1910 enum Event {
1911 REMOVED = 0;
1912 CREATED = 1;
1913 }
1914 optional Event event = 3;
1915}
1916
1917/*
1918 * Logs the reception of an incoming network packet causing the main system to wake up for
1919 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1920 * and processed by WakeupController.cpp.
1921 */
1922message PacketWakeupOccurred {
1923 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1924 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001925 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001926 // The interface name on which the packet was received.
1927 optional string iface = 2;
1928 // The ethertype value of the packet.
1929 optional int32 ethertype = 3;
1930 // String representation of the destination MAC address of the packet.
1931 optional string destination_hardware_address = 4;
1932 // String representation of the source address of the packet if this was an IP packet.
1933 optional string source_ip = 5;
1934 // String representation of the destination address of the packet if this was an IP packet.
1935 optional string destination_ip = 6;
1936 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1937 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1938 // families.
1939 optional int32 ip_next_header = 7;
1940 // The source port if this was a TCP or UDP packet.
1941 optional int32 source_port = 8;
1942 // The destination port if this was a TCP or UDP packet.
1943 optional int32 destination_port = 9;
1944}
1945
1946/*
1947 * Logs the memory stats for an app on startup.
1948 * Logged from:
1949 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1950 */
1951message AppStartMemoryStateCaptured {
1952 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001953 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001954
1955 // The process name.
1956 optional string process_name = 2;
1957
1958 // The activity name.
1959 optional string activity_name = 3;
1960
1961 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001962 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001963
1964 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001965 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001966
1967 // RSS
1968 optional int64 rss_in_bytes = 6;
1969
1970 // CACHE
1971 optional int64 cache_in_bytes = 7;
1972
1973 // SWAP
1974 optional int64 swap_in_bytes = 8;
1975}
1976
1977/*
1978 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1979 * for LMK event.
1980 * Logged from:
1981 * system/core/lmkd/lmkd.c
1982 */
1983message LmkStateChanged {
1984 enum State {
1985 UNKNOWN = 0;
1986 START = 1;
1987 STOP = 2;
1988 }
1989 optional State state = 1;
1990}
1991
1992/*
1993 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1994 * Logged from:
1995 * system/core/lmkd/lmkd.c
1996 */
1997message LmkKillOccurred {
1998 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001999 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002000
2001 // The process name.
2002 optional string process_name = 2;
2003
2004 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002005 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002006
2007 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002008 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002009
2010 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002011 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002012
2013 // RSS
2014 optional int64 rss_in_bytes = 6;
2015
2016 // CACHE
2017 optional int64 cache_in_bytes = 7;
2018
2019 // SWAP
2020 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002021
2022 // The elapsed real time of start of the process.
2023 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002024}
2025
Rajeev Kumar51b54602018-03-01 12:18:26 -08002026/*
2027 * Logs when the ActivityManagerService detects that an app died.
2028 *
2029 * Logged from:
2030 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2031 */
2032message AppDied {
2033 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002034 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002035}
2036
Howard Ro21a039c2018-08-06 14:55:47 -07002037/**
2038 * An atom for generic metrics logging. Available from Android Q.
2039 */
2040message GenericAtom {
2041 // The uid of the application that sent this custom atom.
2042 optional int32 uid = 1 [(is_uid) = true];
2043
2044 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002045 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002046}
2047
Tej Singhd6d6d772018-09-05 17:41:25 -07002048/**
2049 * Logs when a fingerprint acquire event occurs.
2050 *
2051 * Logged from:
2052 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2053 */
2054message FingerprintAcquired {
2055 // The associated user. Eg: 0 for owners, 10+ for others.
2056 // Defined in android/os/UserHandle.java
2057 optional int32 user = 1;
2058 // If this acquire is for a crypto fingerprint.
2059 // e.g. Secure purchases, unlock password storage.
2060 optional bool is_crypto = 2;
2061}
2062
2063/**
2064 * Logs when a fingerprint authentication event occurs.
2065 *
2066 * Logged from:
2067 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2068 */
2069message FingerprintAuthenticated {
2070 // The associated user. Eg: 0 for owners, 10+ for others.
2071 // Defined in android/os/UserHandle.java
2072 optional int32 user = 1;
2073 // If this authentication is for a crypto fingerprint.
2074 // e.g. Secure purchases, unlock password storage.
2075 optional bool is_crypto = 2;
2076 // Whether or not this authentication was successful.
2077 optional bool is_authenticated = 3;
2078}
2079
2080/**
2081 * Logs when a fingerprint error occurs.
2082 *
2083 * Logged from:
2084 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2085 */
2086message FingerprintErrorOccurred {
2087 // The associated user. Eg: 0 for owners, 10+ for others.
2088 // Defined in android/os/UserHandle.java
2089 optional int32 user = 1;
2090 // If this error is for a crypto fingerprint.
2091 // e.g. Secure purchases, unlock password storage.
2092 optional bool is_crypto = 2;
2093
2094 enum Error {
2095 UNKNOWN = 0;
2096 LOCKOUT = 1;
2097 PERMANENT_LOCKOUT = 2;
2098 }
2099 // The type of error.
2100 optional Error error = 3;
2101}
Howard Ro688ae182018-09-25 00:09:36 -07002102
2103message Notification {
2104
2105 // Type of notification event.
2106 enum Type {
2107 TYPE_UNKNOWN = 0;
2108 // Notification became visible to the user.
2109 TYPE_OPEN = 1;
2110 // Notification became hidden.
2111 TYPE_CLOSE = 2;
2112 // Notification switched to detail mode.
2113 TYPE_DETAIL = 3;
2114 // Notification was clicked.
2115 TYPE_ACTION = 4;
2116 // Notification was dismissed.
2117 TYPE_DISMISS = 5;
2118 // Notification switched to summary mode. The enum value of 14 is to
2119 // match that of metrics_constants.
2120 TYPE_COLLAPSE = 14;
2121 }
2122 optional Type type = 1;
2123
2124 // Package name associated with the notification.
2125 optional string package_name = 2;
2126
2127 // Tag associated with notification.
2128 optional string tag = 3;
2129
2130 // Application-supplied ID associated with the notification.
2131 optional int32 id = 4;
2132
2133 // Index of notification in the notification panel.
2134 optional int32 shade_index = 5;
2135
2136 // The number of notifications in the notification panel.
2137 optional int32 shade_count = 6;
2138
2139 // Importance for the notification.
2140 optional int32 importance = 7;
2141
2142 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002143 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002144
2145 // Importance for the notification channel.
2146 optional int32 channel_importance = 9;
2147
Howard Ro183c2bd2018-10-18 13:52:10 -07002148 // Application-supplied ID associated with the notifications group.
2149 optional string group_id = 10;
2150
Howard Ro688ae182018-09-25 00:09:36 -07002151 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002152 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002153
Howard Ro183c2bd2018-10-18 13:52:10 -07002154 // Reason for dismissal of a notification. This field is only meaningful for
2155 // TYPE_DISMISS events.
2156 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002157
Howard Ro183c2bd2018-10-18 13:52:10 -07002158 // The first post time of notification, stable across updates.
2159 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002160
Howard Ro183c2bd2018-10-18 13:52:10 -07002161 // The most recent interruption time, or the creation time if no updates.
2162 // Differs from update_millis because updates are filtered based on whether
2163 // they actually interrupted the user.
2164 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002165
Howard Ro183c2bd2018-10-18 13:52:10 -07002166 // The most recent update time, or the creation time if no updates.
2167 optional int64 update_millis = 15;
2168
2169 // The most recent visibility event.
2170 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002171}
2172
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002173/*
Yangster-macb89807e2018-11-15 21:10:57 -08002174 * Logs when a flag flip state changes.
2175 * Logged in P/h.
2176 */
2177message PhenotypeFlagStateChanged {
2178 // Mendel configuration name.
2179 optional string mendel_config_name = 1;
2180 // State
2181 enum State {
2182 STATE_UNKNOWN = 0;
2183 COMMITTED = 1;
2184 }
2185 optional State state = 2;
2186}
2187
2188/*
2189 * Logs when a binary push state changes.
2190 * Logged in Play store
2191 */
2192message BinaryPushStateChanged {
2193 // Binary package name.
2194 optional string binary_name = 1;
2195 // Version code.
2196 optional int64 version = 2;
2197 // State
2198 enum State {
2199 STATE_UNKNOWN = 0;
2200 DOWNLOAD_START = 1;
2201 DOWNLOAD_DONE = 2;
2202 INSTALL_START = 3;
2203 INSTALL_DONE = 4;
2204 REBOOT_START = 5;
2205 REBOOT_DONE = 6;
2206 }
2207 optional State state = 3;
2208}
2209
2210/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002211 * Logs when a connection becomes available and lost.
2212 * Logged in StatsCompanionService.java
2213 */
2214message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002215 // Id of the network.
2216 optional int32 net_id = 1;
2217
2218 enum State {
2219 UNKNOWN = 0;
2220 CONNECTED = 1;
2221 DISCONNECTED = 2;
2222 }
2223 // Connected state of a network.
2224 optional State state = 2;
2225}
2226
2227/**
2228 * Logs when a service starts and stops.
2229 * Logged from:
2230 * services/core/java/com/android/server/am/ActiveServices.java
2231 */
2232message ServiceStateChanged {
2233
2234 optional int32 uid = 1 [(is_uid) = true];
2235
2236 optional string package_name = 2;
2237
2238 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002239
2240 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002241 START = 1;
2242 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002243 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002244
2245 optional State state = 4;
2246}
2247
2248/**
2249 * Logs when a service is launched.
2250 * Logged from:
2251 * services/core/java/com/android/server/am/ActiveServices.java
2252 */
2253message ServiceLaunchReported {
2254
2255 optional int32 uid = 1 [(is_uid) = true];
2256
2257 optional string package_name = 2;
2258
2259 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002260}
Howard Ro688ae182018-09-25 00:09:36 -07002261
Chenjie Yubbcbc602018-02-05 16:51:52 -08002262//////////////////////////////////////////////////////////////////////
2263// Pulled atoms below this line //
2264//////////////////////////////////////////////////////////////////////
2265
2266/**
David Chenc8a43242017-10-17 16:23:28 -07002267 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2268 *
2269 * Pulled from:
2270 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2271 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002272message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002273 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002274
2275 optional int64 rx_bytes = 2;
2276
2277 optional int64 rx_packets = 3;
2278
2279 optional int64 tx_bytes = 4;
2280
2281 optional int64 tx_packets = 5;
2282}
2283
2284/**
2285 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2286 *
2287 * Pulled from:
2288 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2289 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002290message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002291 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002292
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002293 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2294 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002295
2296 optional int64 rx_bytes = 3;
2297
2298 optional int64 rx_packets = 4;
2299
2300 optional int64 tx_bytes = 5;
2301
2302 optional int64 tx_packets = 6;
2303}
2304
2305/**
2306 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2307 *
2308 * Pulled from:
2309 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2310 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002311message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002312 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002313
2314 optional int64 rx_bytes = 2;
2315
2316 optional int64 rx_packets = 3;
2317
2318 optional int64 tx_bytes = 4;
2319
2320 optional int64 tx_packets = 5;
2321}
2322
2323/**
2324 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2325 *
2326 * Pulled from:
2327 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2328 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002329message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002330 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002331
Yao Chenc40a19d2018-03-15 16:48:25 -07002332 // 1 denotes foreground and 0 denotes background. This is called Set in
2333 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002334 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002335
2336 optional int64 rx_bytes = 3;
2337
2338 optional int64 rx_packets = 4;
2339
2340 optional int64 tx_bytes = 5;
2341
2342 optional int64 tx_packets = 6;
2343}
2344
2345/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002346 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2347 *
2348 * Pulled from:
2349 * StatsCompanionService
2350 */
2351message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002352 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002353
2354 optional int64 rx_bytes = 2;
2355
2356 optional int64 tx_bytes = 3;
2357}
2358
2359/**
David Chenc8a43242017-10-17 16:23:28 -07002360 * Pulls the kernel wakelock durations. This atom is adapted from
2361 * android/internal/os/KernelWakelockStats.java
2362 *
2363 * Pulled from:
2364 * StatsCompanionService using KernelWakelockReader.
2365 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002366message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002367 optional string name = 1;
2368
2369 optional int32 count = 2;
2370
2371 optional int32 version = 3;
2372
Yangster-maca8a30442018-10-13 23:46:34 -07002373 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002374}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002375
Chenjie Yu05013b32017-11-21 10:21:41 -08002376/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002377 * Pulls low power state information. This includes platform and subsystem sleep state information,
2378 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002379 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002380 * hardware/interfaces/power/1.1/types.hal
2381 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002382message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002383 // Subsystem name
2384 optional string subsystem_name = 1;
2385 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2386 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2387 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002388 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002389 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002390 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002391 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002392}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002393
Chenjie Yu05013b32017-11-21 10:21:41 -08002394/**
Bookatz92da2832018-11-01 18:10:03 -07002395 * Pulls on-device power measurement information.
2396 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2397 * Pulled from:
2398 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2399 */
2400message OnDevicePowerMeasurement {
2401 // Name of the subsystem (to which the rail belongs).
2402 optional string subsystem_name = 1;
2403
2404 // Rail name. The rail lies within the subsystem.
2405 optional string rail_name = 2;
2406
2407 // Time (in ms since boot) at which the rail energy value was measured.
2408 // This may differ slightly from the time that statsd logs this information.
2409 optional uint64 measurement_timestamp_millis = 3;
2410
2411 // Accumulated energy used via the rail since device boot in uWs.
2412 optional uint64 energy_microwatt_secs = 4;
2413}
2414
2415/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002416 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002417 * Pulls the time the cpu spend on the frequency index. Frequency index
2418 * starts from highest to lowest. The value should be monotonically
2419 * increasing since boot. However, if there is a cpu
2420 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002421 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002422message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002423 optional uint32 cluster = 1;
2424 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002425 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002426}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002427
Chenjie Yu05013b32017-11-21 10:21:41 -08002428/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002429 * Pulls Cpu Time Per Uid.
2430 * Note that isolated process uid time should be attributed to host uids.
2431 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002432message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002433 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002434 optional uint64 user_time_micros = 2;
2435 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002436}
2437
2438/**
2439 * Pulls Cpu Time Per Uid per frequency.
2440 * Note that isolated process uid time should be attributed to host uids.
2441 * For each uid, we order the time by descending frequencies.
2442 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002443message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002444 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002445 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002446 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002447}
Hugo Benichi884970e2017-11-14 22:42:46 +09002448
Chenjie Yu05013b32017-11-21 10:21:41 -08002449/**
2450 * Pulls Wifi Controller Activity Energy Info
2451 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002452message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002453 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002454 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002455 // stack reported state
2456 // TODO: replace this with proto enum
2457 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002458 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002459 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002460 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002461 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002462 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002463 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002464 // product of current(mA), voltage(V) and time(ms)
2465 optional uint64 controller_energy_used = 6;
2466}
2467
2468/**
2469 * Pulls Modem Activity Energy Info
2470 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002471message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002472 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002473 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002474 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002475 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002476 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002477 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002478 /**
2479 * Tx power index
2480 * index 0 = tx_power < 0dBm
2481 * index 1 = 0dBm < tx_power < 5dBm
2482 * index 2 = 5dBm < tx_power < 15dBm
2483 * index 3 = 15dBm < tx_power < 20dBm
2484 * index 4 = tx_power > 20dBm
2485 */
2486 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002487 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002488 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002489 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002490 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002491 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002492 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002493 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002494 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002495 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002496 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002497 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002498 // product of current(mA), voltage(V) and time(ms)
2499 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002500}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002501
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002502/**
2503 * Pulls Bluetooth Activity Energy Info
2504 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2505 */
2506message BluetoothActivityInfo {
2507 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002508 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002509 // bluetooth stack state
2510 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002511 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002512 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002513 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002514 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002515 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002516 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002517 // product of current(mA), voltage(V) and time(ms)
2518 optional uint64 energy_used = 6;
2519}
2520
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002521/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002522 * Logs the memory stats for a process.
2523 */
2524message ProcessMemoryState {
2525 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002526 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002527
2528 // The process name.
2529 optional string process_name = 2;
2530
2531 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002532 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002533
2534 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002535 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002536
2537 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002538 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002539
Rajeev Kumar90235992018-01-29 11:06:48 -08002540 // RSS
2541 optional int64 rss_in_bytes = 6;
2542
2543 // CACHE
2544 optional int64 cache_in_bytes = 7;
2545
2546 // SWAP
2547 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002548
2549 // RSS high watermark.
2550 // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status or
2551 // from memory.max_usage_in_bytes under /dev/memcg if the device uses per-app memory cgroups.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002552 // Deprecated: use ProcessMemoryHighWaterMark atom instead.
2553 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002554
2555 // Elapsed real time when the process started.
2556 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2557 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002558}
2559
2560/*
Rafal Slawik08621582018-10-15 14:53:07 +01002561 * Logs the memory stats for a native process (from procfs).
2562 */
2563message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002564 // The uid if available. -1 means not available.
2565 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002566
Rafal Slawikbf67d072018-10-23 11:07:54 +01002567 // The process name.
2568 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002569
Rafal Slawikbf67d072018-10-23 11:07:54 +01002570 // # of page-faults
2571 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002572
Rafal Slawikbf67d072018-10-23 11:07:54 +01002573 // # of major page-faults
2574 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002575
Rafal Slawikbf67d072018-10-23 11:07:54 +01002576 // RSS
2577 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002578
Rafal Slawikbf67d072018-10-23 11:07:54 +01002579 // RSS high watermark.
2580 // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002581 // Deprecated: use ProcessMemoryHighWaterMark atom instead.
2582 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002583
2584 // Elapsed real time when the process started.
2585 // Value is read from /proc/PID/stat, field 22.
2586 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002587}
2588
2589/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002590 * Logs the memory high-water mark for a process.
2591 * Recorded in ActivityManagerService.
2592 */
2593message ProcessMemoryHighWaterMark {
2594 // The uid if available. -1 means not available.
2595 optional int32 uid = 1 [(is_uid) = true];
2596
2597 // The process name. Provided by ActivityManagerService or read from /proc/PID/cmdline.
2598 optional string process_name = 2;
2599
2600 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2601 // /proc/PID/status.
2602 optional int64 rss_high_water_mark_in_bytes = 3;
2603}
2604
2605/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002606 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002607 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002608message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002609 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002610}
2611
2612/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002613 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002614 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002615message SystemUptime {
2616 // Milliseconds since the system was booted.
2617 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2618 // for external input).
2619 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002620 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002621}
2622
2623/*
2624 * Reads from /proc/uid_concurrent_active_time which has the format:
2625 * active: X (X is # cores)
2626 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2627 * [uid1]: [time-0] [time-1] [time-2] ... ...
2628 * ...
2629 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2630 * The file contains a monotonically increasing count of time for a single boot.
2631 */
2632message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002633 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002634 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002635}
2636
2637/**
2638 * Reads from /proc/uid_concurrent_policy_time which has the format:
2639 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2640 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2641 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2642 * ...
2643 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2644 * The file contains a monotonically increasing count of time for a single boot.
2645 */
2646message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002647 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002648 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002649 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002650}
2651
2652/*
2653 * Pulls free disk space, for data, system partition and temporary directory.
2654 */
2655message DiskSpace {
2656 // available bytes in data partition
2657 optional uint64 data_available_bytes = 1;
2658 // available bytes in system partition
2659 optional uint64 system_available_bytes = 2;
2660 // available bytes in download cache or temp directories
2661 optional uint64 temp_available_bytes = 3;
2662}
Tej Singhbf972d92018-01-10 20:51:13 -08002663
2664/**
2665 * Pulls battery coulomb counter, which is the remaining battery charge 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 RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002670 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002671}
2672
2673/**
2674 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002675 * Pulled from:
2676 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002677 */
2678message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002679 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002680}
2681
2682/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002683 * Pulls battery voltage.
2684 * Pulled from:
2685 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2686 */
2687message BatteryVoltage {
2688 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07002689 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07002690}
2691
2692/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08002693 * Pulls battery level (percent full, from 0 to 100).
2694 *
2695 * Pulled from:
2696 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2697 */
2698message BatteryLevel {
2699 // Battery level. Should be in [0, 100].
2700 optional int32 battery_level = 1;
2701}
2702
2703/**
Tej Singhd89137e2018-03-26 14:51:40 -07002704 * Pulls the temperature of various parts of the device.
2705 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002706 *
2707 * Pulled from:
2708 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2709 */
2710message Temperature {
2711 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2712 optional android.os.TemperatureTypeEnum sensor_location = 1;
2713
2714 // The name of the temperature source. Eg. CPU0
2715 optional string sensor_name = 2;
2716
Tej Singhd89137e2018-03-26 14:51:40 -07002717 // Temperature in tenths of a degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002718 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08002719}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002720
2721/**
2722 * Pulls the statistics of calls to Binder.
2723 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002724 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2725 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002726 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002727 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002728 */
2729message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002730 // UID of the process responsible for the binder transaction. It will be set if the process
2731 // executing the binder transaction attribute the transaction to another uid using
2732 // Binder.setThreadWorkSource().
2733 //
2734 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002735 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002736 // UID of the process executing the binder transaction.
2737 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002738 // Fully qualified class name of the API call.
2739 //
2740 // This is a system server class name.
2741 //
2742 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2743 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2744 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2745 // commonly used APIs.
2746 optional string service_class_name = 2;
2747 // Method name of the API call. It can also be a transaction code if we cannot
2748 // resolve it to a name. See Binder#getTransactionName.
2749 //
2750 // This is a system server method name.
2751 optional string service_method_name = 3;
2752 // Total number of API calls.
2753 optional int64 call_count = 4;
2754 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2755 optional bool screen_interactive = 13;
2756 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2757 // call_count will be equal to recorded_call_count.
2758 //
2759 // If recorded_call_count is different than call_count, it means data collection has been
2760 // sampled. All the fields below will be sampled in this case.
2761 optional int64 recorded_call_count = 12;
2762 // Number of exceptions thrown by the API.
2763 optional int64 recorded_exception_count = 5;
2764 // Total latency of all API calls.
2765 // Average can be computed using total_latency_micros / recorded_call_count.
2766 optional int64 recorded_total_latency_micros = 6;
2767 // Maximum latency of one API call.
2768 optional int64 recorded_max_latency_micros = 7;
2769 // Total CPU usage of all API calls.
2770 // Average can be computed using total_cpu_micros / recorded_call_count.
2771 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2772 optional int64 recorded_total_cpu_micros = 8;
2773 // Maximum CPU usage of one API call.
2774 optional int64 recorded_max_cpu_micros = 9;
2775 // Maximum parcel reply size of one API call.
2776 optional int64 recorded_max_reply_size_bytes = 10;
2777 // Maximum parcel request size of one API call.
2778 optional int64 recorded_max_request_size_bytes = 11;
2779}
2780
2781/**
2782 * Pulls the statistics of exceptions during calls to Binder.
2783 *
2784 * Binder stats are cumulative from boot unless somebody reset the data using
2785 * > adb shell dumpsys binder_calls_stats --reset
2786 */
2787message BinderCallsExceptions {
2788 // Exception class name, e.g. java.lang.IllegalArgumentException.
2789 //
2790 // This is an exception class name thrown by the system server.
2791 optional string exception_class_name = 1;
2792 // Total number of exceptions.
2793 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002794}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002795
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002796/**
2797 * Pulls the statistics of message dispatching on HandlerThreads.
2798 *
2799 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2800 * config on the device.
2801 *
2802 * Next tag: 11
2803 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002804message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002805 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002806 optional int32 uid = 1 [(is_uid) = true];
2807
2808 // Fully qualified class name of the handler target class.
2809 //
2810 // This field does not contain PII. This is a system server class name.
2811 optional string handler_class_name = 2;
2812
2813 // The name of the thread that runs the Looper.
2814 //
2815 // This field does not contain PII. This is a system server thread name.
2816 optional string looper_thread_name = 3;
2817
2818 // The name of the dispatched message.
2819 //
2820 // This field does not contain PII. This is a system server constant or class
2821 // name.
2822 optional string message_name = 4;
2823
2824 // Total number of successfully dispatched messages.
2825 optional int64 message_count = 5;
2826
2827 // Total number of messages that failed dispatching.
2828 optional int64 exception_count = 6;
2829
2830 // Total number of processed messages we have data recorded for. If we
2831 // collected data for all the messages, message_count will be equal to
2832 // recorded_message_count.
2833 //
2834 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002835 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002836 optional int64 recorded_message_count = 7;
2837
2838 // Total latency of all processed messages.
2839 // Average can be computed using recorded_total_latency_micros /
2840 // recorded_message_count.
2841 optional int64 recorded_total_latency_micros = 8;
2842
2843 // Total CPU usage of all processed message.
2844 // Average can be computed using recorded_total_cpu_micros /
2845 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002846 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002847 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002848
2849 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2850 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002851
2852 // Max recorded CPU usage of all processed messages.
2853 optional int64 recorded_max_cpu_micros = 11;
2854
2855 // Max recorded latency of all processed messages.
2856 optional int64 recorded_max_latency_micros = 12;
2857
2858 // Total number of messages we tracked the dispatching delay for. If we
2859 // collected data for all the messages, message_count will be equal to
2860 // recorded_delay_message_count.
2861 //
2862 // If recorded_delay_message_count is different than message_count, it means data
2863 // collection has been sampled or/and not all messages specified the target dispatch time.
2864 // The fields below will be sampled in this case.
2865 optional int64 recorded_delay_message_count = 13;
2866
2867 // Total dispatching delay of all processed messages.
2868 // Calculated as a difference between the target dispatching time (Message.when)
2869 // and the actual dispatching time.
2870 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
2871 optional int64 recorded_total_delay_millis = 14;
2872
2873 // Max dispatching delay of all processed messages.
2874 // Calculated as a difference between the target dispatching time (Message.when)
2875 // and the actual dispatching time.
2876 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002877}
Tej Singh86dc9db2018-09-06 00:39:57 +00002878
2879/**
2880 * Pulls disk information, such as write speed and latency.
2881 */
2882message DiskStats {
2883 // Time taken to open, write 512B to, and close a file.
2884 // -1 if error performing the check.
2885 optional int64 data_write_latency_millis = 1;
2886
2887 optional bool file_based_encryption = 2;
2888
2889 // Recent disk write speed in kB/s.
2890 // -1 if error querying storageed.
2891 // 0 if data is unavailable.
2892 optional int32 recent_disk_write_speed = 3;
2893}
2894
2895
2896/**
2897 * Free and total bytes of the Data, Cache, and System partition.
2898 */
2899message DirectoryUsage {
2900 enum Directory {
2901 UNKNOWN = 0;
2902 DATA = 1;
2903 CACHE = 2;
2904 SYSTEM = 3;
2905 }
2906 optional Directory directory = 1;
2907 optional int64 free_bytes = 2;
2908 optional int64 total_bytes = 3;
2909}
2910
2911
2912/**
2913 * Size of an application: apk size, data size, and cache size.
2914 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2915 * Information is only reported for apps with the primary user (user 0).
2916 * Sizes are aggregated by package name.
2917 */
2918message AppSize {
2919 // Including uids will involve modifying diskstats logic.
2920 optional string package_name = 1;
2921 // App size in bytes. -1 if unavailable.
2922 optional int64 app_size_bytes = 2;
2923 // App data size in bytes. -1 if unavailable.
2924 optional int64 app_data_size_bytes = 3;
2925 // App cache size in bytes. -1 if unavailable.
2926 optional int64 app_cache_size_bytes = 4;
2927 // Time that the cache file was produced.
2928 // Uses System.currentTimeMillis(), which is wall clock time.
2929 optional int64 cache_time_millis = 5;
2930}
2931
2932
2933/**
2934 * Size of a particular category. Eg: photos, videos.
2935 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2936 */
2937message CategorySize {
2938 enum Category {
2939 UNKNOWN = 0;
2940 APP_SIZE = 1;
2941 APP_DATA_SIZE = 2;
2942 APP_CACHE_SIZE = 3;
2943 PHOTOS = 4;
2944 VIDEOS = 5;
2945 AUDIO = 6;
2946 DOWNLOADS = 7;
2947 SYSTEM = 8;
2948 OTHER = 9;
2949 }
2950 optional Category category = 1;
2951 // Category size in bytes.
2952 optional int64 size_bytes = 2;
2953 // Time that the cache file was produced.
2954 // Uses System.currentTimeMillis(), which is wall clock time.
2955 optional int64 cache_time_millis = 3;
2956}
Tej Singhd6d6d772018-09-05 17:41:25 -07002957
2958/**
Tej Singhe7726dc2018-09-21 11:42:12 -07002959 * Pulls per uid I/O stats. The stats are cumulative since boot.
2960 *
2961 * Read/write bytes are I/O events from a storage device
2962 * Read/write chars are data requested by read/write syscalls, and can be
2963 * satisfied by caching.
2964 *
2965 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
2966 */
2967message DiskIo {
2968 optional int32 uid = 1 [(is_uid) = true];
2969 optional int64 fg_chars_read = 2;
2970 optional int64 fg_chars_write = 3;
2971 optional int64 fg_bytes_read = 4;
2972 optional int64 fg_bytes_write = 5;
2973 optional int64 bg_chars_read = 6;
2974 optional int64 bg_chars_write = 7;
2975 optional int64 bg_bytes_read = 8;
2976 optional int64 bg_bytes_write = 9;
2977 optional int64 fg_fsync = 10;
2978 optional int64 bg_fsync= 11;
2979}
2980
2981
2982/**
Tej Singhd6d6d772018-09-05 17:41:25 -07002983 * Pulls the number of fingerprints for each user.
2984 *
2985 * Pulled from StatsCompanionService, which queries FingerprintManager.
2986 */
2987message NumFingerprints {
2988 // The associated user. Eg: 0 for owners, 10+ for others.
2989 // Defined in android/os/UserHandle.java
2990 optional int32 user = 1;
2991 // Number of fingerprints registered to that user.
2992 optional int32 num_fingerprints = 2;
2993}
Chenjie Yu12e5e672018-09-14 15:54:59 -07002994
Yangsteraf9aee72018-10-12 09:26:16 -07002995message AggStats {
2996 optional int64 min = 1;
2997
2998 optional int64 average = 2;
2999
3000 optional int64 max = 3;
3001}
3002
3003message ProcessStatsStateProto {
3004 optional android.service.procstats.ScreenState screen_state = 1;
3005
3006 optional android.service.procstats.MemoryState memory_state = 2;
3007
3008 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3009 // and not frameworks/base/core/java/android/app/ActivityManager.java
3010 optional android.service.procstats.ProcessState process_state = 3;
3011
3012 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003013 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003014
3015 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003016 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003017
3018 // # of samples taken
3019 optional int32 sample_size = 5;
3020
3021 // PSS is memory reserved for this process
3022 optional AggStats pss = 6;
3023
3024 // USS is memory shared between processes, divided evenly for accounting
3025 optional AggStats uss = 7;
3026
3027 // RSS is memory resident for this process
3028 optional AggStats rss = 8;
3029}
3030
3031// Next Tag: 7
3032message ProcessStatsProto {
3033 // Name of process.
3034 optional string process = 1;
3035
3036 // Uid of the process.
3037 optional int32 uid = 2;
3038
3039 // Information about how often kills occurred
3040 message Kill {
3041 // Count of excessive CPU kills
3042 optional int32 cpu = 1;
3043
3044 // Count of kills when cached
3045 optional int32 cached = 2;
3046
3047 // PSS stats during cached kill
3048 optional AggStats cached_pss = 3;
3049 }
3050 optional Kill kill = 3;
3051
3052 // Time and memory spent in various states.
3053 repeated ProcessStatsStateProto states = 5;
3054
3055 // Total time process has been running... screen_state, memory_state, and process_state
3056 // will not be set.
3057 optional ProcessStatsStateProto total_running_state = 6;
3058}
3059
3060message PackageServiceOperationStatsProto {
3061 // Operate enum: Started, Foreground, Bound, Executing
3062 optional android.service.procstats.ServiceOperationState operation = 1;
3063
3064 // Number of times the service was in this operation.
3065 optional int32 count = 2;
3066
3067 // Information about a state the service can be in.
3068 message StateStats {
3069 // Screen state enum.
3070 optional android.service.procstats.ScreenState screen_state = 1;
3071 // Memory state enum.
3072 optional android.service.procstats.MemoryState memory_state = 2;
3073
3074 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003075 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003076 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003077 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003078 }
3079 repeated StateStats state_stats = 3;
3080}
3081
3082message PackageServiceStatsProto {
3083 // Name of service component.
3084 optional string service_name = 1;
3085
3086 // The operation stats.
3087 // The package_name, package_uid, package_version, service_name will not be set to save space.
3088 repeated PackageServiceOperationStatsProto operation_stats = 2;
3089}
3090
3091message PackageAssociationSourceProcessStatsProto {
3092 // Uid of the process.
3093 optional int32 process_uid = 1;
3094 // Process name.
3095 optional string process_name = 2;
3096
3097 // Total count of the times this association appeared.
3098 optional int32 total_count = 3;
3099
3100 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003101 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003102
3103 // Total count of the times this association became actively impacting its target process.
3104 optional int32 active_count = 5;
3105
3106 // Information on one source in this association.
3107 message StateStats {
3108 // Process state enum.
3109 optional android.service.procstats.ProcessState process_state = 1;
3110 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003111 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003112 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003113 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003114 }
3115 repeated StateStats active_state_stats = 6;
3116}
3117
3118message PackageAssociationProcessStatsProto {
3119 // Name of the target component.
3120 optional string component_name = 1;
3121 // Information on one source in this association.
3122 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3123}
3124
3125
3126message ProcessStatsPackageProto {
3127 // Name of package.
3128 optional string package = 1;
3129
3130 // Uid of the package.
3131 optional int32 uid = 2;
3132
3133 // Version of the package.
3134 optional int64 version = 3;
3135
3136 // Stats for each process running with the package loaded in to it.
3137 repeated ProcessStatsProto process_stats = 4;
3138
3139 // Stats for each of the package's services.
3140 repeated PackageServiceStatsProto service_stats = 5;
3141
3142 // Stats for each association with the package.
3143 repeated PackageAssociationProcessStatsProto association_stats = 6;
3144}
3145
3146message ProcessStatsSectionProto {
3147 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003148 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003149
3150 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003151 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003152
3153 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003154 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003155
3156 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003157 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003158
3159 // System runtime library. e.g. "libdvm.so", "libart.so".
3160 optional string runtime = 5;
3161
3162 // whether kernel reports swapped pss.
3163 optional bool has_swapped_pss = 6;
3164
3165 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3166 enum Status {
3167 STATUS_UNKNOWN = 0;
3168 STATUS_COMPLETE = 1;
3169 STATUS_PARTIAL = 2;
3170 STATUS_SHUTDOWN = 3;
3171 STATUS_SYSPROPS = 4;
3172 }
3173 repeated Status status = 7;
3174
3175 // Stats for each process.
3176 repeated ProcessStatsProto process_stats = 8;
3177
3178 // Stats for each package.
3179 repeated ProcessStatsPackageProto package_stats = 9;
3180}
3181
Chenjie Yu12e5e672018-09-14 15:54:59 -07003182/**
3183 * Pulled from ProcessStatsService.java
3184 */
3185message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003186 optional ProcessStatsSectionProto proc_stats_section = 1;
3187}
3188
3189message PowerProfileProto {
3190 optional double cpu_suspend = 1;
3191
3192 optional double cpu_idle = 2;
3193
3194 optional double cpu_active = 3;
3195
3196 message CpuCluster {
3197 optional int32 id = 1;
3198 optional double cluster_power = 2;
3199 optional int32 cores = 3;
3200 repeated int64 speed = 4;
3201 repeated double core_power = 5;
3202 }
3203
3204 repeated CpuCluster cpu_cluster = 40;
3205
3206 optional double wifi_scan = 4;
3207
3208 optional double wifi_on = 5;
3209
3210 optional double wifi_active = 6;
3211
3212 optional double wifi_controller_idle = 7;
3213
3214 optional double wifi_controller_rx = 8;
3215
3216 optional double wifi_controller_tx = 9;
3217
3218 repeated double wifi_controller_tx_levels = 10;
3219
3220 optional double wifi_controller_operating_voltage = 11;
3221
3222 optional double bluetooth_controller_idle = 12;
3223
3224 optional double bluetooth_controller_rx = 13;
3225
3226 optional double bluetooth_controller_tx = 14;
3227
3228 optional double bluetooth_controller_operating_voltage = 15;
3229
3230 optional double modem_controller_sleep = 16;
3231
3232 optional double modem_controller_idle = 17;
3233
3234 optional double modem_controller_rx = 18;
3235
3236 repeated double modem_controller_tx = 19;
3237
3238 optional double modem_controller_operating_voltage = 20;
3239
3240 optional double gps_on = 21;
3241
3242 repeated double gps_signal_quality_based = 22;
3243
3244 optional double gps_operating_voltage = 23;
3245
3246 optional double bluetooth_on = 24;
3247
3248 optional double bluetooth_active = 25;
3249
3250 optional double bluetooth_at_cmd = 26;
3251
3252 optional double ambient_display = 27;
3253
3254 optional double screen_on = 28;
3255
3256 optional double radio_on = 29;
3257
3258 optional double radio_scanning = 30;
3259
3260 optional double radio_active = 31;
3261
3262 optional double screen_full = 32;
3263
3264 optional double audio = 33;
3265
3266 optional double video = 34;
3267
3268 optional double flashlight = 35;
3269
3270 optional double memory = 36;
3271
3272 optional double camera = 37;
3273
3274 optional double wifi_batched_scan = 38;
3275
3276 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003277}
Chenjie Yuab530202018-09-26 12:39:20 -07003278
3279/**
3280 * power_profile.xml and other constants for power model calculations.
3281 * Pulled from PowerProfile.java
3282 */
3283message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003284 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003285}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003286
3287/**
arangelovd5db50e2018-10-12 20:24:39 +01003288 * Logs when a user restriction was added or removed.
3289 *
3290 * Logged from:
3291 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3292 */
3293message UserRestrictionChanged {
3294 // The raw string of the user restriction as defined in UserManager.
3295 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3296 optional string restriction = 1;
3297 // Whether the restriction is enabled or disabled.
3298 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003299}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003300
3301/**
3302 * Pulls process user time and system time. Puller takes a snapshot of all pids
3303 * in the system and returns cpu stats for those that are working at the time.
3304 * Dead pids will be dropped. Kernel processes are excluded.
3305 * Min cool-down is 5 sec.
3306 */
3307message ProcessCpuTime {
3308 optional int32 uid = 1 [(is_uid) = true];
3309
3310 optional string process_name = 2;
3311 // Process cpu time in user space, cumulative from boot/process start
3312 optional int64 user_time_millis = 3;
3313 // Process cpu time in system space, cumulative from boot/process start
3314 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003315}
Misha Wagner5a51e002018-10-03 15:04:09 +01003316
3317/**
3318 * Pulls the CPU usage for each thread.
3319 *
3320 * Read from /proc/$PID/task/$TID/time_in_state files.
3321 *
3322 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3323 * time_in_state files not being present on some phones, have not been addressed. These should be
3324 * considered before a public release.
3325 */
3326message CpuTimePerThreadFreq {
3327 // UID that owns the process.
3328 optional int32 uid = 1 [(is_uid) = true];
3329 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003330 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003331 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003332 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003333 // Name of the process taken from `/proc/$PID/cmdline`.
3334 optional string process_name = 4;
3335 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3336 optional string thread_name = 5;
3337 // What frequency the CPU was running at, in KHz
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003338 optional int32 frequency_khz = 6;
Misha Wagner5a51e002018-10-03 15:04:09 +01003339 // Time spent in frequency in milliseconds, since thread start.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003340 optional int32 time_millis = 7;
Misha Wagner5a51e002018-10-03 15:04:09 +01003341}
Bookatz75ee6042018-11-09 12:27:37 -08003342
3343/**
Bookatz366a4432018-11-20 09:42:33 -08003344 * Pulls information about the device's build.
3345 */
3346message BuildInformation {
3347 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3348 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3349 optional string fingerprint = 1;
3350
3351 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3352 optional string brand = 2;
3353
3354 // Build.PRODUCT. The name of the overall product.
3355 optional string product = 3;
3356
3357 // Build.DEVICE. The name of the industrial design.
3358 optional string device = 4;
3359
3360 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3361 optional string version_release = 5;
3362
3363 // Build.ID. E.g. a label like "M4-rc20".
3364 optional string id = 6;
3365
3366 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3367 // represent this build.
3368 optional string version_incremental = 7;
3369
3370 // Build.TYPE. The type of build, like "user" or "eng".
3371 optional string type = 8;
3372
3373 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3374 optional string tags = 9;
3375}
3376
3377/**
Bookatz75ee6042018-11-09 12:27:37 -08003378 * Pulls on-device BatteryStats power use calculations for the overall device.
3379 */
3380message DeviceCalculatedPowerUse {
3381 // Power used by the device in mAh, as computed by BatteryStats, since BatteryStats last reset
3382 // (i.e. roughly since device was last significantly charged).
3383 // Currently, this is BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3384 optional float computed_power_milli_amp_hours = 1;
3385}
3386
3387/**
3388 * Pulls on-device BatteryStats power use calculations broken down by uid.
3389 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3390 * that is attributed to non-uid items. They must all be included to get the total power use.
3391 */
3392message DeviceCalculatedPowerBlameUid {
3393 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3394 optional int32 uid = 1 [(is_uid) = true];
3395
3396 // Power used by this uid in mAh, as computed by BatteryStats, since BatteryStats last reset
3397 // (i.e. roughly since device was last significantly charged).
3398 optional float power_milli_amp_hours = 2;
3399}
3400
3401/**
3402 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3403 * drain type.
3404 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3405 * is attributed uids. They must all be included to get the total power use.
3406 */
3407message DeviceCalculatedPowerBlameOther {
3408 // The type of item whose power use is being reported.
3409 enum DrainType {
3410 AMBIENT_DISPLAY = 0;
3411 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3412 BLUETOOTH = 2;
3413 CAMERA = 3;
3414 // Cell-standby
3415 CELL = 4;
3416 FLASHLIGHT = 5;
3417 IDLE = 6;
3418 MEMORY = 7;
3419 // Amount that total computed drain exceeded the drain estimated using the
3420 // battery level changes and capacity.
3421 OVERCOUNTED = 8;
3422 PHONE = 9;
3423 SCREEN = 10;
3424 // Amount that total computed drain was below the drain estimated using the
3425 // battery level changes and capacity.
3426 UNACCOUNTED = 11;
3427 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3428 WIFI = 13;
3429 }
3430 optional DrainType drain_type = 1;
3431
3432 // Power used by this item in mAh, as computed by BatteryStats, since BatteryStats last reset
3433 // (i.e. roughly since device was last significantly charged).
3434 optional float power_milli_amp_hours = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003435}
arangelov4e994062018-11-13 16:12:38 +00003436
3437/**
3438 * Logs device policy features.
3439 *
3440 * Logged from:
3441 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3442 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3443 */
3444message DevicePolicyEvent {
3445 // The event id - unique for each event.
3446 optional android.stats.devicepolicy.EventId event_id = 1;
3447 // The admin package name.
3448 optional string admin_package_name = 2;
3449 // A generic integer parameter.
3450 optional int32 integer_value = 3;
3451 // A generic boolean parameter.
3452 optional bool boolean_value = 4;
3453 // A parameter specifying a time period in milliseconds.
3454 optional uint64 time_period_millis = 5;
3455 // A parameter specifying a list of package names, bundle extras or string parameters.
3456 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3457}