blob: 448608e9ece7cef389d0563fe01b032c0f1f7a7f [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";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080026import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080027import "frameworks/base/core/proto/android/os/enums.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080028import "frameworks/base/core/proto/android/server/enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080029import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080030import "frameworks/base/core/proto/android/telephony/enums.proto";
31import "frameworks/base/core/proto/android/view/enums.proto";
Howard Ro0546d542018-08-30 16:23:44 -070032import "frameworks/base/proto/src/stats_enums.proto";
Chenjie Yu159e4f82018-08-29 11:49:11 -070033import "frameworks/base/core/proto/android/service/procstats.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080034
Yao Chend54f9dd2017-10-17 17:37:48 +000035/**
Stefan Lafonae2df012017-11-14 09:17:21 -080036 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000037 * raw stats log events from the Android system, also known as "atoms."
38 *
39 * This field contains a single oneof with all of the available messages.
40 * The stats-log-api-gen tool runs as part of the Android build and
41 * generates the android.util.StatsLog class, which contains the constants
42 * and methods that Android uses to log.
43 *
Stefan Lafonae2df012017-11-14 09:17:21 -080044 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000045 * Instead, statsd on Android constructs these messages synthetically,
46 * in the format defined here and in stats_log.proto.
47 */
Stefan Lafonae2df012017-11-14 09:17:21 -080048message Atom {
49 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070050 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070051 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
52 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070053 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070054 BleScanResultReceived ble_scan_result_received = 4;
55 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080056 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070057 SyncStateChanged sync_state_changed = 7;
58 ScheduledJobStateChanged scheduled_job_state_changed = 8;
59 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070060 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080061 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
62 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
63 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070064 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
65 MemoryFactorStateChanged memory_factor_state_changed = 15;
66 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
67 CachedKillReported cached_kill_reported = 17;
68 ProcessMemoryStatReported process_memory_stat_reported = 18;
69 // 19 is available
Bookatzddccf0a2017-11-28 16:48:14 -080070 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
71 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
72 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070073 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080074 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070075 CameraStateChanged camera_state_changed = 25;
76 FlashlightStateChanged flashlight_state_changed = 26;
77 UidProcessStateChanged uid_process_state_changed = 27;
78 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
79 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070080 BatteryLevelChanged battery_level_changed = 30;
81 ChargingStateChanged charging_state_changed = 31;
82 PluggedStateChanged plugged_state_changed = 32;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080083 // 33 - 34 are available
Bookatz8c6571b2017-10-24 15:04:41 -070084 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
85 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070086 WifiLockStateChanged wifi_lock_state_changed = 37;
87 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
88 WifiScanStateChanged wifi_scan_state_changed = 39;
89 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070090 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070091 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070092 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090093 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -070094 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -080095 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080096 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080097 AppStartOccurred app_start_occurred = 48;
98 AppStartCanceled app_start_canceled = 49;
99 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800100 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800101 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800102 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800103 LmkStateChanged lmk_state_changed = 54;
104 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800105 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800106 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800107 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800108 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800109 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800110 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800111 KeyguardStateChanged keyguard_state_changed = 62;
112 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
113 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800114 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800115 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800116 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
117 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Tej Singh02200f92018-04-02 19:37:59 -0700118 // 69 is blank but need not be.
Andrew Chantb56388b2018-03-22 21:07:33 -0700119 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800120 SpeakerImpedanceReported speaker_impedance_reported = 71;
121 HardwareFailed hardware_failed = 72;
122 PhysicalDropDetected physical_drop_detected = 73;
123 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800124 MobileConnectionStateChanged mobile_connection_state_changed = 75;
125 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700126 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800127 AppCrashOccurred app_crash_occurred = 78;
128 ANROccurred anr_occurred = 79;
129 WTFOccurred wtf_occurred = 80;
130 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700131 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700132 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700133 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700134 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700135 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700136 FingerprintAcquired fingerprint_acquired = 87;
137 FingerprintAuthenticated fingerprint_authenticated = 88;
138 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700139 Notification notification = 90;
Yao Chend54f9dd2017-10-17 17:37:48 +0000140 }
David Chenc8a43242017-10-17 16:23:28 -0700141
David Chen6e3e6cb2018-01-03 16:14:06 -0800142 // Pulled events will start at field 10000.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100143 // Next: 10025
David Chenc8a43242017-10-17 16:23:28 -0700144 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800145 WifiBytesTransfer wifi_bytes_transfer = 10000;
146 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
147 MobileBytesTransfer mobile_bytes_transfer = 10002;
148 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800149 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800150 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800151 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800152 CpuTimePerFreq cpu_time_per_freq = 10008;
153 CpuTimePerUid cpu_time_per_uid = 10009;
154 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800155 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800156 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800157 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800158 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800159 SystemElapsedRealtime system_elapsed_realtime = 10014;
160 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800161 CpuActiveTime cpu_active_time = 10016;
162 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000163 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800164 RemainingBatteryCapacity remaining_battery_capacity = 10019;
165 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800166 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100167 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100168 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100169 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000170 DiskStats disk_stats = 10025;
171 DirectoryUsage directory_usage = 10026;
172 AppSize app_size = 10027;
173 CategorySize category_size = 10028;
Bookatz17f0d8a2018-09-13 12:56:32 -0700174 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700175 NumFingerprints num_fingerprints = 10031;
Chenjie Yu12e5e672018-09-14 15:54:59 -0700176 ProcStats proc_stats = 10029;
David Chenc8a43242017-10-17 16:23:28 -0700177 }
yroa1fe77c2018-02-26 14:22:54 -0800178
Bookatz76aafcf2018-09-17 16:17:10 -0700179 // DO NOT USE field numbers above 100,000 in AOSP.
180 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
181 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700182}
183
Yao Chend54f9dd2017-10-17 17:37:48 +0000184/**
Yangster-mac20877162017-12-22 17:19:39 -0800185 * This proto represents a node of an attribution chain.
186 * Note: All attribution chains are represented as a repeated field of type
187 * AttributionNode. It is understood that in such arrays, the order is that
188 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000189 */
Yangster-mac20877162017-12-22 17:19:39 -0800190message AttributionNode {
191 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800192 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800193
Yangster-mac20877162017-12-22 17:19:39 -0800194 // The (optional) string tag for an element in the attribution chain. If the
195 // element has no tag, it is encoded as an empty string.
196 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700197}
198
Yangster-mac48b3d622018-08-18 12:38:11 -0700199message KeyValuePair {
200 optional int32 key = 1;
201 oneof value {
202 int64 value_int = 2;
203 string value_str = 3;
204 float value_float = 4;
205 }
206}
207
208message KeyValuePairsAtom {
209 optional int32 uid = 1;
210 repeated KeyValuePair pairs = 2;
211}
212
Yao Chend54f9dd2017-10-17 17:37:48 +0000213/*
214 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800215 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000216 *
217 * RULES:
218 * - The field ids for each atom must start at 1, and count upwards by 1.
219 * Skipping field ids is not allowed.
220 * - These form an API, so renaming, renumbering or removing fields is
221 * not allowed between android releases. (This is not currently enforced,
222 * but there will be a tool to enforce this restriction).
223 * - The types must be built-in protocol buffer types, namely, no sub-messages
224 * are allowed (yet). The bytes type is also not allowed.
225 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800226 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000227 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800228 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000229 * - A field that is a uid should be a string field, tagged with the [xxx]
230 * annotation. The generated code on android will be represented by UIDs,
231 * and those UIDs will be translated in xxx to those strings.
232 *
233 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700234 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000235 * - If there is a UID, it goes first. Think in an object-oriented fashion.
236 * *****************************************************************************
237 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700238
Yao Chend54f9dd2017-10-17 17:37:48 +0000239/**
Yangster-mace16189a2018-08-26 12:20:16 -0700240 * Logs when the Thermal service HAL notifies the throttling start/stop events.
241 *
242 * Logged from:
243 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
244 */
245message ThermalThrottlingStateChanged {
246 optional android.os.TemperatureTypeEnum sensor_type = 1;
247
248 enum State {
249 UNKNOWN = 0;
250 START = 1;
251 STOP = 2;
252 }
253
254 optional State state = 2;
255
256 optional float temperature = 3;
257}
258
259/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000260 * Logs when the screen state changes.
261 *
262 * Logged from:
263 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
264 */
265message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800266 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800267 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700268}
Yao Chend54f9dd2017-10-17 17:37:48 +0000269
270/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700271 * Logs that the process state of the uid, as determined by ActivityManager
272 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000273 *
274 * Logged from:
275 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
276 */
Bookatzc1a050a2017-10-10 15:49:28 -0700277message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700278 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000279
Bookatzdb026a22018-01-10 19:01:56 -0800280 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800281 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000282}
283
284/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700285 * Logs process state change of a process, as per the activity manager.
286 *
287 * Logged from:
288 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
289 */
290message ProcessStateChanged {
291 optional int32 uid = 1;
292 optional string process_name = 2;
293 optional string package_name = 3;
294 // TODO: remove this when validation is done
295 optional int64 version = 5;
296 // The state, from frameworks/base/core/proto/android/app/enums.proto.
297 optional android.app.ProcessStateEnum state = 4;
298}
299
300/**
301 * Logs when ActivityManagerService sleep state is changed.
302 *
303 * Logged from:
304 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
305 */
306message ActivityManagerSleepStateChanged {
307 // TODO: import frameworks proto
308 enum State {
309 UNKNOWN = 0;
310 ASLEEP = 1;
311 AWAKE = 2;
312 }
313 optional State state = 1 [(stateFieldOption).option = EXCLUSIVE];
314}
315
316/**
317 * Logs when system memory state changes.
318 *
319 * Logged from:
320 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
321 */
322message MemoryFactorStateChanged {
323 // TODO: import frameworks proto
324 enum State {
325 MEMORY_UNKNOWN = 0;
326 NORMAL = 1; // normal.
327 MODERATE = 2; // moderate memory pressure.
328 LOW = 3; // low memory.
329 CRITICAL = 4; // critical memory.
330
331 }
332 optional State factor = 1 [(stateFieldOption).option = EXCLUSIVE];
333}
334
335/**
336 * Logs when app is using too much cpu, according to ActivityManagerService.
337 *
338 * Logged from:
339 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
340 */
341message ExcessiveCpuUsageReported {
342 optional int32 uid = 1;
343 optional string process_name = 2;
344 optional string package_name = 3;
345 // package version. TODO: remove this when validation is done
346 optional int64 version = 4;
347}
348
349/**
350 * Logs when a cached process is killed, along with its pss.
351 *
352 * Logged from:
353 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
354 */
355message CachedKillReported {
356 optional int32 uid = 1;
357 optional string process_name = 2;
358 optional string package_name = 3;
359 // TODO: remove this when validation is done
360 optional int64 version = 5;
361 optional int64 pss = 4;
362}
363
364/**
365 * Logs when memory stats of a process is reported.
366 *
367 * Logged from:
368 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
369 */
370message ProcessMemoryStatReported {
371 optional int32 uid = 1;
372 optional string process_name = 2;
373 optional string package_name = 3;
374 //TODO: remove this when validation is done
375 optional int64 version = 9;
376 optional int64 pss = 4;
377 optional int64 uss = 5;
378 optional int64 rss = 6;
379 enum Type {
380 ADD_PSS_INTERNAL_SINGLE = 0;
381 ADD_PSS_INTERNAL_ALL_MEM = 1;
382 ADD_PSS_INTERNAL_ALL_POLL = 2;
383 ADD_PSS_EXTERNAL = 3;
384 ADD_PSS_EXTERNAL_SLOW = 4;
385 }
386 optional Type type = 7;
387 optional int64 duration = 8;
388}
389
390/**
Bookatzc1a050a2017-10-10 15:49:28 -0700391 * Logs that a process started, finished, crashed, or ANRed.
392 *
393 * Logged from:
394 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
395 */
396message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700397 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700398
David Chen0b5c90c2018-01-25 16:51:49 -0800399 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800400 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700401
Bookatzddccf0a2017-11-28 16:48:14 -0800402 // What lifecycle state the process changed to.
403 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800404 enum State {
405 FINISHED = 0;
406 STARTED = 1;
407 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800408 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800409 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700410}
411
Bookatzc1a050a2017-10-10 15:49:28 -0700412/**
413 * Logs when the ble scan state changes.
414 *
415 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700416 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700417 */
418message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800419 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700420
421 enum State {
422 OFF = 0;
423 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700424 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
425 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700426 }
427 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700428
Bookatze5ec0b42018-03-26 13:34:56 -0700429 // Does the scan have a filter.
430 optional bool is_filtered = 3;
431 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
432 optional bool is_first_match = 4;
433 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
434 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700435}
436
437/**
438 * Logs reporting of a ble scan finding results.
439 *
440 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700441 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700442 */
Bookatzae6738e2018-09-13 11:38:56 -0700443// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700444message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800445 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700446
447 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800448 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700449}
450
451/**
452 * Logs when a sensor state changes.
453 *
454 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700455 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700456 */
457message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800458 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700459
Bookatzc1a050a2017-10-10 15:49:28 -0700460 // The id (int) of the sensor.
461 optional int32 sensor_id = 2;
462
463 enum State {
464 OFF = 0;
465 ON = 1;
466 }
467 optional State state = 3;
468}
469
470
471/**
472 * Logs when GPS state changes.
473 *
474 * Logged from:
475 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
476 */
477message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800478 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700479
480 enum State {
481 OFF = 0;
482 ON = 1;
483 }
484 optional State state = 2;
485}
486
487
488/**
489 * Logs when a sync manager sync state changes.
490 *
491 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700492 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700493 */
494message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800495 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700496
David Chen0b5c90c2018-01-25 16:51:49 -0800497 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800498 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700499
500 enum State {
501 OFF = 0;
502 ON = 1;
503 }
504 optional State state = 3;
505}
506
Yangster-mac96353002018-09-05 11:18:55 -0700507/*
508 * Deferred job stats.
509 *
510 * Logged from:
511 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
512*/
513message DeferredJobStatsReported {
514 repeated AttributionNode attribution_node = 1;
515
516 // Number of jobs deferred.
517 optional int32 num_jobs_deferred = 2;
518
519 // Time since the last job runs.
520 optional int64 time_since_last_job_millis = 3;
521}
522
Bookatzc1a050a2017-10-10 15:49:28 -0700523/**
524 * Logs when a job scheduler job state changes.
525 *
526 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700527 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700528 */
529message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800530 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700531
532 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800533 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700534
535 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800536 FINISHED = 0;
537 STARTED = 1;
538 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700539 }
540 optional State state = 3;
541
Tej Singh33a412b2018-03-16 18:43:59 -0700542 // The reason a job has stopped.
543 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700544 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700545 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700546}
547
548/**
549 * Logs when the audio state changes.
550 *
551 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700552 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700553 */
554message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800555 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700556
557 enum State {
558 OFF = 0;
559 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700560 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
561 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700562 }
563 optional State state = 2;
564}
565
566/**
567 * Logs when the video codec state changes.
568 *
569 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700570 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700571 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800572message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800573 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700574
575 enum State {
576 OFF = 0;
577 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700578 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
579 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700580 }
581 optional State state = 2;
582}
583
584/**
585 * Logs when the flashlight state changes.
586 *
587 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700588 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700589 */
590message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800591 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700592
593 enum State {
594 OFF = 0;
595 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700596 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
597 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700598 }
599 optional State state = 2;
600}
601
602/**
603 * Logs when the camera state changes.
604 *
605 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700606 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700607 */
608message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800609 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700610
611 enum State {
612 OFF = 0;
613 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700614 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
615 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700616 }
617 optional State state = 2;
618}
619
620/**
621 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000622 *
623 * Logged from:
624 * TODO
625 */
Bookatzd6746242017-10-24 18:39:35 -0700626message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800627 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000628
Bookatz1a1b0462018-01-12 11:47:03 -0800629 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
630 // From frameworks/base/core/proto/android/os/enums.proto.
631 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700632
633 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
634 optional string tag = 3;
635
636 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800637 RELEASE = 0;
638 ACQUIRE = 1;
639 CHANGE_RELEASE = 2;
640 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700641 }
642 optional State state = 4;
643}
644
645/**
Bookatzc1a050a2017-10-10 15:49:28 -0700646 * Logs when a partial wakelock is considered 'long' (over 1 min).
647 *
648 * Logged from:
649 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
650 */
651message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800652 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700653
Yao Chend54f9dd2017-10-17 17:37:48 +0000654 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
655 optional string tag = 2;
656
Bookatzc1a050a2017-10-10 15:49:28 -0700657 // TODO: I have no idea what this is.
658 optional string history_tag = 3;
659
660 enum State {
661 OFF = 0;
662 ON = 1;
663 }
664 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000665}
666
Bookatzc1a050a2017-10-10 15:49:28 -0700667/**
668 * Logs Battery Saver state change.
669 *
670 * Logged from:
671 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
672 */
673message BatterySaverModeStateChanged {
674 enum State {
675 OFF = 0;
676 ON = 1;
677 }
678 optional State state = 1;
679}
680
681/**
682 * Logs Doze mode state change.
683 *
684 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800685 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700686 */
687message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800688 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800689}
690
691
692/**
693 * Logs state change of Doze mode including maintenance windows.
694 *
695 * Logged from:
696 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
697 */
698message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800699 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700700}
701
702/**
703 * Logs screen brightness level.
704 *
705 * Logged from:
706 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
707 */
708message ScreenBrightnessChanged {
709 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
710 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700711}
712
713/**
714 * Logs battery level (percent full, from 0 to 100).
715 *
716 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700717 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700718 */
719message BatteryLevelChanged {
720 // Battery level. Should be in [0, 100].
721 optional int32 battery_level = 1;
722}
723
724/**
725 * Logs change in charging status of the device.
726 *
727 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700728 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700729 */
730message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800731 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
732 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700733}
734
735/**
736 * Logs whether the device is plugged in, and what power source it is using.
737 *
738 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700739 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700740 */
741message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800742 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
743 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700744}
745
Bookatz8c6571b2017-10-24 15:04:41 -0700746/**
747 * Logs when an app's wakeup alarm fires.
748 *
749 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700750 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700751 */
752message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800753 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800754
755 // Name of the wakeup alarm.
756 optional string tag = 2;
757}
758
759/**
760 * Logs when an an app causes the mobile radio to change state.
761 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
762 *
763 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700764 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800765 */
766message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800767 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800768
Bookatz1a1b0462018-01-12 11:47:03 -0800769 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
770 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800771}
772
773/**
774 * Logs when an an app causes the wifi radio to change state.
775 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
776 *
777 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700778 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800779 */
780message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800781 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800782
Bookatz1a1b0462018-01-12 11:47:03 -0800783 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
784 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700785}
786
787/**
788 * Logs kernel wakeup reasons and aborts.
789 *
790 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700791 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700792 */
793message KernelWakeupReported {
794 // Name of the kernel wakeup reason (or abort).
795 optional string wakeup_reason_name = 1;
796
797 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800798 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700799}
800
801/**
802 * Logs wifi locks held by an app.
803 *
804 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700805 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700806 */
807message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800808 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700809
810 enum State {
811 OFF = 0;
812 ON = 1;
813 }
814 optional State state = 2;
815}
816
817/**
818 * Logs wifi signal strength changes.
819 *
820 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700821 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700822 */
823message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800824 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
825 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700826}
827
828/**
829 * Logs wifi scans performed by an app.
830 *
831 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700832 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700833 */
834message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800835 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700836
837 enum State {
838 OFF = 0;
839 ON = 1;
840 }
841 optional State state = 2;
842}
843
844/**
Tej Singh4503e102018-01-04 14:35:01 -0800845 * Logs wifi multicast locks held by an app
846 *
847 * Logged from:
848 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
849 */
850message WifiMulticastLockStateChanged {
851 repeated AttributionNode attribution_node = 1;
852
853 enum State {
854 OFF = 0;
855 ON = 1;
856 }
857 optional State state = 2;
858}
859
860/**
Tej Singh1ea42892018-01-19 09:27:00 -0800861 * Logs shutdown reason and duration on next boot.
862 *
863 * Logged from:
864 * frameworks/base/core/java/com/android/server/BootReceiver.java
865 */
866message ShutdownSequenceReported {
867 // True if shutdown is for a reboot. Default: false if we do not know.
868 optional bool reboot = 1;
869
870 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
871 optional string reason = 2;
872
873 // Beginning of shutdown time in ms using wall clock time since unix epoch.
874 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800875 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800876
877 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800878 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800879}
880
Tej Singh6483ea42018-01-25 17:45:49 -0800881
882/**
883 * Logs boot reason and duration.
884 *
885 * Logged from:
886 * system/core/bootstat/bootstat.cpp
887 */
888message BootSequenceReported {
889 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
890 // Default: "<EMPTY>" if not available.
891 optional string bootloader_reason = 1;
892
893 // Reason for system boot. Eg. bootloader, reboot,userrequested
894 // Default: "<EMPTY>" if not available.
895 optional string system_reason = 2;
896
897 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800898 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800899
900 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800901 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800902
903 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800904 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800905
906 // Time since last boot in ms. Default: 0 if not available.
907 optional int64 time_since_last_boot = 6;
908}
909
Tej Singhc477d9c2018-02-05 18:31:39 -0800910
911/**
912 * Logs call state and disconnect cause (if applicable).
913 *
914 * Logged from:
915 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
916 */
917message CallStateChanged {
918 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
919 // From frameworks/base/core/proto/android/telecomm/enums.proto.
920 optional android.telecom.CallStateEnum call_state = 1;
921
922 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
923 // This value is only applicable when the call_state is DISCONNECTED, and
924 // should always be UNKNOWN if the call_state is not DISCONNECTED.
925 // From frameworks/base/core/proto/android/telecomm/enums.proto.
926 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
927
928 // True if the call is self-managed, which are apps that use the
929 // telecom infrastructure to make their own calls.
930 optional bool self_managed = 3;
931
932 // True if call is external. External calls are calls on connected Wear
933 // devices but show up in Telecom so the user can pull them onto the device.
934 optional bool external_call = 4;
935}
936
Tej Singh1ea42892018-01-19 09:27:00 -0800937/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800938 * Logs keyguard state. The keyguard is the lock screen.
939 *
940 * Logged from:
941 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
942 */
943message KeyguardStateChanged {
944 enum State {
945 UNKNOWN = 0;
946 // The keyguard is hidden when the phone is unlocked.
947 HIDDEN = 1;
948 // The keyguard is shown when the phone is locked (screen turns off).
949 SHOWN= 2;
950 // The keyguard is occluded when something is overlaying the keyguard.
951 // Eg. Opening the camera while on the lock screen.
952 OCCLUDED = 3;
953 }
954 optional State state = 1;
955}
956
957/**
958 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
959 * prompts the user to enter a password (pattern, pin, etc).
960 *
961 * Logged from:
962 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
963 */
964
965message KeyguardBouncerStateChanged {
966 enum State {
967 UNKNOWN = 0;
968 // Bouncer is hidden, either as a result of successfully entering the
969 // password, screen timing out, or user going back to lock screen.
970 HIDDEN = 1;
971 // This is when the user is being prompted to enter the password.
972 SHOWN = 2;
973 }
974 optional State state = 1;
975}
976
977/**
978 * Logs the result of entering a password into the keyguard bouncer.
979 *
980 * Logged from:
981 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
982 */
983message KeyguardBouncerPasswordEntered {
984 enum BouncerResult {
985 UNKNOWN = 0;
986 // The password entered was incorrect.
987 FAILURE = 1;
988 // The password entered was correct.
989 SUCCESS = 2;
990 }
991 optional BouncerResult result = 1;
992}
993
Tej Singha883b372018-02-15 11:30:01 -0800994/*
995 * Logs changes to the configuration of the device. The configuration is defined
996 * in frameworks/base/core/java/android/content/res/Configuration.java
997 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
998 * Please go there to interpret the possible values each field can be.
999 *
1000 * Logged from:
1001 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1002 */
1003message ResourceConfigurationChanged {
1004 // Bit mask of color capabilities of the screen.
1005 // Contains information about the color gamut and hdr mode of the screen.
1006 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
1007 optional int32 colorMode = 1;
1008
1009 // The target screen density being rendered to.
1010 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
1011 optional int32 densityDpi = 2;
1012
1013 // Current user preference for the scaling factor for fonts,
1014 // relative to the base density scaling.
1015 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
1016 optional float fontScale = 3;
1017
1018 // Flag indicating whether the hard keyboard is hidden.
1019 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
1020 optional int32 hardKeyboardHidden = 4;
1021
1022 // The type of keyboard attached to the device.
1023 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1024 optional int32 keyboard = 5;
1025
1026 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1027 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
1028 optional int32 keyboardHideen = 6;
1029
1030 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1031 // 0 if undefined.
1032 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1033 optional int32 mcc = 7;
1034
1035 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1036 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1037 // MNC_ZERO symbol defined in Configuration.java.
1038 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1039 optional int32 mnc = 8;
1040
1041 // The kind of navigation available on the device.
1042 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1043 optional int32 navigation = 9;
1044
1045 // Flag indicating whether the navigation is available.
1046 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
1047 optional int32 navigationHidden = 10;
1048
1049 // Overall orientation of the screen.
1050 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1051 optional int32 orientation = 11;
1052
1053 // The current height of the available screen space, in dp units.
1054 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
1055 optional int32 screenHeightDp = 12;
1056
1057 // Bit mask of overall layout of the screen.
1058 // Contains information about screen size, whether the screen is wider/taller
1059 // than normal, whether the screen layout is right-tl-left or left-to-right,
1060 // and whether the screen has a rounded shape.
1061 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
1062 optional int32 screenLayout = 13;
1063
1064 // Current width of the available screen space, in dp units.
1065 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
1066 optional int32 screenWidthDp = 14;
1067
1068 // The smallest screen size an application will see in normal operation.
1069 // This is the smallest value of both screenWidthDp and screenHeightDp
1070 // in portrait and landscape.
1071 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
1072 optional int32 smallestScreenWidthDp = 15;
1073
1074 // The type of touch screen attached to the device.
1075 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1076 optional int32 touchscreen = 16;
1077
1078 // Bit mask of the ui mode.
1079 // Contains information about the overall ui mode of the device.
1080 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1081 // Also contains information about whether the device is in night mode.
1082 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
1083 optional int32 uiMode = 17;
1084}
1085
Tej Singheee317b2018-03-07 19:28:05 -08001086
1087/**
1088 * Logs changes in the connection state of the mobile radio.
1089 *
1090 * Logged from:
1091 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1092 */
1093message MobileConnectionStateChanged {
1094 // States are from the state machine DataConnection.java.
1095 enum State {
1096 UNKNOWN = 0;
1097 // The connection is inactive, or disconnected.
1098 INACTIVE = 1;
1099 // The connection is being activated, or connecting.
1100 ACTIVATING = 2;
1101 // The connection is active, or connected.
1102 ACTIVE = 3;
1103 // The connection is disconnecting.
1104 DISCONNECTING = 4;
1105 // The connection is disconnecting after creating a connection.
1106 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1107 }
1108 optional State state = 1;
1109 // For multi-sim phones, this distinguishes between the sim cards.
1110 optional int32 sim_slot_index = 2;
1111 // Used to identify the connection. Starts at 0 and increments by 1 for
1112 // every new network created. Resets whenever the device reboots.
1113 optional int32 data_connection_id = 3;
1114 // A bitmask for the capabilities of this connection.
1115 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1116 // Default value (if we have no information): 0
1117 optional int64 capabilities = 4;
1118 // If this connection has internet.
1119 // This just checks if the DEFAULT bit of capabilities is set.
1120 optional bool has_internet = 5;
1121}
1122
1123/**
1124 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1125 *
1126 * Logged from:
1127 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1128 */
1129message MobileRadioTechnologyChanged {
1130 optional android.telephony.NetworkTypeEnum state = 1;
1131 // For multi-sim phones, this distinguishes between the sim cards.
1132 optional int32 sim_slot_index = 2;
1133}
1134
Andrew Chantb56388b2018-03-22 21:07:33 -07001135/**
1136 * Logs the VID and PID of any connected USB devices.
1137 *
1138 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1139 *
1140 * Logged by Vendor.
1141 */
1142message UsbDeviceAttached {
1143 optional int32 vid = 1;
1144 optional int32 pid = 2;
1145 optional bool has_audio = 3;
1146 optional bool has_hid = 4;
1147 optional bool has_storage = 5;
1148}
1149
Tej Singheee317b2018-03-07 19:28:05 -08001150
Tej Singhdd7bd352018-02-09 19:33:15 -08001151/**
Tej Singh5d991e12018-03-09 19:48:11 -08001152 * Logs when Bluetooth is enabled and disabled.
1153 *
1154 * Logged from:
1155 * services/core/java/com/android/server/BluetoothManagerService.java
1156 */
1157message BluetoothEnabledStateChanged {
1158 repeated AttributionNode attribution_node = 1;
1159 // Whether or not bluetooth is enabled on the device.
1160 enum State {
1161 UNKNOWN = 0;
1162 ENABLED = 1;
1163 DISABLED = 2;
1164 }
1165 optional State state = 2;
1166 // The reason for being enabled/disabled.
1167 // Eg. Airplane mode, crash, application request.
1168 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1169 // If the reason is an application request, this will be the package name.
1170 optional string pkgName = 4;
1171}
1172
1173/**
1174 * Logs when a Bluetooth device connects and disconnects.
1175 *
1176 * Logged from:
1177 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1178 */
1179message BluetoothConnectionStateChanged {
1180 // The state of the connection.
1181 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1182 optional android.bluetooth.ConnectionStateEnum state = 1;
1183 // An identifier that can be used to match connect and disconnect events.
1184 // Currently is last two bytes of a hash of a device level ID and
1185 // the mac address of the bluetooth device that is connected.
1186 optional int32 obfuscated_id = 2;
1187 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1188 // From android.bluetooth.BluetoothAdapter.java
1189 optional int32 bt_profile = 3;
1190}
1191
1192/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001193 * Logs when something is plugged into or removed from the USB-C connector.
1194 *
1195 * Logged from:
1196 * Vendor USB HAL.
1197 */
1198message UsbConnectorStateChanged {
1199 enum State {
1200 DISCONNECTED = 0;
1201 CONNECTED = 1;
1202 }
1203 optional State state = 1;
1204}
1205
1206/**
1207 * Logs the reported speaker impedance.
1208 *
1209 * Logged from:
1210 * Vendor audio implementation.
1211 */
1212message SpeakerImpedanceReported {
1213 optional int32 speaker_location = 1;
1214 optional int32 impedance = 2;
1215}
1216
1217/**
1218 * Logs the report of a failed hardware.
1219 *
1220 * Logged from:
1221 * Vendor HALs.
1222 *
1223 */
1224message HardwareFailed {
1225 enum HardwareType {
1226 HARDWARE_FAILED_UNKNOWN = 0;
1227 HARDWARE_FAILED_MICROPHONE = 1;
1228 HARDWARE_FAILED_CODEC = 2;
1229 HARDWARE_FAILED_SPEAKER = 3;
1230 HARDWARE_FAILED_FINGERPRINT = 4;
1231 }
1232 optional HardwareType hardware_type = 1;
1233
1234 /* hardware_location allows vendors to differentiate between multiple instances of
1235 * the same hardware_type. The specific locations are vendor defined integers,
1236 * referring to board-specific numbering schemes.
1237 */
1238 optional int32 hardware_location = 2;
1239
1240 /* failure_code is specific to the HardwareType of the failed hardware.
1241 * It should use the enum values defined below.
1242 */
1243 enum MicrophoneFailureCode {
1244 MICROPHONE_FAILURE_COMPLETE = 0;
1245 }
1246 enum CodecFailureCode {
1247 CODEC_FAILURE_COMPLETE = 0;
1248 }
1249 enum SpeakerFailureCode {
1250 SPEAKER_FAILURE_COMPLETE = 0;
1251 SPEAKER_FAILURE_HIGH_Z = 1;
1252 SPEAKER_FAILURE_SHORT = 2;
1253 }
1254 enum FingerprintFailureCode {
1255 FINGERPRINT_FAILURE_COMPLETE = 0;
1256 FINGERPRINT_SENSOR_BROKEN = 1;
1257 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1258 }
1259 optional int32 failure_code = 3;
1260}
1261
1262/**
1263 * Log an event when the device has been physically dropped.
1264 * Reported from the /vendor partition.
1265 */
1266message PhysicalDropDetected {
1267 // Confidence that the event was actually a drop, 0 -> 100
1268 optional int32 confidence_pctg = 1;
1269 // Peak acceleration of the drop, in 1/1000s of a g.
1270 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001271 // Duration of freefall in ms
1272 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001273}
1274
1275/**
1276 * Log bucketed battery charge cycles.
1277 *
1278 * Each bucket represents cycles of the battery past
1279 * a given charge point. For example, bucket 1 is the
1280 * lowest 1/8th of the battery, and bucket 8 is 100%.
1281 *
1282 * Logged from:
1283 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1284 */
1285message ChargeCyclesReported {
1286 optional int32 cycle_bucket_1 = 1;
1287 optional int32 cycle_bucket_2 = 2;
1288 optional int32 cycle_bucket_3 = 3;
1289 optional int32 cycle_bucket_4 = 4;
1290 optional int32 cycle_bucket_5 = 5;
1291 optional int32 cycle_bucket_6 = 6;
1292 optional int32 cycle_bucket_7 = 7;
1293 optional int32 cycle_bucket_8 = 8;
1294}
1295
1296/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001297 * Logs the duration of a davey (jank of >=700ms) when it occurs
1298 *
1299 * Logged from:
1300 * frameworks/base/libs/hwui/JankTracker.cpp
1301 */
1302message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001303 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001304 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001305
Tej Singhbb8554a2018-01-26 11:59:14 -08001306 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001307 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001308}
1309
1310/**
Bookatze5885242017-10-24 20:10:31 -07001311 * Logs phone signal strength changes.
1312 *
1313 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001314 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001315 */
1316message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001317 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1318 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001319}
1320
1321/**
1322 * Logs that a setting was updated.
1323 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001324 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001325 * The tag and is_default allow resetting of settings to default values based on the specified
1326 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1327 */
1328message SettingChanged {
1329 // The name of the setting.
1330 optional string setting = 1;
1331
1332 // The change being imposed on this setting. May represent a number, eg "3".
1333 optional string value = 2;
1334
1335 // The new value of this setting. For most settings, this is same as value. For some settings,
1336 // value is +X or -X where X represents an element in a set. For example, if the previous value
1337 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1338 // The +/- feature is currently only used for location_providers_allowed.
1339 optional string new_value = 3;
1340
1341 // The previous value of this setting.
1342 optional string prev_value = 4;
1343
1344 // The tag used with the is_default for resetting sets of settings. This is generally null.
1345 optional string tag = 5;
1346
Bookatz90867622018-01-31 15:05:57 -08001347 // True if this setting with tag should be resettable.
1348 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001349
David Chenbd789912018-03-16 17:19:55 -07001350 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001351 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001352
1353 enum ChangeReason {
1354 UPDATED = 1; // Updated can be an insertion or an update.
1355 DELETED = 2;
1356 }
1357 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001358}
Chenjie Yub3dda412017-10-24 13:41:59 -07001359
Chenjie Yu05013b32017-11-21 10:21:41 -08001360/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001361 * Logs activity going to foreground or background
1362 *
1363 * Logged from:
1364 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1365 */
1366message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001367 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001368 optional string pkg_name = 2;
1369 optional string class_name = 3;
1370
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001371 enum State {
1372 BACKGROUND = 0;
1373 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001374 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001375 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001376}
David Chenc8a43242017-10-17 16:23:28 -07001377
1378/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001379 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001380 * Logged from:
1381 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1382 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001383message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001384 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001385
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001386 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001387
1388 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001389 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001390 optional string process_name = 3;
1391
1392 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001393 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001394
1395 optional string package_name = 5;
1396
1397 enum InstantApp {
1398 UNAVAILABLE = 0;
1399 FALSE = 1;
1400 TRUE = 2;
1401 }
1402 optional InstantApp is_instant_app = 6;
1403
1404 enum ForegroundState {
1405 UNKNOWN = 0;
1406 BACKGROUND = 1;
1407 FOREGROUND = 2;
1408 }
1409 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001410}
David Chen9e3808c2017-11-20 17:25:34 -08001411
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001412/**
1413 * Logs when a WTF (What a Terrible Failure) happened.
1414 * Logged from:
1415 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1416 */
1417message WTFOccurred {
1418 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001419
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001420 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001421
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001422 // The name of the process.
1423 // system_server if it is not by an app
1424 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001425
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001426 // The pid if available. -1 means not available.
1427 optional sint32 pid = 4;
1428}
1429
1430/**
1431 * Logs when system server reports low memory.
1432 * Logged from:
1433 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1434 */
1435message LowMemReported {
1436}
1437
1438/**
1439 * Logs when an app ANR (App Not Responding) occurs.
1440 * Logged from:
1441 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1442 */
1443message ANROccurred {
1444 optional int32 uid = 1 [(is_uid) = true];
1445
1446 optional string process_name = 2;
1447
1448 optional string short_component_name = 3;
1449
1450 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001451
1452 enum InstantApp {
1453 UNAVAILABLE = 0;
1454 FALSE = 1;
1455 TRUE = 2;
1456 }
1457 optional InstantApp is_instant_app = 5;
1458
1459 enum ForegroundState {
1460 UNKNOWN = 0;
1461 BACKGROUND = 1;
1462 FOREGROUND = 2;
1463 }
1464 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08001465}
1466
Bookatza7020bd2018-08-28 16:29:35 -07001467/**
1468 * Logs when the vibrator state changes.
1469 * Logged from:
1470 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1471 */
1472message VibratorStateChanged {
1473 repeated AttributionNode attribution_node = 1;
1474
1475 enum State {
1476 OFF = 0;
1477 ON = 1;
1478 }
1479 optional State state = 2;
1480
1481 // Duration (in milliseconds) requested to keep the vibrator on.
1482 // Only applicable for State == ON.
1483 optional int64 duration_millis = 3;
1484}
1485
David Chen0a368b22017-12-06 16:28:16 -08001486/*
1487 * Allows other apps to push events into statsd.
1488 * Logged from:
1489 * frameworks/base/core/java/android/util/StatsLog.java
1490 */
David Chen0b5c90c2018-01-25 16:51:49 -08001491message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001492 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001493 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001494
1495 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1496 optional int32 label = 2;
1497
1498 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1499 // predicates for the metrics).
1500 enum State {
1501 UNKNOWN = 0;
1502 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1503 STOP = 2;
1504 START = 3;
1505 }
1506 optional State state = 3;
1507}
1508
David Chen9e3808c2017-11-20 17:25:34 -08001509/**
Bookatz7948c872018-09-04 12:58:33 -07001510 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1511 * For example, this could be due to the user manually changing the time.
1512 *
1513 * Logged from:
1514 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1515 */
1516message WallClockTimeShifted {
1517 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1518 optional int64 wall_clock_timestamp_millis = 1;
1519}
1520
1521/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001522 * Logs when statsd detects an anomaly.
1523 *
1524 * Logged from:
1525 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1526 */
1527message AnomalyDetected {
1528 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001529 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001530
Yangster-mac94e197c2018-01-02 16:03:03 -08001531 // Id of the config whose anomaly detection alert fired.
1532 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001533
Yangster-mac94e197c2018-01-02 16:03:03 -08001534 // Id of the alert (i.e. name of the anomaly that was detected).
1535 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001536}
1537
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001538message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001539 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001540 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001541
1542 // The app package name.
1543 optional string pkg_name = 2;
1544
1545 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001546 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001547 WARM = 1;
1548 HOT = 2;
1549 COLD = 3;
1550 }
1551 // The transition type.
1552 optional TransitionType type = 3;
1553
1554 // The activity name.
1555 optional string activity_name = 4;
1556
1557 // The name of the calling app. Empty if not set.
1558 optional string calling_pkg_name = 5;
1559
1560 // Whether the app is an instant app.
1561 optional bool is_instant_app = 6;
1562
1563 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001564 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001565
Bookatz80d11a02018-01-16 10:46:35 -08001566 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001567
David Chen0b5c90c2018-01-25 16:51:49 -08001568 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001569 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001570 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001571 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001572 optional int32 bind_application_delay_millis = 11;
1573 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001574
1575 // Empty if not set.
1576 optional string launch_token = 13;
1577
Calin Juravle759fbda2018-02-20 19:52:30 +00001578 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001579 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001580
1581 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001582 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001583}
1584
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001585message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001586 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001587 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001588
1589 // The app package name.
1590 optional string pkg_name = 2;
1591
1592 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001593 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001594 WARM = 1;
1595 HOT = 2;
1596 COLD = 3;
1597 }
1598 // The transition type.
1599 optional TransitionType type = 3;
1600
1601 // The activity name.
1602 optional string activity_name = 4;
1603}
1604
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001605message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001606 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001607 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001608
1609 // The app package name.
1610 optional string pkg_name = 2;
1611
1612 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001613 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001614 WITH_BUNDLE = 1;
1615 WITHOUT_BUNDLE = 2;
1616 }
1617 // The transition type.
1618 optional TransitionType type = 3;
1619
1620 // The activity name.
1621 optional string activity_name = 4;
1622
1623 optional bool transition_process_running = 5;
1624
1625 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001626 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001627}
1628
Bookatz8fcd09a2017-12-18 13:01:10 -08001629/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001630 * Logs a picture-in-picture action
1631 * Logged from:
1632 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1633 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1634 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1635 */
1636message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001637 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001638 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001639
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001640 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001641
Chenjie Yu52cacc62017-12-08 18:11:45 -08001642 enum State {
1643 ENTERED = 1;
1644 EXPANDED_TO_FULL_SCREEN = 2;
1645 MINIMIZED = 3;
1646 DISMISSED = 4;
1647 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001648 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001649}
1650
1651/**
Chenjie Yue8904192017-12-08 19:12:57 -08001652 * Logs overlay action
1653 * Logged from:
1654 * services/core/java/com/android/server/wm/Session.java
1655 */
1656message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001657 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001658
1659 optional string package_name = 2;
1660
1661 optional bool using_alert_window = 3;
1662
1663 enum State {
1664 ENTERED = 1;
1665 EXITED = 2;
1666 }
1667 optional State state = 4;
1668}
1669
Chenjie Yuccfe6452018-01-30 11:33:21 -08001670/*
1671 * Logs foreground service starts and stops.
1672 * Note that this is not when a service starts or stops, but when it is
1673 * considered foreground.
1674 * Logged from
1675 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1676 */
1677message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001678 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001679 // package_name + "/" + class_name
1680 optional string short_name = 2;
1681
1682 enum State {
1683 ENTER = 1;
1684 EXIT = 2;
1685 }
1686 optional State state = 3;
1687}
1688
Chenjie Yue8904192017-12-08 19:12:57 -08001689/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001690 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1691 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1692 * attributed back to the parent (host) uid. One example is Chrome.
1693 *
1694 * Logged from:
1695 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1696 */
1697message IsolatedUidChanged {
1698 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001699 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001700 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001701 optional int32 parent_uid = 1;
1702
1703 optional int32 isolated_uid = 2;
1704
1705 // We expect an isolated uid to be removed before if it's used for another parent uid.
1706 enum Event {
1707 REMOVED = 0;
1708 CREATED = 1;
1709 }
1710 optional Event event = 3;
1711}
1712
1713/*
1714 * Logs the reception of an incoming network packet causing the main system to wake up for
1715 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1716 * and processed by WakeupController.cpp.
1717 */
1718message PacketWakeupOccurred {
1719 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1720 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001721 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001722 // The interface name on which the packet was received.
1723 optional string iface = 2;
1724 // The ethertype value of the packet.
1725 optional int32 ethertype = 3;
1726 // String representation of the destination MAC address of the packet.
1727 optional string destination_hardware_address = 4;
1728 // String representation of the source address of the packet if this was an IP packet.
1729 optional string source_ip = 5;
1730 // String representation of the destination address of the packet if this was an IP packet.
1731 optional string destination_ip = 6;
1732 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1733 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1734 // families.
1735 optional int32 ip_next_header = 7;
1736 // The source port if this was a TCP or UDP packet.
1737 optional int32 source_port = 8;
1738 // The destination port if this was a TCP or UDP packet.
1739 optional int32 destination_port = 9;
1740}
1741
1742/*
1743 * Logs the memory stats for an app on startup.
1744 * Logged from:
1745 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1746 */
1747message AppStartMemoryStateCaptured {
1748 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001749 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001750
1751 // The process name.
1752 optional string process_name = 2;
1753
1754 // The activity name.
1755 optional string activity_name = 3;
1756
1757 // # of page-faults
1758 optional int64 pgfault = 4;
1759
1760 // # of major page-faults
1761 optional int64 pgmajfault = 5;
1762
1763 // RSS
1764 optional int64 rss_in_bytes = 6;
1765
1766 // CACHE
1767 optional int64 cache_in_bytes = 7;
1768
1769 // SWAP
1770 optional int64 swap_in_bytes = 8;
1771}
1772
1773/*
1774 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1775 * for LMK event.
1776 * Logged from:
1777 * system/core/lmkd/lmkd.c
1778 */
1779message LmkStateChanged {
1780 enum State {
1781 UNKNOWN = 0;
1782 START = 1;
1783 STOP = 2;
1784 }
1785 optional State state = 1;
1786}
1787
1788/*
1789 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1790 * Logged from:
1791 * system/core/lmkd/lmkd.c
1792 */
1793message LmkKillOccurred {
1794 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001795 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001796
1797 // The process name.
1798 optional string process_name = 2;
1799
1800 // oom adj score.
1801 optional int32 oom_score = 3;
1802
1803 // # of page-faults
1804 optional int64 pgfault = 4;
1805
1806 // # of major page-faults
1807 optional int64 pgmajfault = 5;
1808
1809 // RSS
1810 optional int64 rss_in_bytes = 6;
1811
1812 // CACHE
1813 optional int64 cache_in_bytes = 7;
1814
1815 // SWAP
1816 optional int64 swap_in_bytes = 8;
1817}
1818
Rajeev Kumar51b54602018-03-01 12:18:26 -08001819/*
1820 * Logs when the ActivityManagerService detects that an app died.
1821 *
1822 * Logged from:
1823 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1824 */
1825message AppDied {
1826 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07001827 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08001828}
1829
Howard Ro21a039c2018-08-06 14:55:47 -07001830/**
1831 * An atom for generic metrics logging. Available from Android Q.
1832 */
1833message GenericAtom {
1834 // The uid of the application that sent this custom atom.
1835 optional int32 uid = 1 [(is_uid) = true];
1836
1837 // An event_id indicates the type of event.
Howard Ro0546d542018-08-30 16:23:44 -07001838 optional android.os.statsd.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07001839}
1840
Tej Singhd6d6d772018-09-05 17:41:25 -07001841/**
1842 * Logs when a fingerprint acquire event occurs.
1843 *
1844 * Logged from:
1845 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1846 */
1847message FingerprintAcquired {
1848 // The associated user. Eg: 0 for owners, 10+ for others.
1849 // Defined in android/os/UserHandle.java
1850 optional int32 user = 1;
1851 // If this acquire is for a crypto fingerprint.
1852 // e.g. Secure purchases, unlock password storage.
1853 optional bool is_crypto = 2;
1854}
1855
1856/**
1857 * Logs when a fingerprint authentication event occurs.
1858 *
1859 * Logged from:
1860 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1861 */
1862message FingerprintAuthenticated {
1863 // The associated user. Eg: 0 for owners, 10+ for others.
1864 // Defined in android/os/UserHandle.java
1865 optional int32 user = 1;
1866 // If this authentication is for a crypto fingerprint.
1867 // e.g. Secure purchases, unlock password storage.
1868 optional bool is_crypto = 2;
1869 // Whether or not this authentication was successful.
1870 optional bool is_authenticated = 3;
1871}
1872
1873/**
1874 * Logs when a fingerprint error occurs.
1875 *
1876 * Logged from:
1877 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1878 */
1879message FingerprintErrorOccurred {
1880 // The associated user. Eg: 0 for owners, 10+ for others.
1881 // Defined in android/os/UserHandle.java
1882 optional int32 user = 1;
1883 // If this error is for a crypto fingerprint.
1884 // e.g. Secure purchases, unlock password storage.
1885 optional bool is_crypto = 2;
1886
1887 enum Error {
1888 UNKNOWN = 0;
1889 LOCKOUT = 1;
1890 PERMANENT_LOCKOUT = 2;
1891 }
1892 // The type of error.
1893 optional Error error = 3;
1894}
Howard Ro688ae182018-09-25 00:09:36 -07001895
1896message Notification {
1897
1898 // Type of notification event.
1899 enum Type {
1900 TYPE_UNKNOWN = 0;
1901 // Notification became visible to the user.
1902 TYPE_OPEN = 1;
1903 // Notification became hidden.
1904 TYPE_CLOSE = 2;
1905 // Notification switched to detail mode.
1906 TYPE_DETAIL = 3;
1907 // Notification was clicked.
1908 TYPE_ACTION = 4;
1909 // Notification was dismissed.
1910 TYPE_DISMISS = 5;
1911 // Notification switched to summary mode. The enum value of 14 is to
1912 // match that of metrics_constants.
1913 TYPE_COLLAPSE = 14;
1914 }
1915 optional Type type = 1;
1916
1917 // Package name associated with the notification.
1918 optional string package_name = 2;
1919
1920 // Tag associated with notification.
1921 optional string tag = 3;
1922
1923 // Application-supplied ID associated with the notification.
1924 optional int32 id = 4;
1925
1926 // Index of notification in the notification panel.
1927 optional int32 shade_index = 5;
1928
1929 // The number of notifications in the notification panel.
1930 optional int32 shade_count = 6;
1931
1932 // Importance for the notification.
1933 optional int32 importance = 7;
1934
1935 // ID for the notification channel.
1936 optional int32 channel_id = 8;
1937
1938 // Importance for the notification channel.
1939 optional int32 channel_importance = 9;
1940
1941 // Whether notification was a group summary.
1942 optional bool group_summary = 10;
1943
1944 // Time since notification was created in milliseconds.
1945 optional int64 since_create_millis = 11;
1946
1947 // Time since notification was interrupted in milliseconds.
1948 optional int64 since_interruption_millis = 12;
1949
1950 // Time since notification was updated in milliseconds.
1951 optional int64 since_update_millis = 13;
1952
1953 // Time since notification was visible in milliseconds.
1954 optional int64 since_visible_millis = 14;
1955}
1956
1957
Chenjie Yubbcbc602018-02-05 16:51:52 -08001958//////////////////////////////////////////////////////////////////////
1959// Pulled atoms below this line //
1960//////////////////////////////////////////////////////////////////////
1961
1962/**
David Chenc8a43242017-10-17 16:23:28 -07001963 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
1964 *
1965 * Pulled from:
1966 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1967 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001968message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001969 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001970
1971 optional int64 rx_bytes = 2;
1972
1973 optional int64 rx_packets = 3;
1974
1975 optional int64 tx_bytes = 4;
1976
1977 optional int64 tx_packets = 5;
1978}
1979
1980/**
1981 * Pulls bytes transferred via wifi (separated by foreground and background usage).
1982 *
1983 * Pulled from:
1984 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1985 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001986message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001987 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001988
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001989 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
1990 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07001991
1992 optional int64 rx_bytes = 3;
1993
1994 optional int64 rx_packets = 4;
1995
1996 optional int64 tx_bytes = 5;
1997
1998 optional int64 tx_packets = 6;
1999}
2000
2001/**
2002 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2003 *
2004 * Pulled from:
2005 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2006 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002007message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002008 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002009
2010 optional int64 rx_bytes = 2;
2011
2012 optional int64 rx_packets = 3;
2013
2014 optional int64 tx_bytes = 4;
2015
2016 optional int64 tx_packets = 5;
2017}
2018
2019/**
2020 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2021 *
2022 * Pulled from:
2023 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2024 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002025message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002026 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002027
Yao Chenc40a19d2018-03-15 16:48:25 -07002028 // 1 denotes foreground and 0 denotes background. This is called Set in
2029 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002030 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002031
2032 optional int64 rx_bytes = 3;
2033
2034 optional int64 rx_packets = 4;
2035
2036 optional int64 tx_bytes = 5;
2037
2038 optional int64 tx_packets = 6;
2039}
2040
2041/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002042 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2043 *
2044 * Pulled from:
2045 * StatsCompanionService
2046 */
2047message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002048 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002049
2050 optional int64 rx_bytes = 2;
2051
2052 optional int64 tx_bytes = 3;
2053}
2054
2055/**
David Chenc8a43242017-10-17 16:23:28 -07002056 * Pulls the kernel wakelock durations. This atom is adapted from
2057 * android/internal/os/KernelWakelockStats.java
2058 *
2059 * Pulled from:
2060 * StatsCompanionService using KernelWakelockReader.
2061 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002062message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002063 optional string name = 1;
2064
2065 optional int32 count = 2;
2066
2067 optional int32 version = 3;
2068
2069 optional int64 time = 4;
2070}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002071
Chenjie Yu05013b32017-11-21 10:21:41 -08002072/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002073 * Pulls low power state information. This includes platform and subsystem sleep state information,
2074 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002075 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002076 * hardware/interfaces/power/1.1/types.hal
2077 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002078message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002079 // Subsystem name
2080 optional string subsystem_name = 1;
2081 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2082 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2083 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002084 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002085 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002086 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002087 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002088}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002089
Chenjie Yu05013b32017-11-21 10:21:41 -08002090/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002091 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002092 * Pulls the time the cpu spend on the frequency index. Frequency index
2093 * starts from highest to lowest. The value should be monotonically
2094 * increasing since boot. However, if there is a cpu
2095 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002096 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002097message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002098 optional uint32 cluster = 1;
2099 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002100 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002101}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002102
Chenjie Yu05013b32017-11-21 10:21:41 -08002103/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002104 * Pulls Cpu Time Per Uid.
2105 * Note that isolated process uid time should be attributed to host uids.
2106 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002107message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002108 optional int32 uid = 1 [(is_uid) = true];
David Chen0b5c90c2018-01-25 16:51:49 -08002109 optional uint64 user_time_millis = 2;
2110 optional uint64 sys_time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002111}
2112
2113/**
2114 * Pulls Cpu Time Per Uid per frequency.
2115 * Note that isolated process uid time should be attributed to host uids.
2116 * For each uid, we order the time by descending frequencies.
2117 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002118message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002119 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002120 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002121 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002122}
Hugo Benichi884970e2017-11-14 22:42:46 +09002123
Chenjie Yu05013b32017-11-21 10:21:41 -08002124/**
2125 * Pulls Wifi Controller Activity Energy Info
2126 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002127message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002128 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002129 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002130 // stack reported state
2131 // TODO: replace this with proto enum
2132 optional int32 stack_state = 2;
2133 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002134 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002135 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002136 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002137 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002138 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002139 // product of current(mA), voltage(V) and time(ms)
2140 optional uint64 controller_energy_used = 6;
2141}
2142
2143/**
2144 * Pulls Modem Activity Energy Info
2145 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002146message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002147 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002148 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002149 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08002150 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08002151 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002152 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002153 /**
2154 * Tx power index
2155 * index 0 = tx_power < 0dBm
2156 * index 1 = 0dBm < tx_power < 5dBm
2157 * index 2 = 5dBm < tx_power < 15dBm
2158 * index 3 = 15dBm < tx_power < 20dBm
2159 * index 4 = tx_power > 20dBm
2160 */
2161 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002162 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002163 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002164 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002165 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002166 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002167 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002168 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002169 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002170 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002171 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002172 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002173 // product of current(mA), voltage(V) and time(ms)
2174 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002175}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002176
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002177/**
2178 * Pulls Bluetooth Activity Energy Info
2179 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2180 */
2181message BluetoothActivityInfo {
2182 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002183 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002184 // bluetooth stack state
2185 optional int32 bluetooth_stack_state = 2;
2186 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002187 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002188 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002189 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002190 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002191 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002192 // product of current(mA), voltage(V) and time(ms)
2193 optional uint64 energy_used = 6;
2194}
2195
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002196/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002197 * Logs the memory stats for a process.
2198 */
2199message ProcessMemoryState {
2200 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002201 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002202
2203 // The process name.
2204 optional string process_name = 2;
2205
2206 // oom adj score.
2207 optional int32 oom_score = 3;
2208
2209 // # of page-faults
2210 optional int64 pgfault = 4;
2211
2212 // # of major page-faults
2213 optional int64 pgmajfault = 5;
2214
Rajeev Kumar90235992018-01-29 11:06:48 -08002215 // RSS
2216 optional int64 rss_in_bytes = 6;
2217
2218 // CACHE
2219 optional int64 cache_in_bytes = 7;
2220
2221 // SWAP
2222 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002223
2224 // RSS high watermark.
2225 // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status or
2226 // from memory.max_usage_in_bytes under /dev/memcg if the device uses per-app memory cgroups.
2227 optional int64 rss_high_watermark_in_bytes = 9;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002228}
2229
2230/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002231 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002232 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002233message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002234 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002235}
2236
2237/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002238 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002239 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002240message SystemUptime {
2241 // Milliseconds since the system was booted.
2242 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2243 // for external input).
2244 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002245 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002246}
2247
2248/*
2249 * Reads from /proc/uid_concurrent_active_time which has the format:
2250 * active: X (X is # cores)
2251 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2252 * [uid1]: [time-0] [time-1] [time-2] ... ...
2253 * ...
2254 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2255 * The file contains a monotonically increasing count of time for a single boot.
2256 */
2257message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002258 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002259 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002260}
2261
2262/**
2263 * Reads from /proc/uid_concurrent_policy_time which has the format:
2264 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2265 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2266 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2267 * ...
2268 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2269 * The file contains a monotonically increasing count of time for a single boot.
2270 */
2271message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002272 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002273 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002274 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002275}
2276
2277/*
2278 * Pulls free disk space, for data, system partition and temporary directory.
2279 */
2280message DiskSpace {
2281 // available bytes in data partition
2282 optional uint64 data_available_bytes = 1;
2283 // available bytes in system partition
2284 optional uint64 system_available_bytes = 2;
2285 // available bytes in download cache or temp directories
2286 optional uint64 temp_available_bytes = 3;
2287}
Tej Singhbf972d92018-01-10 20:51:13 -08002288
2289/**
2290 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002291 * Pulled from:
2292 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002293 */
2294message RemainingBatteryCapacity {
2295 optional int32 charge_uAh = 1;
2296}
2297
2298/**
2299 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002300 * Pulled from:
2301 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002302 */
2303message FullBatteryCapacity {
2304 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08002305}
2306
2307/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002308 * Pulls battery voltage.
2309 * Pulled from:
2310 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2311 */
2312message BatteryVoltage {
2313 // The voltage of the battery, in millivolts.
2314 optional int32 voltage_mV = 1;
2315}
2316
2317/**
Tej Singhd89137e2018-03-26 14:51:40 -07002318 * Pulls the temperature of various parts of the device.
2319 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002320 *
2321 * Pulled from:
2322 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2323 */
2324message Temperature {
2325 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2326 optional android.os.TemperatureTypeEnum sensor_location = 1;
2327
2328 // The name of the temperature source. Eg. CPU0
2329 optional string sensor_name = 2;
2330
Tej Singhd89137e2018-03-26 14:51:40 -07002331 // Temperature in tenths of a degree C.
2332 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08002333}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002334
2335/**
2336 * Pulls the statistics of calls to Binder.
2337 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002338 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2339 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002340 *
2341 * Next tag: 14
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002342 */
2343message BinderCalls {
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002344 optional int32 uid = 1 [(is_uid) = true];
2345 // Fully qualified class name of the API call.
2346 //
2347 // This is a system server class name.
2348 //
2349 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2350 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2351 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2352 // commonly used APIs.
2353 optional string service_class_name = 2;
2354 // Method name of the API call. It can also be a transaction code if we cannot
2355 // resolve it to a name. See Binder#getTransactionName.
2356 //
2357 // This is a system server method name.
2358 optional string service_method_name = 3;
2359 // Total number of API calls.
2360 optional int64 call_count = 4;
2361 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2362 optional bool screen_interactive = 13;
2363 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2364 // call_count will be equal to recorded_call_count.
2365 //
2366 // If recorded_call_count is different than call_count, it means data collection has been
2367 // sampled. All the fields below will be sampled in this case.
2368 optional int64 recorded_call_count = 12;
2369 // Number of exceptions thrown by the API.
2370 optional int64 recorded_exception_count = 5;
2371 // Total latency of all API calls.
2372 // Average can be computed using total_latency_micros / recorded_call_count.
2373 optional int64 recorded_total_latency_micros = 6;
2374 // Maximum latency of one API call.
2375 optional int64 recorded_max_latency_micros = 7;
2376 // Total CPU usage of all API calls.
2377 // Average can be computed using total_cpu_micros / recorded_call_count.
2378 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2379 optional int64 recorded_total_cpu_micros = 8;
2380 // Maximum CPU usage of one API call.
2381 optional int64 recorded_max_cpu_micros = 9;
2382 // Maximum parcel reply size of one API call.
2383 optional int64 recorded_max_reply_size_bytes = 10;
2384 // Maximum parcel request size of one API call.
2385 optional int64 recorded_max_request_size_bytes = 11;
2386}
2387
2388/**
2389 * Pulls the statistics of exceptions during calls to Binder.
2390 *
2391 * Binder stats are cumulative from boot unless somebody reset the data using
2392 * > adb shell dumpsys binder_calls_stats --reset
2393 */
2394message BinderCallsExceptions {
2395 // Exception class name, e.g. java.lang.IllegalArgumentException.
2396 //
2397 // This is an exception class name thrown by the system server.
2398 optional string exception_class_name = 1;
2399 // Total number of exceptions.
2400 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002401}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002402
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002403/**
2404 * Pulls the statistics of message dispatching on HandlerThreads.
2405 *
2406 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2407 * config on the device.
2408 *
2409 * Next tag: 11
2410 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002411message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002412 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002413 optional int32 uid = 1 [(is_uid) = true];
2414
2415 // Fully qualified class name of the handler target class.
2416 //
2417 // This field does not contain PII. This is a system server class name.
2418 optional string handler_class_name = 2;
2419
2420 // The name of the thread that runs the Looper.
2421 //
2422 // This field does not contain PII. This is a system server thread name.
2423 optional string looper_thread_name = 3;
2424
2425 // The name of the dispatched message.
2426 //
2427 // This field does not contain PII. This is a system server constant or class
2428 // name.
2429 optional string message_name = 4;
2430
2431 // Total number of successfully dispatched messages.
2432 optional int64 message_count = 5;
2433
2434 // Total number of messages that failed dispatching.
2435 optional int64 exception_count = 6;
2436
2437 // Total number of processed messages we have data recorded for. If we
2438 // collected data for all the messages, message_count will be equal to
2439 // recorded_message_count.
2440 //
2441 // If recorded_message_count is different than message_count, it means data
2442 // collection has been sampled. All the fields below will be sampled in this
2443 // case.
2444 optional int64 recorded_message_count = 7;
2445
2446 // Total latency of all processed messages.
2447 // Average can be computed using recorded_total_latency_micros /
2448 // recorded_message_count.
2449 optional int64 recorded_total_latency_micros = 8;
2450
2451 // Total CPU usage of all processed message.
2452 // Average can be computed using recorded_total_cpu_micros /
2453 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002454 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002455 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002456
2457 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2458 optional bool screen_interactive = 10;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002459}
Tej Singh86dc9db2018-09-06 00:39:57 +00002460
2461/**
2462 * Pulls disk information, such as write speed and latency.
2463 */
2464message DiskStats {
2465 // Time taken to open, write 512B to, and close a file.
2466 // -1 if error performing the check.
2467 optional int64 data_write_latency_millis = 1;
2468
2469 optional bool file_based_encryption = 2;
2470
2471 // Recent disk write speed in kB/s.
2472 // -1 if error querying storageed.
2473 // 0 if data is unavailable.
2474 optional int32 recent_disk_write_speed = 3;
2475}
2476
2477
2478/**
2479 * Free and total bytes of the Data, Cache, and System partition.
2480 */
2481message DirectoryUsage {
2482 enum Directory {
2483 UNKNOWN = 0;
2484 DATA = 1;
2485 CACHE = 2;
2486 SYSTEM = 3;
2487 }
2488 optional Directory directory = 1;
2489 optional int64 free_bytes = 2;
2490 optional int64 total_bytes = 3;
2491}
2492
2493
2494/**
2495 * Size of an application: apk size, data size, and cache size.
2496 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2497 * Information is only reported for apps with the primary user (user 0).
2498 * Sizes are aggregated by package name.
2499 */
2500message AppSize {
2501 // Including uids will involve modifying diskstats logic.
2502 optional string package_name = 1;
2503 // App size in bytes. -1 if unavailable.
2504 optional int64 app_size_bytes = 2;
2505 // App data size in bytes. -1 if unavailable.
2506 optional int64 app_data_size_bytes = 3;
2507 // App cache size in bytes. -1 if unavailable.
2508 optional int64 app_cache_size_bytes = 4;
2509 // Time that the cache file was produced.
2510 // Uses System.currentTimeMillis(), which is wall clock time.
2511 optional int64 cache_time_millis = 5;
2512}
2513
2514
2515/**
2516 * Size of a particular category. Eg: photos, videos.
2517 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2518 */
2519message CategorySize {
2520 enum Category {
2521 UNKNOWN = 0;
2522 APP_SIZE = 1;
2523 APP_DATA_SIZE = 2;
2524 APP_CACHE_SIZE = 3;
2525 PHOTOS = 4;
2526 VIDEOS = 5;
2527 AUDIO = 6;
2528 DOWNLOADS = 7;
2529 SYSTEM = 8;
2530 OTHER = 9;
2531 }
2532 optional Category category = 1;
2533 // Category size in bytes.
2534 optional int64 size_bytes = 2;
2535 // Time that the cache file was produced.
2536 // Uses System.currentTimeMillis(), which is wall clock time.
2537 optional int64 cache_time_millis = 3;
2538}
Tej Singhd6d6d772018-09-05 17:41:25 -07002539
2540/**
2541 * Pulls the number of fingerprints for each user.
2542 *
2543 * Pulled from StatsCompanionService, which queries FingerprintManager.
2544 */
2545message NumFingerprints {
2546 // The associated user. Eg: 0 for owners, 10+ for others.
2547 // Defined in android/os/UserHandle.java
2548 optional int32 user = 1;
2549 // Number of fingerprints registered to that user.
2550 optional int32 num_fingerprints = 2;
2551}
Chenjie Yu12e5e672018-09-14 15:54:59 -07002552
2553/**
2554 * Pulled from ProcessStatsService.java
2555 */
2556message ProcStats {
2557 optional android.service.procstats.ProcessStatsSectionProto proc_stats_section = 1;
2558}