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