blob: d5a32bd98d2881fa5b2d57bfafcd45f6fed6f1c2 [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;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001210 enum State {
1211 STATE_DISCONNECTED = 0;
1212 STATE_CONNECTED = 1;
1213 }
1214 optional State state = 6;
1215 optional int64 last_connect_duration_ms = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001216}
1217
Tej Singheee317b2018-03-07 19:28:05 -08001218
Tej Singhdd7bd352018-02-09 19:33:15 -08001219/**
Tej Singh5d991e12018-03-09 19:48:11 -08001220 * Logs when Bluetooth is enabled and disabled.
1221 *
1222 * Logged from:
1223 * services/core/java/com/android/server/BluetoothManagerService.java
1224 */
1225message BluetoothEnabledStateChanged {
1226 repeated AttributionNode attribution_node = 1;
1227 // Whether or not bluetooth is enabled on the device.
1228 enum State {
1229 UNKNOWN = 0;
1230 ENABLED = 1;
1231 DISABLED = 2;
1232 }
1233 optional State state = 2;
1234 // The reason for being enabled/disabled.
1235 // Eg. Airplane mode, crash, application request.
1236 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1237 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001238 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001239}
1240
1241/**
1242 * Logs when a Bluetooth device connects and disconnects.
1243 *
1244 * Logged from:
1245 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1246 */
1247message BluetoothConnectionStateChanged {
1248 // The state of the connection.
1249 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1250 optional android.bluetooth.ConnectionStateEnum state = 1;
1251 // An identifier that can be used to match connect and disconnect events.
1252 // Currently is last two bytes of a hash of a device level ID and
1253 // the mac address of the bluetooth device that is connected.
1254 optional int32 obfuscated_id = 2;
1255 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1256 // From android.bluetooth.BluetoothAdapter.java
1257 optional int32 bt_profile = 3;
1258}
1259
1260/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001261 * Logs when something is plugged into or removed from the USB-C connector.
1262 *
1263 * Logged from:
1264 * Vendor USB HAL.
1265 */
1266message UsbConnectorStateChanged {
1267 enum State {
1268 DISCONNECTED = 0;
1269 CONNECTED = 1;
1270 }
1271 optional State state = 1;
1272}
1273
1274/**
1275 * Logs the reported speaker impedance.
1276 *
1277 * Logged from:
1278 * Vendor audio implementation.
1279 */
1280message SpeakerImpedanceReported {
1281 optional int32 speaker_location = 1;
1282 optional int32 impedance = 2;
1283}
1284
1285/**
1286 * Logs the report of a failed hardware.
1287 *
1288 * Logged from:
1289 * Vendor HALs.
1290 *
1291 */
1292message HardwareFailed {
1293 enum HardwareType {
1294 HARDWARE_FAILED_UNKNOWN = 0;
1295 HARDWARE_FAILED_MICROPHONE = 1;
1296 HARDWARE_FAILED_CODEC = 2;
1297 HARDWARE_FAILED_SPEAKER = 3;
1298 HARDWARE_FAILED_FINGERPRINT = 4;
1299 }
1300 optional HardwareType hardware_type = 1;
1301
1302 /* hardware_location allows vendors to differentiate between multiple instances of
1303 * the same hardware_type. The specific locations are vendor defined integers,
1304 * referring to board-specific numbering schemes.
1305 */
1306 optional int32 hardware_location = 2;
1307
1308 /* failure_code is specific to the HardwareType of the failed hardware.
1309 * It should use the enum values defined below.
1310 */
1311 enum MicrophoneFailureCode {
1312 MICROPHONE_FAILURE_COMPLETE = 0;
1313 }
1314 enum CodecFailureCode {
1315 CODEC_FAILURE_COMPLETE = 0;
1316 }
1317 enum SpeakerFailureCode {
1318 SPEAKER_FAILURE_COMPLETE = 0;
1319 SPEAKER_FAILURE_HIGH_Z = 1;
1320 SPEAKER_FAILURE_SHORT = 2;
1321 }
1322 enum FingerprintFailureCode {
1323 FINGERPRINT_FAILURE_COMPLETE = 0;
1324 FINGERPRINT_SENSOR_BROKEN = 1;
1325 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1326 }
1327 optional int32 failure_code = 3;
1328}
1329
1330/**
1331 * Log an event when the device has been physically dropped.
1332 * Reported from the /vendor partition.
1333 */
1334message PhysicalDropDetected {
1335 // Confidence that the event was actually a drop, 0 -> 100
1336 optional int32 confidence_pctg = 1;
1337 // Peak acceleration of the drop, in 1/1000s of a g.
1338 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001339 // Duration of freefall in ms
1340 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001341}
1342
1343/**
1344 * Log bucketed battery charge cycles.
1345 *
1346 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001347 * a given charge point. For example, if 10 cycle buckets are
1348 * initialized, bucket 1 is the lowest 1/10th of the battery,
1349 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001350 *
1351 * Logged from:
1352 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1353 */
1354message ChargeCyclesReported {
1355 optional int32 cycle_bucket_1 = 1;
1356 optional int32 cycle_bucket_2 = 2;
1357 optional int32 cycle_bucket_3 = 3;
1358 optional int32 cycle_bucket_4 = 4;
1359 optional int32 cycle_bucket_5 = 5;
1360 optional int32 cycle_bucket_6 = 6;
1361 optional int32 cycle_bucket_7 = 7;
1362 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001363 optional int32 cycle_bucket_9 = 9;
1364 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001365}
1366
1367/**
Howard Roa46b6582018-09-18 16:45:02 -07001368 * Log battery health snapshot.
1369 *
1370 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1371 * are snapshotted periodically over 24hrs.
1372 */
1373message BatteryHealthSnapshot {
1374 enum BatterySnapshotType {
1375 UNKNOWN = 0;
1376 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1377 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1378 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1379 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1380 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1381 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1382 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1383 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1384 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1385 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1386 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1387 }
1388 optional BatterySnapshotType type = 1;
1389 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001390 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001391 // Voltage Battery Voltage, in microVolts.
1392 optional int32 voltage_micro_volt = 3;
1393 // Current Battery current, in microAmps.
1394 optional int32 current_micro_amps = 4;
1395 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1396 optional int32 open_circuit_micro_volt = 5;
1397 // Resistance Battery Resistance, in microOhms.
1398 optional int32 resistance_micro_ohm = 6;
1399 // Level Battery Level, as % of full.
1400 optional int32 level_percent = 7;
1401}
1402
1403/**
1404 * Log slow I/O operations on the primary storage.
1405 */
1406message SlowIo {
1407 // Classifications of IO Operations.
1408 enum IoOperation {
1409 UNKNOWN = 0;
1410 READ = 1;
1411 WRITE = 2;
1412 UNMAP = 3;
1413 SYNC = 4;
1414 }
1415 optional IoOperation operation = 1;
1416
1417 // The number of slow IO operations of this type over 24 hours.
1418 optional int32 count = 2;
1419}
1420
1421/**
1422 * Log battery caused shutdown with the last recorded voltage.
1423 */
1424message BatteryCausedShutdown {
1425 // The last recorded battery voltage prior to shutdown.
1426 optional int32 last_recorded_micro_volt = 1;
1427}
1428
1429/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001430 * Logs the duration of a davey (jank of >=700ms) when it occurs
1431 *
1432 * Logged from:
1433 * frameworks/base/libs/hwui/JankTracker.cpp
1434 */
1435message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001436 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001437 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001438
Tej Singhbb8554a2018-01-26 11:59:14 -08001439 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001440 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001441}
1442
1443/**
Bookatze5885242017-10-24 20:10:31 -07001444 * Logs phone signal strength changes.
1445 *
1446 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001447 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001448 */
1449message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001450 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1451 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001452}
1453
Yangster4ccebea2018-10-09 17:09:02 -07001454
1455/**
1456 * Logs when the phone state, sim state or signal strength changes
1457 *
1458 * Logged from:
1459 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1460 */
1461message PhoneServiceStateChanged {
1462 optional android.telephony.ServiceStateEnum state = 1;
1463 optional android.telephony.SimStateEnum sim_state = 2;
1464 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1465}
1466
1467/**
1468 * Logs when the phone becomes on or off.
1469 *
1470 * Logged from:
1471 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1472 */
1473message PhoneStateChanged {
1474 enum State {
1475 OFF = 0;
1476 ON = 1;
1477 }
1478 optional State state = 1;
1479}
1480
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001481message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001482 optional android.stats.launcher.LauncherAction action = 1;
1483 optional android.stats.launcher.LauncherState src_state = 2;
1484 optional android.stats.launcher.LauncherState dst_state = 3;
1485 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001486 optional bool is_swipe_up_enabled = 5;
1487}
1488
David Chenc28b2bb2017-10-24 12:52:52 -07001489/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001490 * Logs when Settings UI has changed.
1491 *
1492 * Logged from:
1493 * packages/apps/Settings
1494 */
1495message SettingsUIChanged {
1496 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001497 * Where this SettingsUIChange event comes from. For example, if
1498 * it's a PAGE_VISIBLE event, where the page is opened from.
1499 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001500 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001501
1502 /**
1503 * What the UI action is.
1504 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001505 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001506
1507 /**
1508 * Where the action is happening
1509 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001510 optional android.app.settings.PageId pageId = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001511
1512 /**
1513 * What preference changed in this event.
1514 */
1515 optional string changedPreferenceKey = 4;
1516
1517 /**
1518 * The new value of the changed preference.
1519 */
1520 optional int64 changedPreferenceIntValue = 5;
1521}
1522
1523/**
David Chenc28b2bb2017-10-24 12:52:52 -07001524 * Logs that a setting was updated.
1525 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001526 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001527 * The tag and is_default allow resetting of settings to default values based on the specified
1528 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1529 */
1530message SettingChanged {
1531 // The name of the setting.
1532 optional string setting = 1;
1533
1534 // The change being imposed on this setting. May represent a number, eg "3".
1535 optional string value = 2;
1536
1537 // The new value of this setting. For most settings, this is same as value. For some settings,
1538 // value is +X or -X where X represents an element in a set. For example, if the previous value
1539 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1540 // The +/- feature is currently only used for location_providers_allowed.
1541 optional string new_value = 3;
1542
1543 // The previous value of this setting.
1544 optional string prev_value = 4;
1545
1546 // The tag used with the is_default for resetting sets of settings. This is generally null.
1547 optional string tag = 5;
1548
Bookatz90867622018-01-31 15:05:57 -08001549 // True if this setting with tag should be resettable.
1550 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001551
David Chenbd789912018-03-16 17:19:55 -07001552 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001553 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001554
1555 enum ChangeReason {
1556 UPDATED = 1; // Updated can be an insertion or an update.
1557 DELETED = 2;
1558 }
1559 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001560}
Chenjie Yub3dda412017-10-24 13:41:59 -07001561
Chenjie Yu05013b32017-11-21 10:21:41 -08001562/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001563 * Logs activity going to foreground or background
1564 *
1565 * Logged from:
1566 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1567 */
1568message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001569 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001570 optional string pkg_name = 2;
1571 optional string class_name = 3;
1572
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001573 enum State {
1574 BACKGROUND = 0;
1575 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001576 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001577 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001578}
David Chenc8a43242017-10-17 16:23:28 -07001579
1580/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001581 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001582 * Logged from:
1583 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1584 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001585message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001586 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001587
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001588 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001589
1590 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001591 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001592 optional string process_name = 3;
1593
1594 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001595 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001596
1597 optional string package_name = 5;
1598
1599 enum InstantApp {
1600 UNAVAILABLE = 0;
1601 FALSE = 1;
1602 TRUE = 2;
1603 }
1604 optional InstantApp is_instant_app = 6;
1605
1606 enum ForegroundState {
1607 UNKNOWN = 0;
1608 BACKGROUND = 1;
1609 FOREGROUND = 2;
1610 }
1611 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001612
1613 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001614}
David Chen9e3808c2017-11-20 17:25:34 -08001615
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001616/**
1617 * Logs when a WTF (What a Terrible Failure) happened.
1618 * Logged from:
1619 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1620 */
1621message WTFOccurred {
1622 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001623
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001624 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001625
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001626 // The name of the process.
1627 // system_server if it is not by an app
1628 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001629
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001630 // The pid if available. -1 means not available.
1631 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001632
1633 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001634}
1635
1636/**
1637 * Logs when system server reports low memory.
1638 * Logged from:
1639 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1640 */
1641message LowMemReported {
1642}
1643
1644/**
1645 * Logs when an app ANR (App Not Responding) occurs.
1646 * Logged from:
1647 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1648 */
1649message ANROccurred {
1650 optional int32 uid = 1 [(is_uid) = true];
1651
1652 optional string process_name = 2;
1653
1654 optional string short_component_name = 3;
1655
1656 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001657
1658 enum InstantApp {
1659 UNAVAILABLE = 0;
1660 FALSE = 1;
1661 TRUE = 2;
1662 }
1663 optional InstantApp is_instant_app = 5;
1664
1665 enum ForegroundState {
1666 UNKNOWN = 0;
1667 BACKGROUND = 1;
1668 FOREGROUND = 2;
1669 }
1670 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001671
1672 optional android.server.ErrorSource error_source = 7;
1673
1674 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001675}
1676
Bookatza7020bd2018-08-28 16:29:35 -07001677/**
1678 * Logs when the vibrator state changes.
1679 * Logged from:
1680 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1681 */
1682message VibratorStateChanged {
1683 repeated AttributionNode attribution_node = 1;
1684
1685 enum State {
1686 OFF = 0;
1687 ON = 1;
1688 }
1689 optional State state = 2;
1690
1691 // Duration (in milliseconds) requested to keep the vibrator on.
1692 // Only applicable for State == ON.
1693 optional int64 duration_millis = 3;
1694}
1695
David Chen0a368b22017-12-06 16:28:16 -08001696/*
1697 * Allows other apps to push events into statsd.
1698 * Logged from:
1699 * frameworks/base/core/java/android/util/StatsLog.java
1700 */
David Chen0b5c90c2018-01-25 16:51:49 -08001701message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001702 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001703 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001704
1705 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1706 optional int32 label = 2;
1707
1708 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1709 // predicates for the metrics).
1710 enum State {
1711 UNKNOWN = 0;
1712 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1713 STOP = 2;
1714 START = 3;
1715 }
1716 optional State state = 3;
1717}
1718
David Chen9e3808c2017-11-20 17:25:34 -08001719/**
Bookatz7948c872018-09-04 12:58:33 -07001720 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1721 * For example, this could be due to the user manually changing the time.
1722 *
1723 * Logged from:
1724 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1725 */
1726message WallClockTimeShifted {
1727 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1728 optional int64 wall_clock_timestamp_millis = 1;
1729}
1730
1731/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001732 * Logs when statsd detects an anomaly.
1733 *
1734 * Logged from:
1735 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1736 */
1737message AnomalyDetected {
1738 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001739 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001740
Yangster-mac94e197c2018-01-02 16:03:03 -08001741 // Id of the config whose anomaly detection alert fired.
1742 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001743
Yangster-mac94e197c2018-01-02 16:03:03 -08001744 // Id of the alert (i.e. name of the anomaly that was detected).
1745 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001746}
1747
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001748message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001749 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001750 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001751
1752 // The app package name.
1753 optional string pkg_name = 2;
1754
1755 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001756 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001757 WARM = 1;
1758 HOT = 2;
1759 COLD = 3;
1760 }
1761 // The transition type.
1762 optional TransitionType type = 3;
1763
1764 // The activity name.
1765 optional string activity_name = 4;
1766
1767 // The name of the calling app. Empty if not set.
1768 optional string calling_pkg_name = 5;
1769
1770 // Whether the app is an instant app.
1771 optional bool is_instant_app = 6;
1772
1773 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001774 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001775
Bookatz80d11a02018-01-16 10:46:35 -08001776 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001777
David Chen0b5c90c2018-01-25 16:51:49 -08001778 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001779 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001780 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001781 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001782 optional int32 bind_application_delay_millis = 11;
1783 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001784
1785 // Empty if not set.
1786 optional string launch_token = 13;
1787
Calin Juravle759fbda2018-02-20 19:52:30 +00001788 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001789 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001790
1791 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001792 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001793}
1794
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001795message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001796 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001797 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001798
1799 // The app package name.
1800 optional string pkg_name = 2;
1801
1802 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001803 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001804 WARM = 1;
1805 HOT = 2;
1806 COLD = 3;
1807 }
1808 // The transition type.
1809 optional TransitionType type = 3;
1810
1811 // The activity name.
1812 optional string activity_name = 4;
1813}
1814
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001815message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001816 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001817 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001818
1819 // The app package name.
1820 optional string pkg_name = 2;
1821
1822 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001823 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001824 WITH_BUNDLE = 1;
1825 WITHOUT_BUNDLE = 2;
1826 }
1827 // The transition type.
1828 optional TransitionType type = 3;
1829
1830 // The activity name.
1831 optional string activity_name = 4;
1832
1833 optional bool transition_process_running = 5;
1834
1835 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001836 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001837}
1838
Bookatz8fcd09a2017-12-18 13:01:10 -08001839/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001840 * Logs a picture-in-picture action
1841 * Logged from:
1842 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1843 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1844 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1845 */
1846message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001847 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001848 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001849
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001850 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001851
Chenjie Yu52cacc62017-12-08 18:11:45 -08001852 enum State {
1853 ENTERED = 1;
1854 EXPANDED_TO_FULL_SCREEN = 2;
1855 MINIMIZED = 3;
1856 DISMISSED = 4;
1857 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001858 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001859}
1860
1861/**
Chenjie Yue8904192017-12-08 19:12:57 -08001862 * Logs overlay action
1863 * Logged from:
1864 * services/core/java/com/android/server/wm/Session.java
1865 */
1866message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001867 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001868
1869 optional string package_name = 2;
1870
1871 optional bool using_alert_window = 3;
1872
1873 enum State {
1874 ENTERED = 1;
1875 EXITED = 2;
1876 }
1877 optional State state = 4;
1878}
1879
Chenjie Yuccfe6452018-01-30 11:33:21 -08001880/*
1881 * Logs foreground service starts and stops.
1882 * Note that this is not when a service starts or stops, but when it is
1883 * considered foreground.
1884 * Logged from
1885 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1886 */
1887message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001888 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001889 // package_name + "/" + class_name
1890 optional string short_name = 2;
1891
1892 enum State {
1893 ENTER = 1;
1894 EXIT = 2;
1895 }
1896 optional State state = 3;
1897}
1898
Chenjie Yue8904192017-12-08 19:12:57 -08001899/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001900 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1901 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1902 * attributed back to the parent (host) uid. One example is Chrome.
1903 *
1904 * Logged from:
1905 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1906 */
1907message IsolatedUidChanged {
1908 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001909 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001910 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001911 optional int32 parent_uid = 1;
1912
1913 optional int32 isolated_uid = 2;
1914
1915 // We expect an isolated uid to be removed before if it's used for another parent uid.
1916 enum Event {
1917 REMOVED = 0;
1918 CREATED = 1;
1919 }
1920 optional Event event = 3;
1921}
1922
1923/*
1924 * Logs the reception of an incoming network packet causing the main system to wake up for
1925 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1926 * and processed by WakeupController.cpp.
1927 */
1928message PacketWakeupOccurred {
1929 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1930 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001931 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001932 // The interface name on which the packet was received.
1933 optional string iface = 2;
1934 // The ethertype value of the packet.
1935 optional int32 ethertype = 3;
1936 // String representation of the destination MAC address of the packet.
1937 optional string destination_hardware_address = 4;
1938 // String representation of the source address of the packet if this was an IP packet.
1939 optional string source_ip = 5;
1940 // String representation of the destination address of the packet if this was an IP packet.
1941 optional string destination_ip = 6;
1942 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1943 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1944 // families.
1945 optional int32 ip_next_header = 7;
1946 // The source port if this was a TCP or UDP packet.
1947 optional int32 source_port = 8;
1948 // The destination port if this was a TCP or UDP packet.
1949 optional int32 destination_port = 9;
1950}
1951
1952/*
1953 * Logs the memory stats for an app on startup.
1954 * Logged from:
1955 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1956 */
1957message AppStartMemoryStateCaptured {
1958 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001959 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001960
1961 // The process name.
1962 optional string process_name = 2;
1963
1964 // The activity name.
1965 optional string activity_name = 3;
1966
1967 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001968 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001969
1970 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001971 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001972
1973 // RSS
1974 optional int64 rss_in_bytes = 6;
1975
1976 // CACHE
1977 optional int64 cache_in_bytes = 7;
1978
1979 // SWAP
1980 optional int64 swap_in_bytes = 8;
1981}
1982
1983/*
1984 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1985 * for LMK event.
1986 * Logged from:
1987 * system/core/lmkd/lmkd.c
1988 */
1989message LmkStateChanged {
1990 enum State {
1991 UNKNOWN = 0;
1992 START = 1;
1993 STOP = 2;
1994 }
1995 optional State state = 1;
1996}
1997
1998/*
1999 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2000 * Logged from:
2001 * system/core/lmkd/lmkd.c
2002 */
2003message LmkKillOccurred {
2004 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002005 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002006
2007 // The process name.
2008 optional string process_name = 2;
2009
2010 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002011 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002012
2013 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002014 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002015
2016 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002017 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002018
2019 // RSS
2020 optional int64 rss_in_bytes = 6;
2021
2022 // CACHE
2023 optional int64 cache_in_bytes = 7;
2024
2025 // SWAP
2026 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002027
2028 // The elapsed real time of start of the process.
2029 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002030}
2031
Rajeev Kumar51b54602018-03-01 12:18:26 -08002032/*
2033 * Logs when the ActivityManagerService detects that an app died.
2034 *
2035 * Logged from:
2036 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2037 */
2038message AppDied {
2039 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002040 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002041}
2042
Howard Ro21a039c2018-08-06 14:55:47 -07002043/**
2044 * An atom for generic metrics logging. Available from Android Q.
2045 */
2046message GenericAtom {
2047 // The uid of the application that sent this custom atom.
2048 optional int32 uid = 1 [(is_uid) = true];
2049
2050 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002051 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002052}
2053
Tej Singhd6d6d772018-09-05 17:41:25 -07002054/**
2055 * Logs when a fingerprint acquire event occurs.
2056 *
2057 * Logged from:
2058 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2059 */
2060message FingerprintAcquired {
2061 // The associated user. Eg: 0 for owners, 10+ for others.
2062 // Defined in android/os/UserHandle.java
2063 optional int32 user = 1;
2064 // If this acquire is for a crypto fingerprint.
2065 // e.g. Secure purchases, unlock password storage.
2066 optional bool is_crypto = 2;
2067}
2068
2069/**
2070 * Logs when a fingerprint authentication event occurs.
2071 *
2072 * Logged from:
2073 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2074 */
2075message FingerprintAuthenticated {
2076 // The associated user. Eg: 0 for owners, 10+ for others.
2077 // Defined in android/os/UserHandle.java
2078 optional int32 user = 1;
2079 // If this authentication is for a crypto fingerprint.
2080 // e.g. Secure purchases, unlock password storage.
2081 optional bool is_crypto = 2;
2082 // Whether or not this authentication was successful.
2083 optional bool is_authenticated = 3;
2084}
2085
2086/**
2087 * Logs when a fingerprint error occurs.
2088 *
2089 * Logged from:
2090 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2091 */
2092message FingerprintErrorOccurred {
2093 // The associated user. Eg: 0 for owners, 10+ for others.
2094 // Defined in android/os/UserHandle.java
2095 optional int32 user = 1;
2096 // If this error is for a crypto fingerprint.
2097 // e.g. Secure purchases, unlock password storage.
2098 optional bool is_crypto = 2;
2099
2100 enum Error {
2101 UNKNOWN = 0;
2102 LOCKOUT = 1;
2103 PERMANENT_LOCKOUT = 2;
2104 }
2105 // The type of error.
2106 optional Error error = 3;
2107}
Howard Ro688ae182018-09-25 00:09:36 -07002108
2109message Notification {
2110
2111 // Type of notification event.
2112 enum Type {
2113 TYPE_UNKNOWN = 0;
2114 // Notification became visible to the user.
2115 TYPE_OPEN = 1;
2116 // Notification became hidden.
2117 TYPE_CLOSE = 2;
2118 // Notification switched to detail mode.
2119 TYPE_DETAIL = 3;
2120 // Notification was clicked.
2121 TYPE_ACTION = 4;
2122 // Notification was dismissed.
2123 TYPE_DISMISS = 5;
2124 // Notification switched to summary mode. The enum value of 14 is to
2125 // match that of metrics_constants.
2126 TYPE_COLLAPSE = 14;
2127 }
2128 optional Type type = 1;
2129
2130 // Package name associated with the notification.
2131 optional string package_name = 2;
2132
2133 // Tag associated with notification.
2134 optional string tag = 3;
2135
2136 // Application-supplied ID associated with the notification.
2137 optional int32 id = 4;
2138
2139 // Index of notification in the notification panel.
2140 optional int32 shade_index = 5;
2141
2142 // The number of notifications in the notification panel.
2143 optional int32 shade_count = 6;
2144
2145 // Importance for the notification.
2146 optional int32 importance = 7;
2147
2148 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002149 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002150
2151 // Importance for the notification channel.
2152 optional int32 channel_importance = 9;
2153
Howard Ro183c2bd2018-10-18 13:52:10 -07002154 // Application-supplied ID associated with the notifications group.
2155 optional string group_id = 10;
2156
Howard Ro688ae182018-09-25 00:09:36 -07002157 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002158 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002159
Howard Ro183c2bd2018-10-18 13:52:10 -07002160 // Reason for dismissal of a notification. This field is only meaningful for
2161 // TYPE_DISMISS events.
2162 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002163
Howard Ro183c2bd2018-10-18 13:52:10 -07002164 // The first post time of notification, stable across updates.
2165 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002166
Howard Ro183c2bd2018-10-18 13:52:10 -07002167 // The most recent interruption time, or the creation time if no updates.
2168 // Differs from update_millis because updates are filtered based on whether
2169 // they actually interrupted the user.
2170 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002171
Howard Ro183c2bd2018-10-18 13:52:10 -07002172 // The most recent update time, or the creation time if no updates.
2173 optional int64 update_millis = 15;
2174
2175 // The most recent visibility event.
2176 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002177}
2178
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002179/*
Yangster-macb89807e2018-11-15 21:10:57 -08002180 * Logs when a flag flip state changes.
2181 * Logged in P/h.
2182 */
2183message PhenotypeFlagStateChanged {
2184 // Mendel configuration name.
2185 optional string mendel_config_name = 1;
2186 // State
2187 enum State {
2188 STATE_UNKNOWN = 0;
2189 COMMITTED = 1;
2190 }
2191 optional State state = 2;
2192}
2193
2194/*
2195 * Logs when a binary push state changes.
2196 * Logged in Play store
2197 */
2198message BinaryPushStateChanged {
2199 // Binary package name.
2200 optional string binary_name = 1;
2201 // Version code.
2202 optional int64 version = 2;
2203 // State
2204 enum State {
2205 STATE_UNKNOWN = 0;
2206 DOWNLOAD_START = 1;
2207 DOWNLOAD_DONE = 2;
2208 INSTALL_START = 3;
2209 INSTALL_DONE = 4;
2210 REBOOT_START = 5;
2211 REBOOT_DONE = 6;
2212 }
2213 optional State state = 3;
2214}
2215
2216/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002217 * Logs when a connection becomes available and lost.
2218 * Logged in StatsCompanionService.java
2219 */
2220message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002221 // Id of the network.
2222 optional int32 net_id = 1;
2223
2224 enum State {
2225 UNKNOWN = 0;
2226 CONNECTED = 1;
2227 DISCONNECTED = 2;
2228 }
2229 // Connected state of a network.
2230 optional State state = 2;
2231}
2232
2233/**
2234 * Logs when a service starts and stops.
2235 * Logged from:
2236 * services/core/java/com/android/server/am/ActiveServices.java
2237 */
2238message ServiceStateChanged {
2239
2240 optional int32 uid = 1 [(is_uid) = true];
2241
2242 optional string package_name = 2;
2243
2244 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002245
2246 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002247 START = 1;
2248 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002249 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002250
2251 optional State state = 4;
2252}
2253
2254/**
2255 * Logs when a service is launched.
2256 * Logged from:
2257 * services/core/java/com/android/server/am/ActiveServices.java
2258 */
2259message ServiceLaunchReported {
2260
2261 optional int32 uid = 1 [(is_uid) = true];
2262
2263 optional string package_name = 2;
2264
2265 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002266}
Howard Ro688ae182018-09-25 00:09:36 -07002267
Chenjie Yubbcbc602018-02-05 16:51:52 -08002268//////////////////////////////////////////////////////////////////////
2269// Pulled atoms below this line //
2270//////////////////////////////////////////////////////////////////////
2271
2272/**
David Chenc8a43242017-10-17 16:23:28 -07002273 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2274 *
2275 * Pulled from:
2276 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2277 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002278message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002279 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002280
2281 optional int64 rx_bytes = 2;
2282
2283 optional int64 rx_packets = 3;
2284
2285 optional int64 tx_bytes = 4;
2286
2287 optional int64 tx_packets = 5;
2288}
2289
2290/**
2291 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2292 *
2293 * Pulled from:
2294 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2295 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002296message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002297 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002298
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002299 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2300 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002301
2302 optional int64 rx_bytes = 3;
2303
2304 optional int64 rx_packets = 4;
2305
2306 optional int64 tx_bytes = 5;
2307
2308 optional int64 tx_packets = 6;
2309}
2310
2311/**
2312 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2313 *
2314 * Pulled from:
2315 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2316 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002317message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002318 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002319
2320 optional int64 rx_bytes = 2;
2321
2322 optional int64 rx_packets = 3;
2323
2324 optional int64 tx_bytes = 4;
2325
2326 optional int64 tx_packets = 5;
2327}
2328
2329/**
2330 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2331 *
2332 * Pulled from:
2333 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2334 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002335message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002336 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002337
Yao Chenc40a19d2018-03-15 16:48:25 -07002338 // 1 denotes foreground and 0 denotes background. This is called Set in
2339 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002340 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002341
2342 optional int64 rx_bytes = 3;
2343
2344 optional int64 rx_packets = 4;
2345
2346 optional int64 tx_bytes = 5;
2347
2348 optional int64 tx_packets = 6;
2349}
2350
2351/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002352 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2353 *
2354 * Pulled from:
2355 * StatsCompanionService
2356 */
2357message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002358 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002359
2360 optional int64 rx_bytes = 2;
2361
2362 optional int64 tx_bytes = 3;
2363}
2364
2365/**
David Chenc8a43242017-10-17 16:23:28 -07002366 * Pulls the kernel wakelock durations. This atom is adapted from
2367 * android/internal/os/KernelWakelockStats.java
2368 *
2369 * Pulled from:
2370 * StatsCompanionService using KernelWakelockReader.
2371 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002372message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002373 optional string name = 1;
2374
2375 optional int32 count = 2;
2376
2377 optional int32 version = 3;
2378
Yangster-maca8a30442018-10-13 23:46:34 -07002379 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002380}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002381
Chenjie Yu05013b32017-11-21 10:21:41 -08002382/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002383 * Pulls low power state information. This includes platform and subsystem sleep state information,
2384 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002385 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002386 * hardware/interfaces/power/1.1/types.hal
2387 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002388message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002389 // Subsystem name
2390 optional string subsystem_name = 1;
2391 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2392 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2393 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002394 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002395 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002396 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002397 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002398}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002399
Chenjie Yu05013b32017-11-21 10:21:41 -08002400/**
Bookatz92da2832018-11-01 18:10:03 -07002401 * Pulls on-device power measurement information.
2402 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2403 * Pulled from:
2404 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2405 */
2406message OnDevicePowerMeasurement {
2407 // Name of the subsystem (to which the rail belongs).
2408 optional string subsystem_name = 1;
2409
2410 // Rail name. The rail lies within the subsystem.
2411 optional string rail_name = 2;
2412
2413 // Time (in ms since boot) at which the rail energy value was measured.
2414 // This may differ slightly from the time that statsd logs this information.
2415 optional uint64 measurement_timestamp_millis = 3;
2416
2417 // Accumulated energy used via the rail since device boot in uWs.
2418 optional uint64 energy_microwatt_secs = 4;
2419}
2420
2421/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002422 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002423 * Pulls the time the cpu spend on the frequency index. Frequency index
2424 * starts from highest to lowest. The value should be monotonically
2425 * increasing since boot. However, if there is a cpu
2426 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002427 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002428message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002429 optional uint32 cluster = 1;
2430 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002431 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002432}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002433
Chenjie Yu05013b32017-11-21 10:21:41 -08002434/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002435 * Pulls Cpu Time Per Uid.
2436 * Note that isolated process uid time should be attributed to host uids.
2437 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002438message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002439 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002440 optional uint64 user_time_micros = 2;
2441 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002442}
2443
2444/**
2445 * Pulls Cpu Time Per Uid per frequency.
2446 * Note that isolated process uid time should be attributed to host uids.
2447 * For each uid, we order the time by descending frequencies.
2448 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002449message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002450 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002451 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002452 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002453}
Hugo Benichi884970e2017-11-14 22:42:46 +09002454
Chenjie Yu05013b32017-11-21 10:21:41 -08002455/**
2456 * Pulls Wifi Controller Activity Energy Info
2457 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002458message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002459 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002460 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002461 // stack reported state
2462 // TODO: replace this with proto enum
2463 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002464 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002465 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002466 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002467 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002468 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002469 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002470 // product of current(mA), voltage(V) and time(ms)
2471 optional uint64 controller_energy_used = 6;
2472}
2473
2474/**
2475 * Pulls Modem Activity Energy Info
2476 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002477message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002478 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002479 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002480 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002481 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002482 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002483 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002484 /**
2485 * Tx power index
2486 * index 0 = tx_power < 0dBm
2487 * index 1 = 0dBm < tx_power < 5dBm
2488 * index 2 = 5dBm < tx_power < 15dBm
2489 * index 3 = 15dBm < tx_power < 20dBm
2490 * index 4 = tx_power > 20dBm
2491 */
2492 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002493 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002494 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002495 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002496 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002497 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002498 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002499 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002500 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002501 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002502 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002503 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002504 // product of current(mA), voltage(V) and time(ms)
2505 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002506}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002507
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002508/**
2509 * Pulls Bluetooth Activity Energy Info
2510 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2511 */
2512message BluetoothActivityInfo {
2513 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002514 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002515 // bluetooth stack state
2516 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002517 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002518 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002519 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002520 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002521 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002522 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002523 // product of current(mA), voltage(V) and time(ms)
2524 optional uint64 energy_used = 6;
2525}
2526
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002527/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002528 * Logs the memory stats for a process.
2529 */
2530message ProcessMemoryState {
2531 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002532 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002533
2534 // The process name.
2535 optional string process_name = 2;
2536
2537 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002538 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002539
2540 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002541 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002542
2543 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002544 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002545
Rajeev Kumar90235992018-01-29 11:06:48 -08002546 // RSS
2547 optional int64 rss_in_bytes = 6;
2548
2549 // CACHE
2550 optional int64 cache_in_bytes = 7;
2551
2552 // SWAP
2553 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002554
Rafal Slawikd03ae422018-11-20 11:27:45 +00002555 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002556 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002557
2558 // Elapsed real time when the process started.
2559 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2560 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002561}
2562
2563/*
Rafal Slawik08621582018-10-15 14:53:07 +01002564 * Logs the memory stats for a native process (from procfs).
2565 */
2566message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002567 // The uid if available. -1 means not available.
2568 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002569
Rafal Slawikbf67d072018-10-23 11:07:54 +01002570 // The process name.
2571 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002572
Rafal Slawikbf67d072018-10-23 11:07:54 +01002573 // # of page-faults
2574 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002575
Rafal Slawikbf67d072018-10-23 11:07:54 +01002576 // # of major page-faults
2577 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002578
Rafal Slawikbf67d072018-10-23 11:07:54 +01002579 // RSS
2580 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002581
Rafal Slawikd03ae422018-11-20 11:27:45 +00002582 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002583 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002584
2585 // Elapsed real time when the process started.
2586 // Value is read from /proc/PID/stat, field 22.
2587 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002588}
2589
2590/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002591 * Logs the memory high-water mark for a process.
2592 * Recorded in ActivityManagerService.
2593 */
2594message ProcessMemoryHighWaterMark {
2595 // The uid if available. -1 means not available.
2596 optional int32 uid = 1 [(is_uid) = true];
2597
2598 // The process name. Provided by ActivityManagerService or read from /proc/PID/cmdline.
2599 optional string process_name = 2;
2600
2601 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2602 // /proc/PID/status.
2603 optional int64 rss_high_water_mark_in_bytes = 3;
2604}
2605
2606/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002607 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002608 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002609message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002610 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002611}
2612
2613/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002614 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002615 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002616message SystemUptime {
2617 // Milliseconds since the system was booted.
2618 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2619 // for external input).
2620 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002621 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002622}
2623
2624/*
2625 * Reads from /proc/uid_concurrent_active_time which has the format:
2626 * active: X (X is # cores)
2627 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2628 * [uid1]: [time-0] [time-1] [time-2] ... ...
2629 * ...
2630 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2631 * The file contains a monotonically increasing count of time for a single boot.
2632 */
2633message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002634 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002635 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002636}
2637
2638/**
2639 * Reads from /proc/uid_concurrent_policy_time which has the format:
2640 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2641 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2642 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2643 * ...
2644 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2645 * The file contains a monotonically increasing count of time for a single boot.
2646 */
2647message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002648 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002649 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002650 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002651}
2652
2653/*
2654 * Pulls free disk space, for data, system partition and temporary directory.
2655 */
2656message DiskSpace {
2657 // available bytes in data partition
2658 optional uint64 data_available_bytes = 1;
2659 // available bytes in system partition
2660 optional uint64 system_available_bytes = 2;
2661 // available bytes in download cache or temp directories
2662 optional uint64 temp_available_bytes = 3;
2663}
Tej Singhbf972d92018-01-10 20:51:13 -08002664
2665/**
2666 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002667 * Pulled from:
2668 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002669 */
2670message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002671 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002672}
2673
2674/**
2675 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002676 * Pulled from:
2677 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002678 */
2679message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002680 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002681}
2682
2683/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002684 * Pulls battery voltage.
2685 * Pulled from:
2686 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2687 */
2688message BatteryVoltage {
2689 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07002690 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07002691}
2692
2693/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08002694 * Pulls battery level (percent full, from 0 to 100).
2695 *
2696 * Pulled from:
2697 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2698 */
2699message BatteryLevel {
2700 // Battery level. Should be in [0, 100].
2701 optional int32 battery_level = 1;
2702}
2703
2704/**
Tej Singhd89137e2018-03-26 14:51:40 -07002705 * Pulls the temperature of various parts of the device.
2706 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002707 *
2708 * Pulled from:
2709 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2710 */
2711message Temperature {
2712 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2713 optional android.os.TemperatureTypeEnum sensor_location = 1;
2714
2715 // The name of the temperature source. Eg. CPU0
2716 optional string sensor_name = 2;
2717
Tej Singhd89137e2018-03-26 14:51:40 -07002718 // Temperature in tenths of a degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002719 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08002720}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002721
2722/**
2723 * Pulls the statistics of calls to Binder.
2724 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002725 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2726 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002727 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002728 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002729 */
2730message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002731 // UID of the process responsible for the binder transaction. It will be set if the process
2732 // executing the binder transaction attribute the transaction to another uid using
2733 // Binder.setThreadWorkSource().
2734 //
2735 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002736 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002737 // UID of the process executing the binder transaction.
2738 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002739 // Fully qualified class name of the API call.
2740 //
2741 // This is a system server class name.
2742 //
2743 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2744 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2745 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2746 // commonly used APIs.
2747 optional string service_class_name = 2;
2748 // Method name of the API call. It can also be a transaction code if we cannot
2749 // resolve it to a name. See Binder#getTransactionName.
2750 //
2751 // This is a system server method name.
2752 optional string service_method_name = 3;
2753 // Total number of API calls.
2754 optional int64 call_count = 4;
2755 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2756 optional bool screen_interactive = 13;
2757 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2758 // call_count will be equal to recorded_call_count.
2759 //
2760 // If recorded_call_count is different than call_count, it means data collection has been
2761 // sampled. All the fields below will be sampled in this case.
2762 optional int64 recorded_call_count = 12;
2763 // Number of exceptions thrown by the API.
2764 optional int64 recorded_exception_count = 5;
2765 // Total latency of all API calls.
2766 // Average can be computed using total_latency_micros / recorded_call_count.
2767 optional int64 recorded_total_latency_micros = 6;
2768 // Maximum latency of one API call.
2769 optional int64 recorded_max_latency_micros = 7;
2770 // Total CPU usage of all API calls.
2771 // Average can be computed using total_cpu_micros / recorded_call_count.
2772 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2773 optional int64 recorded_total_cpu_micros = 8;
2774 // Maximum CPU usage of one API call.
2775 optional int64 recorded_max_cpu_micros = 9;
2776 // Maximum parcel reply size of one API call.
2777 optional int64 recorded_max_reply_size_bytes = 10;
2778 // Maximum parcel request size of one API call.
2779 optional int64 recorded_max_request_size_bytes = 11;
2780}
2781
2782/**
2783 * Pulls the statistics of exceptions during calls to Binder.
2784 *
2785 * Binder stats are cumulative from boot unless somebody reset the data using
2786 * > adb shell dumpsys binder_calls_stats --reset
2787 */
2788message BinderCallsExceptions {
2789 // Exception class name, e.g. java.lang.IllegalArgumentException.
2790 //
2791 // This is an exception class name thrown by the system server.
2792 optional string exception_class_name = 1;
2793 // Total number of exceptions.
2794 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002795}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002796
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002797/**
2798 * Pulls the statistics of message dispatching on HandlerThreads.
2799 *
2800 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2801 * config on the device.
2802 *
2803 * Next tag: 11
2804 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002805message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002806 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002807 optional int32 uid = 1 [(is_uid) = true];
2808
2809 // Fully qualified class name of the handler target class.
2810 //
2811 // This field does not contain PII. This is a system server class name.
2812 optional string handler_class_name = 2;
2813
2814 // The name of the thread that runs the Looper.
2815 //
2816 // This field does not contain PII. This is a system server thread name.
2817 optional string looper_thread_name = 3;
2818
2819 // The name of the dispatched message.
2820 //
2821 // This field does not contain PII. This is a system server constant or class
2822 // name.
2823 optional string message_name = 4;
2824
2825 // Total number of successfully dispatched messages.
2826 optional int64 message_count = 5;
2827
2828 // Total number of messages that failed dispatching.
2829 optional int64 exception_count = 6;
2830
2831 // Total number of processed messages we have data recorded for. If we
2832 // collected data for all the messages, message_count will be equal to
2833 // recorded_message_count.
2834 //
2835 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002836 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002837 optional int64 recorded_message_count = 7;
2838
2839 // Total latency of all processed messages.
2840 // Average can be computed using recorded_total_latency_micros /
2841 // recorded_message_count.
2842 optional int64 recorded_total_latency_micros = 8;
2843
2844 // Total CPU usage of all processed message.
2845 // Average can be computed using recorded_total_cpu_micros /
2846 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002847 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002848 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002849
2850 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2851 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002852
2853 // Max recorded CPU usage of all processed messages.
2854 optional int64 recorded_max_cpu_micros = 11;
2855
2856 // Max recorded latency of all processed messages.
2857 optional int64 recorded_max_latency_micros = 12;
2858
2859 // Total number of messages we tracked the dispatching delay for. If we
2860 // collected data for all the messages, message_count will be equal to
2861 // recorded_delay_message_count.
2862 //
2863 // If recorded_delay_message_count is different than message_count, it means data
2864 // collection has been sampled or/and not all messages specified the target dispatch time.
2865 // The fields below will be sampled in this case.
2866 optional int64 recorded_delay_message_count = 13;
2867
2868 // Total dispatching delay of all processed messages.
2869 // Calculated as a difference between the target dispatching time (Message.when)
2870 // and the actual dispatching time.
2871 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
2872 optional int64 recorded_total_delay_millis = 14;
2873
2874 // Max dispatching delay of all processed messages.
2875 // Calculated as a difference between the target dispatching time (Message.when)
2876 // and the actual dispatching time.
2877 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002878}
Tej Singh86dc9db2018-09-06 00:39:57 +00002879
2880/**
2881 * Pulls disk information, such as write speed and latency.
2882 */
2883message DiskStats {
2884 // Time taken to open, write 512B to, and close a file.
2885 // -1 if error performing the check.
2886 optional int64 data_write_latency_millis = 1;
2887
2888 optional bool file_based_encryption = 2;
2889
2890 // Recent disk write speed in kB/s.
2891 // -1 if error querying storageed.
2892 // 0 if data is unavailable.
2893 optional int32 recent_disk_write_speed = 3;
2894}
2895
2896
2897/**
2898 * Free and total bytes of the Data, Cache, and System partition.
2899 */
2900message DirectoryUsage {
2901 enum Directory {
2902 UNKNOWN = 0;
2903 DATA = 1;
2904 CACHE = 2;
2905 SYSTEM = 3;
2906 }
2907 optional Directory directory = 1;
2908 optional int64 free_bytes = 2;
2909 optional int64 total_bytes = 3;
2910}
2911
2912
2913/**
2914 * Size of an application: apk size, data size, and cache size.
2915 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2916 * Information is only reported for apps with the primary user (user 0).
2917 * Sizes are aggregated by package name.
2918 */
2919message AppSize {
2920 // Including uids will involve modifying diskstats logic.
2921 optional string package_name = 1;
2922 // App size in bytes. -1 if unavailable.
2923 optional int64 app_size_bytes = 2;
2924 // App data size in bytes. -1 if unavailable.
2925 optional int64 app_data_size_bytes = 3;
2926 // App cache size in bytes. -1 if unavailable.
2927 optional int64 app_cache_size_bytes = 4;
2928 // Time that the cache file was produced.
2929 // Uses System.currentTimeMillis(), which is wall clock time.
2930 optional int64 cache_time_millis = 5;
2931}
2932
2933
2934/**
2935 * Size of a particular category. Eg: photos, videos.
2936 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2937 */
2938message CategorySize {
2939 enum Category {
2940 UNKNOWN = 0;
2941 APP_SIZE = 1;
2942 APP_DATA_SIZE = 2;
2943 APP_CACHE_SIZE = 3;
2944 PHOTOS = 4;
2945 VIDEOS = 5;
2946 AUDIO = 6;
2947 DOWNLOADS = 7;
2948 SYSTEM = 8;
2949 OTHER = 9;
2950 }
2951 optional Category category = 1;
2952 // Category size in bytes.
2953 optional int64 size_bytes = 2;
2954 // Time that the cache file was produced.
2955 // Uses System.currentTimeMillis(), which is wall clock time.
2956 optional int64 cache_time_millis = 3;
2957}
Tej Singhd6d6d772018-09-05 17:41:25 -07002958
2959/**
Tej Singhe7726dc2018-09-21 11:42:12 -07002960 * Pulls per uid I/O stats. The stats are cumulative since boot.
2961 *
2962 * Read/write bytes are I/O events from a storage device
2963 * Read/write chars are data requested by read/write syscalls, and can be
2964 * satisfied by caching.
2965 *
2966 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
2967 */
2968message DiskIo {
2969 optional int32 uid = 1 [(is_uid) = true];
2970 optional int64 fg_chars_read = 2;
2971 optional int64 fg_chars_write = 3;
2972 optional int64 fg_bytes_read = 4;
2973 optional int64 fg_bytes_write = 5;
2974 optional int64 bg_chars_read = 6;
2975 optional int64 bg_chars_write = 7;
2976 optional int64 bg_bytes_read = 8;
2977 optional int64 bg_bytes_write = 9;
2978 optional int64 fg_fsync = 10;
2979 optional int64 bg_fsync= 11;
2980}
2981
2982
2983/**
Tej Singhd6d6d772018-09-05 17:41:25 -07002984 * Pulls the number of fingerprints for each user.
2985 *
2986 * Pulled from StatsCompanionService, which queries FingerprintManager.
2987 */
2988message NumFingerprints {
2989 // The associated user. Eg: 0 for owners, 10+ for others.
2990 // Defined in android/os/UserHandle.java
2991 optional int32 user = 1;
2992 // Number of fingerprints registered to that user.
2993 optional int32 num_fingerprints = 2;
2994}
Chenjie Yu12e5e672018-09-14 15:54:59 -07002995
Yangsteraf9aee72018-10-12 09:26:16 -07002996message AggStats {
2997 optional int64 min = 1;
2998
2999 optional int64 average = 2;
3000
3001 optional int64 max = 3;
3002}
3003
3004message ProcessStatsStateProto {
3005 optional android.service.procstats.ScreenState screen_state = 1;
3006
3007 optional android.service.procstats.MemoryState memory_state = 2;
3008
3009 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3010 // and not frameworks/base/core/java/android/app/ActivityManager.java
3011 optional android.service.procstats.ProcessState process_state = 3;
3012
3013 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003014 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003015
3016 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003017 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003018
3019 // # of samples taken
3020 optional int32 sample_size = 5;
3021
3022 // PSS is memory reserved for this process
3023 optional AggStats pss = 6;
3024
3025 // USS is memory shared between processes, divided evenly for accounting
3026 optional AggStats uss = 7;
3027
3028 // RSS is memory resident for this process
3029 optional AggStats rss = 8;
3030}
3031
3032// Next Tag: 7
3033message ProcessStatsProto {
3034 // Name of process.
3035 optional string process = 1;
3036
3037 // Uid of the process.
3038 optional int32 uid = 2;
3039
3040 // Information about how often kills occurred
3041 message Kill {
3042 // Count of excessive CPU kills
3043 optional int32 cpu = 1;
3044
3045 // Count of kills when cached
3046 optional int32 cached = 2;
3047
3048 // PSS stats during cached kill
3049 optional AggStats cached_pss = 3;
3050 }
3051 optional Kill kill = 3;
3052
3053 // Time and memory spent in various states.
3054 repeated ProcessStatsStateProto states = 5;
3055
3056 // Total time process has been running... screen_state, memory_state, and process_state
3057 // will not be set.
3058 optional ProcessStatsStateProto total_running_state = 6;
3059}
3060
3061message PackageServiceOperationStatsProto {
3062 // Operate enum: Started, Foreground, Bound, Executing
3063 optional android.service.procstats.ServiceOperationState operation = 1;
3064
3065 // Number of times the service was in this operation.
3066 optional int32 count = 2;
3067
3068 // Information about a state the service can be in.
3069 message StateStats {
3070 // Screen state enum.
3071 optional android.service.procstats.ScreenState screen_state = 1;
3072 // Memory state enum.
3073 optional android.service.procstats.MemoryState memory_state = 2;
3074
3075 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003076 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003077 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003078 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003079 }
3080 repeated StateStats state_stats = 3;
3081}
3082
3083message PackageServiceStatsProto {
3084 // Name of service component.
3085 optional string service_name = 1;
3086
3087 // The operation stats.
3088 // The package_name, package_uid, package_version, service_name will not be set to save space.
3089 repeated PackageServiceOperationStatsProto operation_stats = 2;
3090}
3091
3092message PackageAssociationSourceProcessStatsProto {
3093 // Uid of the process.
3094 optional int32 process_uid = 1;
3095 // Process name.
3096 optional string process_name = 2;
3097
3098 // Total count of the times this association appeared.
3099 optional int32 total_count = 3;
3100
3101 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003102 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003103
3104 // Total count of the times this association became actively impacting its target process.
3105 optional int32 active_count = 5;
3106
3107 // Information on one source in this association.
3108 message StateStats {
3109 // Process state enum.
3110 optional android.service.procstats.ProcessState process_state = 1;
3111 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003112 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003113 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003114 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003115 }
3116 repeated StateStats active_state_stats = 6;
3117}
3118
3119message PackageAssociationProcessStatsProto {
3120 // Name of the target component.
3121 optional string component_name = 1;
3122 // Information on one source in this association.
3123 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3124}
3125
3126
3127message ProcessStatsPackageProto {
3128 // Name of package.
3129 optional string package = 1;
3130
3131 // Uid of the package.
3132 optional int32 uid = 2;
3133
3134 // Version of the package.
3135 optional int64 version = 3;
3136
3137 // Stats for each process running with the package loaded in to it.
3138 repeated ProcessStatsProto process_stats = 4;
3139
3140 // Stats for each of the package's services.
3141 repeated PackageServiceStatsProto service_stats = 5;
3142
3143 // Stats for each association with the package.
3144 repeated PackageAssociationProcessStatsProto association_stats = 6;
3145}
3146
3147message ProcessStatsSectionProto {
3148 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003149 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003150
3151 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003152 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003153
3154 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003155 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003156
3157 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003158 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003159
3160 // System runtime library. e.g. "libdvm.so", "libart.so".
3161 optional string runtime = 5;
3162
3163 // whether kernel reports swapped pss.
3164 optional bool has_swapped_pss = 6;
3165
3166 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3167 enum Status {
3168 STATUS_UNKNOWN = 0;
3169 STATUS_COMPLETE = 1;
3170 STATUS_PARTIAL = 2;
3171 STATUS_SHUTDOWN = 3;
3172 STATUS_SYSPROPS = 4;
3173 }
3174 repeated Status status = 7;
3175
3176 // Stats for each process.
3177 repeated ProcessStatsProto process_stats = 8;
3178
3179 // Stats for each package.
3180 repeated ProcessStatsPackageProto package_stats = 9;
3181}
3182
Chenjie Yu12e5e672018-09-14 15:54:59 -07003183/**
3184 * Pulled from ProcessStatsService.java
3185 */
3186message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003187 optional ProcessStatsSectionProto proc_stats_section = 1;
3188}
3189
3190message PowerProfileProto {
3191 optional double cpu_suspend = 1;
3192
3193 optional double cpu_idle = 2;
3194
3195 optional double cpu_active = 3;
3196
3197 message CpuCluster {
3198 optional int32 id = 1;
3199 optional double cluster_power = 2;
3200 optional int32 cores = 3;
3201 repeated int64 speed = 4;
3202 repeated double core_power = 5;
3203 }
3204
3205 repeated CpuCluster cpu_cluster = 40;
3206
3207 optional double wifi_scan = 4;
3208
3209 optional double wifi_on = 5;
3210
3211 optional double wifi_active = 6;
3212
3213 optional double wifi_controller_idle = 7;
3214
3215 optional double wifi_controller_rx = 8;
3216
3217 optional double wifi_controller_tx = 9;
3218
3219 repeated double wifi_controller_tx_levels = 10;
3220
3221 optional double wifi_controller_operating_voltage = 11;
3222
3223 optional double bluetooth_controller_idle = 12;
3224
3225 optional double bluetooth_controller_rx = 13;
3226
3227 optional double bluetooth_controller_tx = 14;
3228
3229 optional double bluetooth_controller_operating_voltage = 15;
3230
3231 optional double modem_controller_sleep = 16;
3232
3233 optional double modem_controller_idle = 17;
3234
3235 optional double modem_controller_rx = 18;
3236
3237 repeated double modem_controller_tx = 19;
3238
3239 optional double modem_controller_operating_voltage = 20;
3240
3241 optional double gps_on = 21;
3242
3243 repeated double gps_signal_quality_based = 22;
3244
3245 optional double gps_operating_voltage = 23;
3246
3247 optional double bluetooth_on = 24;
3248
3249 optional double bluetooth_active = 25;
3250
3251 optional double bluetooth_at_cmd = 26;
3252
3253 optional double ambient_display = 27;
3254
3255 optional double screen_on = 28;
3256
3257 optional double radio_on = 29;
3258
3259 optional double radio_scanning = 30;
3260
3261 optional double radio_active = 31;
3262
3263 optional double screen_full = 32;
3264
3265 optional double audio = 33;
3266
3267 optional double video = 34;
3268
3269 optional double flashlight = 35;
3270
3271 optional double memory = 36;
3272
3273 optional double camera = 37;
3274
3275 optional double wifi_batched_scan = 38;
3276
3277 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003278}
Chenjie Yuab530202018-09-26 12:39:20 -07003279
3280/**
3281 * power_profile.xml and other constants for power model calculations.
3282 * Pulled from PowerProfile.java
3283 */
3284message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003285 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003286}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003287
3288/**
arangelovd5db50e2018-10-12 20:24:39 +01003289 * Logs when a user restriction was added or removed.
3290 *
3291 * Logged from:
3292 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3293 */
3294message UserRestrictionChanged {
3295 // The raw string of the user restriction as defined in UserManager.
3296 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3297 optional string restriction = 1;
3298 // Whether the restriction is enabled or disabled.
3299 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003300}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003301
3302/**
3303 * Pulls process user time and system time. Puller takes a snapshot of all pids
3304 * in the system and returns cpu stats for those that are working at the time.
3305 * Dead pids will be dropped. Kernel processes are excluded.
3306 * Min cool-down is 5 sec.
3307 */
3308message ProcessCpuTime {
3309 optional int32 uid = 1 [(is_uid) = true];
3310
3311 optional string process_name = 2;
3312 // Process cpu time in user space, cumulative from boot/process start
3313 optional int64 user_time_millis = 3;
3314 // Process cpu time in system space, cumulative from boot/process start
3315 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003316}
Misha Wagner5a51e002018-10-03 15:04:09 +01003317
3318/**
3319 * Pulls the CPU usage for each thread.
3320 *
3321 * Read from /proc/$PID/task/$TID/time_in_state files.
3322 *
3323 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3324 * time_in_state files not being present on some phones, have not been addressed. These should be
3325 * considered before a public release.
3326 */
3327message CpuTimePerThreadFreq {
3328 // UID that owns the process.
3329 optional int32 uid = 1 [(is_uid) = true];
3330 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003331 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003332 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003333 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003334 // Name of the process taken from `/proc/$PID/cmdline`.
3335 optional string process_name = 4;
3336 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3337 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003338
3339 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3340 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3341 // frequencies are given here as the alternative is sending eight separate atoms. This method
3342 // significantly reduces the amount of data created
3343 optional int32 frequency1_khz = 6;
3344 optional int32 time1_millis = 7;
3345 optional int32 frequency2_khz = 8;
3346 optional int32 time2_millis = 9;
3347 optional int32 frequency3_khz = 10;
3348 optional int32 time3_millis = 11;
3349 optional int32 frequency4_khz = 12;
3350 optional int32 time4_millis = 13;
3351 optional int32 frequency5_khz = 14;
3352 optional int32 time5_millis = 15;
3353 optional int32 frequency6_khz = 16;
3354 optional int32 time6_millis = 17;
3355 optional int32 frequency7_khz = 18;
3356 optional int32 time7_millis = 19;
3357 optional int32 frequency8_khz = 20;
3358 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003359}
Bookatz75ee6042018-11-09 12:27:37 -08003360
3361/**
Bookatz366a4432018-11-20 09:42:33 -08003362 * Pulls information about the device's build.
3363 */
3364message BuildInformation {
3365 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3366 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3367 optional string fingerprint = 1;
3368
3369 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3370 optional string brand = 2;
3371
3372 // Build.PRODUCT. The name of the overall product.
3373 optional string product = 3;
3374
3375 // Build.DEVICE. The name of the industrial design.
3376 optional string device = 4;
3377
3378 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3379 optional string version_release = 5;
3380
3381 // Build.ID. E.g. a label like "M4-rc20".
3382 optional string id = 6;
3383
3384 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3385 // represent this build.
3386 optional string version_incremental = 7;
3387
3388 // Build.TYPE. The type of build, like "user" or "eng".
3389 optional string type = 8;
3390
3391 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3392 optional string tags = 9;
3393}
3394
3395/**
Bookatz75ee6042018-11-09 12:27:37 -08003396 * Pulls on-device BatteryStats power use calculations for the overall device.
3397 */
3398message DeviceCalculatedPowerUse {
3399 // Power used by the device in mAh, as computed by BatteryStats, since BatteryStats last reset
3400 // (i.e. roughly since device was last significantly charged).
3401 // Currently, this is BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3402 optional float computed_power_milli_amp_hours = 1;
3403}
3404
3405/**
3406 * Pulls on-device BatteryStats power use calculations broken down by uid.
3407 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3408 * that is attributed to non-uid items. They must all be included to get the total power use.
3409 */
3410message DeviceCalculatedPowerBlameUid {
3411 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3412 optional int32 uid = 1 [(is_uid) = true];
3413
3414 // Power used by this uid in mAh, as computed by BatteryStats, since BatteryStats last reset
3415 // (i.e. roughly since device was last significantly charged).
3416 optional float power_milli_amp_hours = 2;
3417}
3418
3419/**
3420 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3421 * drain type.
3422 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3423 * is attributed uids. They must all be included to get the total power use.
3424 */
3425message DeviceCalculatedPowerBlameOther {
3426 // The type of item whose power use is being reported.
3427 enum DrainType {
3428 AMBIENT_DISPLAY = 0;
3429 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3430 BLUETOOTH = 2;
3431 CAMERA = 3;
3432 // Cell-standby
3433 CELL = 4;
3434 FLASHLIGHT = 5;
3435 IDLE = 6;
3436 MEMORY = 7;
3437 // Amount that total computed drain exceeded the drain estimated using the
3438 // battery level changes and capacity.
3439 OVERCOUNTED = 8;
3440 PHONE = 9;
3441 SCREEN = 10;
3442 // Amount that total computed drain was below the drain estimated using the
3443 // battery level changes and capacity.
3444 UNACCOUNTED = 11;
3445 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3446 WIFI = 13;
3447 }
3448 optional DrainType drain_type = 1;
3449
3450 // Power used by this item in mAh, as computed by BatteryStats, since BatteryStats last reset
3451 // (i.e. roughly since device was last significantly charged).
3452 optional float power_milli_amp_hours = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003453}
arangelov4e994062018-11-13 16:12:38 +00003454
3455/**
3456 * Logs device policy features.
3457 *
3458 * Logged from:
3459 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3460 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3461 */
3462message DevicePolicyEvent {
3463 // The event id - unique for each event.
3464 optional android.stats.devicepolicy.EventId event_id = 1;
3465 // The admin package name.
3466 optional string admin_package_name = 2;
3467 // A generic integer parameter.
3468 optional int32 integer_value = 3;
3469 // A generic boolean parameter.
3470 optional bool boolean_value = 4;
3471 // A parameter specifying a time period in milliseconds.
3472 optional uint64 time_period_millis = 5;
3473 // A parameter specifying a list of package names, bundle extras or string parameters.
3474 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3475}