blob: 30d8bfce5d2a156585a153e340de0a363f857186 [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;
Bookatza66083f2018-09-20 17:24:00 -070083 InteractiveStateChanged interactive_state_changed = 33;
84 // 34 is available
Bookatz8c6571b2017-10-24 15:04:41 -070085 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
86 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070087 WifiLockStateChanged wifi_lock_state_changed = 37;
88 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
89 WifiScanStateChanged wifi_scan_state_changed = 39;
90 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070091 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070092 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070093 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090094 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -070095 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -080096 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080097 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080098 AppStartOccurred app_start_occurred = 48;
99 AppStartCanceled app_start_canceled = 49;
100 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800101 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800102 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800103 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800104 LmkStateChanged lmk_state_changed = 54;
105 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800106 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800107 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800108 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800109 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800110 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800111 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800112 KeyguardStateChanged keyguard_state_changed = 62;
113 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
114 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800115 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800116 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800117 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
118 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Tej Singh02200f92018-04-02 19:37:59 -0700119 // 69 is blank but need not be.
Andrew Chantb56388b2018-03-22 21:07:33 -0700120 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800121 SpeakerImpedanceReported speaker_impedance_reported = 71;
122 HardwareFailed hardware_failed = 72;
123 PhysicalDropDetected physical_drop_detected = 73;
124 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800125 MobileConnectionStateChanged mobile_connection_state_changed = 75;
126 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700127 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800128 AppCrashOccurred app_crash_occurred = 78;
129 ANROccurred anr_occurred = 79;
130 WTFOccurred wtf_occurred = 80;
131 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700132 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700133 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700134 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700135 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700136 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700137 FingerprintAcquired fingerprint_acquired = 87;
138 FingerprintAuthenticated fingerprint_authenticated = 88;
139 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700140 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700141 BatteryHealthSnapshot battery_health_snapshot = 91;
142 SlowIo slow_io = 92;
143 BatteryCausedShutdown battery_caused_shutdown = 93;
Yao Chend54f9dd2017-10-17 17:37:48 +0000144 }
David Chenc8a43242017-10-17 16:23:28 -0700145
David Chen6e3e6cb2018-01-03 16:14:06 -0800146 // Pulled events will start at field 10000.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100147 // Next: 10025
David Chenc8a43242017-10-17 16:23:28 -0700148 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800149 WifiBytesTransfer wifi_bytes_transfer = 10000;
150 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
151 MobileBytesTransfer mobile_bytes_transfer = 10002;
152 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800153 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800154 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800155 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800156 CpuTimePerFreq cpu_time_per_freq = 10008;
157 CpuTimePerUid cpu_time_per_uid = 10009;
158 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800159 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800160 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800161 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800162 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800163 SystemElapsedRealtime system_elapsed_realtime = 10014;
164 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800165 CpuActiveTime cpu_active_time = 10016;
166 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000167 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800168 RemainingBatteryCapacity remaining_battery_capacity = 10019;
169 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800170 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100171 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100172 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100173 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000174 DiskStats disk_stats = 10025;
175 DirectoryUsage directory_usage = 10026;
176 AppSize app_size = 10027;
177 CategorySize category_size = 10028;
Bookatz17f0d8a2018-09-13 12:56:32 -0700178 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700179 NumFingerprints num_fingerprints = 10031;
Chenjie Yu12e5e672018-09-14 15:54:59 -0700180 ProcStats proc_stats = 10029;
David Chenc8a43242017-10-17 16:23:28 -0700181 }
yroa1fe77c2018-02-26 14:22:54 -0800182
Bookatz76aafcf2018-09-17 16:17:10 -0700183 // DO NOT USE field numbers above 100,000 in AOSP.
184 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
185 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700186}
187
Yao Chend54f9dd2017-10-17 17:37:48 +0000188/**
Yangster-mac20877162017-12-22 17:19:39 -0800189 * This proto represents a node of an attribution chain.
190 * Note: All attribution chains are represented as a repeated field of type
191 * AttributionNode. It is understood that in such arrays, the order is that
192 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000193 */
Yangster-mac20877162017-12-22 17:19:39 -0800194message AttributionNode {
195 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800196 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800197
Yangster-mac20877162017-12-22 17:19:39 -0800198 // The (optional) string tag for an element in the attribution chain. If the
199 // element has no tag, it is encoded as an empty string.
200 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700201}
202
Yangster-mac48b3d622018-08-18 12:38:11 -0700203message KeyValuePair {
204 optional int32 key = 1;
205 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700206 int32 value_int = 2;
207 int64 value_long = 3;
208 string value_str = 4;
209 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700210 }
211}
212
213message KeyValuePairsAtom {
214 optional int32 uid = 1;
215 repeated KeyValuePair pairs = 2;
216}
217
Yao Chend54f9dd2017-10-17 17:37:48 +0000218/*
219 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800220 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000221 *
222 * RULES:
223 * - The field ids for each atom must start at 1, and count upwards by 1.
224 * Skipping field ids is not allowed.
225 * - These form an API, so renaming, renumbering or removing fields is
226 * not allowed between android releases. (This is not currently enforced,
227 * but there will be a tool to enforce this restriction).
228 * - The types must be built-in protocol buffer types, namely, no sub-messages
229 * are allowed (yet). The bytes type is also not allowed.
230 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800231 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000232 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800233 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000234 * - A field that is a uid should be a string field, tagged with the [xxx]
235 * annotation. The generated code on android will be represented by UIDs,
236 * and those UIDs will be translated in xxx to those strings.
237 *
238 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700239 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000240 * - If there is a UID, it goes first. Think in an object-oriented fashion.
241 * *****************************************************************************
242 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700243
Yao Chend54f9dd2017-10-17 17:37:48 +0000244/**
Yangster-mace16189a2018-08-26 12:20:16 -0700245 * Logs when the Thermal service HAL notifies the throttling start/stop events.
246 *
247 * Logged from:
248 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
249 */
250message ThermalThrottlingStateChanged {
251 optional android.os.TemperatureTypeEnum sensor_type = 1;
252
253 enum State {
254 UNKNOWN = 0;
255 START = 1;
256 STOP = 2;
257 }
258
259 optional State state = 2;
260
261 optional float temperature = 3;
262}
263
264/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000265 * Logs when the screen state changes.
266 *
267 * Logged from:
268 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
269 */
270message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800271 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800272 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700273}
Yao Chend54f9dd2017-10-17 17:37:48 +0000274
275/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700276 * Logs that the process state of the uid, as determined by ActivityManager
277 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000278 *
279 * Logged from:
280 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
281 */
Bookatzc1a050a2017-10-10 15:49:28 -0700282message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700283 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000284
Bookatzdb026a22018-01-10 19:01:56 -0800285 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800286 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000287}
288
289/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700290 * Logs process state change of a process, as per the activity manager.
291 *
292 * Logged from:
293 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
294 */
295message ProcessStateChanged {
296 optional int32 uid = 1;
297 optional string process_name = 2;
298 optional string package_name = 3;
299 // TODO: remove this when validation is done
300 optional int64 version = 5;
301 // The state, from frameworks/base/core/proto/android/app/enums.proto.
302 optional android.app.ProcessStateEnum state = 4;
303}
304
305/**
306 * Logs when ActivityManagerService sleep state is changed.
307 *
308 * Logged from:
309 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
310 */
311message ActivityManagerSleepStateChanged {
312 // TODO: import frameworks proto
313 enum State {
314 UNKNOWN = 0;
315 ASLEEP = 1;
316 AWAKE = 2;
317 }
318 optional State state = 1 [(stateFieldOption).option = EXCLUSIVE];
319}
320
321/**
322 * Logs when system memory state changes.
323 *
324 * Logged from:
325 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
326 */
327message MemoryFactorStateChanged {
328 // TODO: import frameworks proto
329 enum State {
330 MEMORY_UNKNOWN = 0;
331 NORMAL = 1; // normal.
332 MODERATE = 2; // moderate memory pressure.
333 LOW = 3; // low memory.
334 CRITICAL = 4; // critical memory.
335
336 }
337 optional State factor = 1 [(stateFieldOption).option = EXCLUSIVE];
338}
339
340/**
341 * Logs when app is using too much cpu, according to ActivityManagerService.
342 *
343 * Logged from:
344 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
345 */
346message ExcessiveCpuUsageReported {
347 optional int32 uid = 1;
348 optional string process_name = 2;
349 optional string package_name = 3;
350 // package version. TODO: remove this when validation is done
351 optional int64 version = 4;
352}
353
354/**
355 * Logs when a cached process is killed, along with its pss.
356 *
357 * Logged from:
358 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
359 */
360message CachedKillReported {
361 optional int32 uid = 1;
362 optional string process_name = 2;
363 optional string package_name = 3;
364 // TODO: remove this when validation is done
365 optional int64 version = 5;
366 optional int64 pss = 4;
367}
368
369/**
370 * Logs when memory stats of a process is reported.
371 *
372 * Logged from:
373 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
374 */
375message ProcessMemoryStatReported {
376 optional int32 uid = 1;
377 optional string process_name = 2;
378 optional string package_name = 3;
379 //TODO: remove this when validation is done
380 optional int64 version = 9;
381 optional int64 pss = 4;
382 optional int64 uss = 5;
383 optional int64 rss = 6;
384 enum Type {
385 ADD_PSS_INTERNAL_SINGLE = 0;
386 ADD_PSS_INTERNAL_ALL_MEM = 1;
387 ADD_PSS_INTERNAL_ALL_POLL = 2;
388 ADD_PSS_EXTERNAL = 3;
389 ADD_PSS_EXTERNAL_SLOW = 4;
390 }
391 optional Type type = 7;
392 optional int64 duration = 8;
393}
394
395/**
Bookatzc1a050a2017-10-10 15:49:28 -0700396 * Logs that a process started, finished, crashed, or ANRed.
397 *
398 * Logged from:
399 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
400 */
401message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700402 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700403
David Chen0b5c90c2018-01-25 16:51:49 -0800404 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800405 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700406
Bookatzddccf0a2017-11-28 16:48:14 -0800407 // What lifecycle state the process changed to.
408 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800409 enum State {
410 FINISHED = 0;
411 STARTED = 1;
412 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800413 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800414 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700415}
416
Bookatzc1a050a2017-10-10 15:49:28 -0700417/**
418 * Logs when the ble scan state changes.
419 *
420 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700421 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700422 */
423message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800424 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700425
426 enum State {
427 OFF = 0;
428 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700429 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
430 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700431 }
432 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700433
Bookatze5ec0b42018-03-26 13:34:56 -0700434 // Does the scan have a filter.
435 optional bool is_filtered = 3;
436 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
437 optional bool is_first_match = 4;
438 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
439 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700440}
441
442/**
443 * Logs reporting of a ble scan finding results.
444 *
445 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700446 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700447 */
Bookatzae6738e2018-09-13 11:38:56 -0700448// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700449message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800450 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700451
452 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800453 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700454}
455
456/**
457 * Logs when a sensor state changes.
458 *
459 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700460 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700461 */
462message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800463 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700464
Bookatzc1a050a2017-10-10 15:49:28 -0700465 // The id (int) of the sensor.
466 optional int32 sensor_id = 2;
467
468 enum State {
469 OFF = 0;
470 ON = 1;
471 }
472 optional State state = 3;
473}
474
475
476/**
477 * Logs when GPS state changes.
478 *
479 * Logged from:
480 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
481 */
482message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800483 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700484
485 enum State {
486 OFF = 0;
487 ON = 1;
488 }
489 optional State state = 2;
490}
491
492
493/**
494 * Logs when a sync manager sync state changes.
495 *
496 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700497 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700498 */
499message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800500 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700501
David Chen0b5c90c2018-01-25 16:51:49 -0800502 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800503 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700504
505 enum State {
506 OFF = 0;
507 ON = 1;
508 }
509 optional State state = 3;
510}
511
Yangster-mac96353002018-09-05 11:18:55 -0700512/*
513 * Deferred job stats.
514 *
515 * Logged from:
516 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
517*/
518message DeferredJobStatsReported {
519 repeated AttributionNode attribution_node = 1;
520
521 // Number of jobs deferred.
522 optional int32 num_jobs_deferred = 2;
523
524 // Time since the last job runs.
525 optional int64 time_since_last_job_millis = 3;
526}
527
Bookatzc1a050a2017-10-10 15:49:28 -0700528/**
529 * Logs when a job scheduler job state changes.
530 *
531 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700532 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700533 */
534message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800535 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700536
537 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800538 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700539
540 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800541 FINISHED = 0;
542 STARTED = 1;
543 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700544 }
545 optional State state = 3;
546
Tej Singh33a412b2018-03-16 18:43:59 -0700547 // The reason a job has stopped.
548 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700549 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700550 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700551}
552
553/**
554 * Logs when the audio state changes.
555 *
556 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700557 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700558 */
559message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800560 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700561
562 enum State {
563 OFF = 0;
564 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700565 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
566 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700567 }
568 optional State state = 2;
569}
570
571/**
572 * Logs when the video codec state changes.
573 *
574 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700575 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700576 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800577message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800578 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700579
580 enum State {
581 OFF = 0;
582 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700583 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
584 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700585 }
586 optional State state = 2;
587}
588
589/**
590 * Logs when the flashlight state changes.
591 *
592 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700593 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700594 */
595message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800596 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700597
598 enum State {
599 OFF = 0;
600 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700601 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
602 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700603 }
604 optional State state = 2;
605}
606
607/**
608 * Logs when the camera state changes.
609 *
610 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700611 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700612 */
613message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800614 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700615
616 enum State {
617 OFF = 0;
618 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700619 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
620 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700621 }
622 optional State state = 2;
623}
624
625/**
626 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000627 *
628 * Logged from:
629 * TODO
630 */
Bookatzd6746242017-10-24 18:39:35 -0700631message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800632 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000633
Bookatz1a1b0462018-01-12 11:47:03 -0800634 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
635 // From frameworks/base/core/proto/android/os/enums.proto.
636 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700637
638 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
639 optional string tag = 3;
640
641 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800642 RELEASE = 0;
643 ACQUIRE = 1;
644 CHANGE_RELEASE = 2;
645 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700646 }
647 optional State state = 4;
648}
649
650/**
Bookatzc1a050a2017-10-10 15:49:28 -0700651 * Logs when a partial wakelock is considered 'long' (over 1 min).
652 *
653 * Logged from:
654 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
655 */
656message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800657 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700658
Yao Chend54f9dd2017-10-17 17:37:48 +0000659 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
660 optional string tag = 2;
661
Bookatzc1a050a2017-10-10 15:49:28 -0700662 // TODO: I have no idea what this is.
663 optional string history_tag = 3;
664
665 enum State {
666 OFF = 0;
667 ON = 1;
668 }
669 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000670}
671
Bookatzc1a050a2017-10-10 15:49:28 -0700672/**
Bookatza66083f2018-09-20 17:24:00 -0700673 * Logs when the device is interactive, according to the PowerManager Notifier.
674 *
675 * Logged from:
676 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
677 */
678message InteractiveStateChanged {
679 enum State {
680 OFF = 0;
681 ON = 1;
682 }
683 optional State state = 1;
684}
685
686/**
Bookatzc1a050a2017-10-10 15:49:28 -0700687 * Logs Battery Saver state change.
688 *
689 * Logged from:
690 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
691 */
692message BatterySaverModeStateChanged {
693 enum State {
694 OFF = 0;
695 ON = 1;
696 }
697 optional State state = 1;
698}
699
700/**
701 * Logs Doze mode state change.
702 *
703 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800704 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700705 */
706message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800707 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800708}
709
710
711/**
712 * Logs state change of Doze mode including maintenance windows.
713 *
714 * Logged from:
715 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
716 */
717message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800718 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700719}
720
721/**
722 * Logs screen brightness level.
723 *
724 * Logged from:
725 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
726 */
727message ScreenBrightnessChanged {
728 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
729 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700730}
731
732/**
733 * Logs battery level (percent full, from 0 to 100).
734 *
735 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700736 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700737 */
738message BatteryLevelChanged {
739 // Battery level. Should be in [0, 100].
740 optional int32 battery_level = 1;
741}
742
743/**
744 * Logs change in charging status of the device.
745 *
746 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700747 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700748 */
749message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800750 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
751 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700752}
753
754/**
755 * Logs whether the device is plugged in, and what power source it is using.
756 *
757 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700758 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700759 */
760message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800761 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
762 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700763}
764
Bookatz8c6571b2017-10-24 15:04:41 -0700765/**
766 * Logs when an app's wakeup alarm fires.
767 *
768 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700769 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700770 */
771message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800772 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800773
774 // Name of the wakeup alarm.
775 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700776
777 // Name of source package (for historical reasons, since BatteryStats tracked it).
778 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800779}
780
781/**
782 * Logs when an an app causes the mobile radio to change state.
783 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
784 *
785 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700786 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800787 */
788message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800789 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800790
Bookatz1a1b0462018-01-12 11:47:03 -0800791 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
792 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800793}
794
795/**
796 * Logs when an an app causes the wifi radio to change state.
797 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
798 *
799 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700800 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800801 */
802message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800803 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800804
Bookatz1a1b0462018-01-12 11:47:03 -0800805 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
806 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700807}
808
809/**
810 * Logs kernel wakeup reasons and aborts.
811 *
812 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700813 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700814 */
815message KernelWakeupReported {
816 // Name of the kernel wakeup reason (or abort).
817 optional string wakeup_reason_name = 1;
818
819 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800820 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700821}
822
823/**
824 * Logs wifi locks held by an app.
825 *
826 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700827 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700828 */
829message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800830 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700831
832 enum State {
833 OFF = 0;
834 ON = 1;
835 }
836 optional State state = 2;
837}
838
839/**
840 * Logs wifi signal strength changes.
841 *
842 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700843 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700844 */
845message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800846 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
847 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700848}
849
850/**
851 * Logs wifi scans performed by an app.
852 *
853 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700854 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700855 */
856message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800857 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700858
859 enum State {
860 OFF = 0;
861 ON = 1;
862 }
863 optional State state = 2;
864}
865
866/**
Tej Singh4503e102018-01-04 14:35:01 -0800867 * Logs wifi multicast locks held by an app
868 *
869 * Logged from:
870 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
871 */
872message WifiMulticastLockStateChanged {
873 repeated AttributionNode attribution_node = 1;
874
875 enum State {
876 OFF = 0;
877 ON = 1;
878 }
879 optional State state = 2;
880}
881
882/**
Tej Singh1ea42892018-01-19 09:27:00 -0800883 * Logs shutdown reason and duration on next boot.
884 *
885 * Logged from:
886 * frameworks/base/core/java/com/android/server/BootReceiver.java
887 */
888message ShutdownSequenceReported {
889 // True if shutdown is for a reboot. Default: false if we do not know.
890 optional bool reboot = 1;
891
892 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
893 optional string reason = 2;
894
895 // Beginning of shutdown time in ms using wall clock time since unix epoch.
896 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800897 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800898
899 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800900 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800901}
902
Tej Singh6483ea42018-01-25 17:45:49 -0800903
904/**
905 * Logs boot reason and duration.
906 *
907 * Logged from:
908 * system/core/bootstat/bootstat.cpp
909 */
910message BootSequenceReported {
911 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
912 // Default: "<EMPTY>" if not available.
913 optional string bootloader_reason = 1;
914
915 // Reason for system boot. Eg. bootloader, reboot,userrequested
916 // Default: "<EMPTY>" if not available.
917 optional string system_reason = 2;
918
919 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800920 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800921
922 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800923 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800924
925 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800926 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800927
928 // Time since last boot in ms. Default: 0 if not available.
929 optional int64 time_since_last_boot = 6;
930}
931
Tej Singhc477d9c2018-02-05 18:31:39 -0800932
933/**
934 * Logs call state and disconnect cause (if applicable).
935 *
936 * Logged from:
937 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
938 */
939message CallStateChanged {
940 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
941 // From frameworks/base/core/proto/android/telecomm/enums.proto.
942 optional android.telecom.CallStateEnum call_state = 1;
943
944 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
945 // This value is only applicable when the call_state is DISCONNECTED, and
946 // should always be UNKNOWN if the call_state is not DISCONNECTED.
947 // From frameworks/base/core/proto/android/telecomm/enums.proto.
948 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
949
950 // True if the call is self-managed, which are apps that use the
951 // telecom infrastructure to make their own calls.
952 optional bool self_managed = 3;
953
954 // True if call is external. External calls are calls on connected Wear
955 // devices but show up in Telecom so the user can pull them onto the device.
956 optional bool external_call = 4;
957}
958
Tej Singh1ea42892018-01-19 09:27:00 -0800959/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800960 * Logs keyguard state. The keyguard is the lock screen.
961 *
962 * Logged from:
963 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
964 */
965message KeyguardStateChanged {
966 enum State {
967 UNKNOWN = 0;
968 // The keyguard is hidden when the phone is unlocked.
969 HIDDEN = 1;
970 // The keyguard is shown when the phone is locked (screen turns off).
971 SHOWN= 2;
972 // The keyguard is occluded when something is overlaying the keyguard.
973 // Eg. Opening the camera while on the lock screen.
974 OCCLUDED = 3;
975 }
976 optional State state = 1;
977}
978
979/**
980 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
981 * prompts the user to enter a password (pattern, pin, etc).
982 *
983 * Logged from:
984 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
985 */
986
987message KeyguardBouncerStateChanged {
988 enum State {
989 UNKNOWN = 0;
990 // Bouncer is hidden, either as a result of successfully entering the
991 // password, screen timing out, or user going back to lock screen.
992 HIDDEN = 1;
993 // This is when the user is being prompted to enter the password.
994 SHOWN = 2;
995 }
996 optional State state = 1;
997}
998
999/**
1000 * Logs the result of entering a password into the keyguard bouncer.
1001 *
1002 * Logged from:
1003 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1004 */
1005message KeyguardBouncerPasswordEntered {
1006 enum BouncerResult {
1007 UNKNOWN = 0;
1008 // The password entered was incorrect.
1009 FAILURE = 1;
1010 // The password entered was correct.
1011 SUCCESS = 2;
1012 }
1013 optional BouncerResult result = 1;
1014}
1015
Tej Singha883b372018-02-15 11:30:01 -08001016/*
1017 * Logs changes to the configuration of the device. The configuration is defined
1018 * in frameworks/base/core/java/android/content/res/Configuration.java
1019 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1020 * Please go there to interpret the possible values each field can be.
1021 *
1022 * Logged from:
1023 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1024 */
1025message ResourceConfigurationChanged {
1026 // Bit mask of color capabilities of the screen.
1027 // Contains information about the color gamut and hdr mode of the screen.
1028 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
1029 optional int32 colorMode = 1;
1030
1031 // The target screen density being rendered to.
1032 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
1033 optional int32 densityDpi = 2;
1034
1035 // Current user preference for the scaling factor for fonts,
1036 // relative to the base density scaling.
1037 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
1038 optional float fontScale = 3;
1039
1040 // Flag indicating whether the hard keyboard is hidden.
1041 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
1042 optional int32 hardKeyboardHidden = 4;
1043
1044 // The type of keyboard attached to the device.
1045 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1046 optional int32 keyboard = 5;
1047
1048 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1049 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
1050 optional int32 keyboardHideen = 6;
1051
1052 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1053 // 0 if undefined.
1054 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1055 optional int32 mcc = 7;
1056
1057 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1058 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1059 // MNC_ZERO symbol defined in Configuration.java.
1060 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1061 optional int32 mnc = 8;
1062
1063 // The kind of navigation available on the device.
1064 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1065 optional int32 navigation = 9;
1066
1067 // Flag indicating whether the navigation is available.
1068 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
1069 optional int32 navigationHidden = 10;
1070
1071 // Overall orientation of the screen.
1072 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1073 optional int32 orientation = 11;
1074
1075 // The current height of the available screen space, in dp units.
1076 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
1077 optional int32 screenHeightDp = 12;
1078
1079 // Bit mask of overall layout of the screen.
1080 // Contains information about screen size, whether the screen is wider/taller
1081 // than normal, whether the screen layout is right-tl-left or left-to-right,
1082 // and whether the screen has a rounded shape.
1083 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
1084 optional int32 screenLayout = 13;
1085
1086 // Current width of the available screen space, in dp units.
1087 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
1088 optional int32 screenWidthDp = 14;
1089
1090 // The smallest screen size an application will see in normal operation.
1091 // This is the smallest value of both screenWidthDp and screenHeightDp
1092 // in portrait and landscape.
1093 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
1094 optional int32 smallestScreenWidthDp = 15;
1095
1096 // The type of touch screen attached to the device.
1097 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1098 optional int32 touchscreen = 16;
1099
1100 // Bit mask of the ui mode.
1101 // Contains information about the overall ui mode of the device.
1102 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1103 // Also contains information about whether the device is in night mode.
1104 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
1105 optional int32 uiMode = 17;
1106}
1107
Tej Singheee317b2018-03-07 19:28:05 -08001108
1109/**
1110 * Logs changes in the connection state of the mobile radio.
1111 *
1112 * Logged from:
1113 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1114 */
1115message MobileConnectionStateChanged {
1116 // States are from the state machine DataConnection.java.
1117 enum State {
1118 UNKNOWN = 0;
1119 // The connection is inactive, or disconnected.
1120 INACTIVE = 1;
1121 // The connection is being activated, or connecting.
1122 ACTIVATING = 2;
1123 // The connection is active, or connected.
1124 ACTIVE = 3;
1125 // The connection is disconnecting.
1126 DISCONNECTING = 4;
1127 // The connection is disconnecting after creating a connection.
1128 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1129 }
1130 optional State state = 1;
1131 // For multi-sim phones, this distinguishes between the sim cards.
1132 optional int32 sim_slot_index = 2;
1133 // Used to identify the connection. Starts at 0 and increments by 1 for
1134 // every new network created. Resets whenever the device reboots.
1135 optional int32 data_connection_id = 3;
1136 // A bitmask for the capabilities of this connection.
1137 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1138 // Default value (if we have no information): 0
1139 optional int64 capabilities = 4;
1140 // If this connection has internet.
1141 // This just checks if the DEFAULT bit of capabilities is set.
1142 optional bool has_internet = 5;
1143}
1144
1145/**
1146 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1147 *
1148 * Logged from:
1149 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1150 */
1151message MobileRadioTechnologyChanged {
1152 optional android.telephony.NetworkTypeEnum state = 1;
1153 // For multi-sim phones, this distinguishes between the sim cards.
1154 optional int32 sim_slot_index = 2;
1155}
1156
Andrew Chantb56388b2018-03-22 21:07:33 -07001157/**
1158 * Logs the VID and PID of any connected USB devices.
1159 *
1160 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1161 *
1162 * Logged by Vendor.
1163 */
1164message UsbDeviceAttached {
1165 optional int32 vid = 1;
1166 optional int32 pid = 2;
1167 optional bool has_audio = 3;
1168 optional bool has_hid = 4;
1169 optional bool has_storage = 5;
1170}
1171
Tej Singheee317b2018-03-07 19:28:05 -08001172
Tej Singhdd7bd352018-02-09 19:33:15 -08001173/**
Tej Singh5d991e12018-03-09 19:48:11 -08001174 * Logs when Bluetooth is enabled and disabled.
1175 *
1176 * Logged from:
1177 * services/core/java/com/android/server/BluetoothManagerService.java
1178 */
1179message BluetoothEnabledStateChanged {
1180 repeated AttributionNode attribution_node = 1;
1181 // Whether or not bluetooth is enabled on the device.
1182 enum State {
1183 UNKNOWN = 0;
1184 ENABLED = 1;
1185 DISABLED = 2;
1186 }
1187 optional State state = 2;
1188 // The reason for being enabled/disabled.
1189 // Eg. Airplane mode, crash, application request.
1190 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1191 // If the reason is an application request, this will be the package name.
1192 optional string pkgName = 4;
1193}
1194
1195/**
1196 * Logs when a Bluetooth device connects and disconnects.
1197 *
1198 * Logged from:
1199 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1200 */
1201message BluetoothConnectionStateChanged {
1202 // The state of the connection.
1203 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1204 optional android.bluetooth.ConnectionStateEnum state = 1;
1205 // An identifier that can be used to match connect and disconnect events.
1206 // Currently is last two bytes of a hash of a device level ID and
1207 // the mac address of the bluetooth device that is connected.
1208 optional int32 obfuscated_id = 2;
1209 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1210 // From android.bluetooth.BluetoothAdapter.java
1211 optional int32 bt_profile = 3;
1212}
1213
1214/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001215 * Logs when something is plugged into or removed from the USB-C connector.
1216 *
1217 * Logged from:
1218 * Vendor USB HAL.
1219 */
1220message UsbConnectorStateChanged {
1221 enum State {
1222 DISCONNECTED = 0;
1223 CONNECTED = 1;
1224 }
1225 optional State state = 1;
1226}
1227
1228/**
1229 * Logs the reported speaker impedance.
1230 *
1231 * Logged from:
1232 * Vendor audio implementation.
1233 */
1234message SpeakerImpedanceReported {
1235 optional int32 speaker_location = 1;
1236 optional int32 impedance = 2;
1237}
1238
1239/**
1240 * Logs the report of a failed hardware.
1241 *
1242 * Logged from:
1243 * Vendor HALs.
1244 *
1245 */
1246message HardwareFailed {
1247 enum HardwareType {
1248 HARDWARE_FAILED_UNKNOWN = 0;
1249 HARDWARE_FAILED_MICROPHONE = 1;
1250 HARDWARE_FAILED_CODEC = 2;
1251 HARDWARE_FAILED_SPEAKER = 3;
1252 HARDWARE_FAILED_FINGERPRINT = 4;
1253 }
1254 optional HardwareType hardware_type = 1;
1255
1256 /* hardware_location allows vendors to differentiate between multiple instances of
1257 * the same hardware_type. The specific locations are vendor defined integers,
1258 * referring to board-specific numbering schemes.
1259 */
1260 optional int32 hardware_location = 2;
1261
1262 /* failure_code is specific to the HardwareType of the failed hardware.
1263 * It should use the enum values defined below.
1264 */
1265 enum MicrophoneFailureCode {
1266 MICROPHONE_FAILURE_COMPLETE = 0;
1267 }
1268 enum CodecFailureCode {
1269 CODEC_FAILURE_COMPLETE = 0;
1270 }
1271 enum SpeakerFailureCode {
1272 SPEAKER_FAILURE_COMPLETE = 0;
1273 SPEAKER_FAILURE_HIGH_Z = 1;
1274 SPEAKER_FAILURE_SHORT = 2;
1275 }
1276 enum FingerprintFailureCode {
1277 FINGERPRINT_FAILURE_COMPLETE = 0;
1278 FINGERPRINT_SENSOR_BROKEN = 1;
1279 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1280 }
1281 optional int32 failure_code = 3;
1282}
1283
1284/**
1285 * Log an event when the device has been physically dropped.
1286 * Reported from the /vendor partition.
1287 */
1288message PhysicalDropDetected {
1289 // Confidence that the event was actually a drop, 0 -> 100
1290 optional int32 confidence_pctg = 1;
1291 // Peak acceleration of the drop, in 1/1000s of a g.
1292 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001293 // Duration of freefall in ms
1294 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001295}
1296
1297/**
1298 * Log bucketed battery charge cycles.
1299 *
1300 * Each bucket represents cycles of the battery past
1301 * a given charge point. For example, bucket 1 is the
1302 * lowest 1/8th of the battery, and bucket 8 is 100%.
1303 *
1304 * Logged from:
1305 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1306 */
1307message ChargeCyclesReported {
1308 optional int32 cycle_bucket_1 = 1;
1309 optional int32 cycle_bucket_2 = 2;
1310 optional int32 cycle_bucket_3 = 3;
1311 optional int32 cycle_bucket_4 = 4;
1312 optional int32 cycle_bucket_5 = 5;
1313 optional int32 cycle_bucket_6 = 6;
1314 optional int32 cycle_bucket_7 = 7;
1315 optional int32 cycle_bucket_8 = 8;
1316}
1317
1318/**
Howard Roa46b6582018-09-18 16:45:02 -07001319 * Log battery health snapshot.
1320 *
1321 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1322 * are snapshotted periodically over 24hrs.
1323 */
1324message BatteryHealthSnapshot {
1325 enum BatterySnapshotType {
1326 UNKNOWN = 0;
1327 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1328 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1329 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1330 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1331 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1332 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1333 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1334 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1335 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1336 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1337 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1338 }
1339 optional BatterySnapshotType type = 1;
1340 // Temperature, in 1/10ths of degree C.
1341 optional int32 temperature_deci_celcius = 2;
1342 // Voltage Battery Voltage, in microVolts.
1343 optional int32 voltage_micro_volt = 3;
1344 // Current Battery current, in microAmps.
1345 optional int32 current_micro_amps = 4;
1346 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1347 optional int32 open_circuit_micro_volt = 5;
1348 // Resistance Battery Resistance, in microOhms.
1349 optional int32 resistance_micro_ohm = 6;
1350 // Level Battery Level, as % of full.
1351 optional int32 level_percent = 7;
1352}
1353
1354/**
1355 * Log slow I/O operations on the primary storage.
1356 */
1357message SlowIo {
1358 // Classifications of IO Operations.
1359 enum IoOperation {
1360 UNKNOWN = 0;
1361 READ = 1;
1362 WRITE = 2;
1363 UNMAP = 3;
1364 SYNC = 4;
1365 }
1366 optional IoOperation operation = 1;
1367
1368 // The number of slow IO operations of this type over 24 hours.
1369 optional int32 count = 2;
1370}
1371
1372/**
1373 * Log battery caused shutdown with the last recorded voltage.
1374 */
1375message BatteryCausedShutdown {
1376 // The last recorded battery voltage prior to shutdown.
1377 optional int32 last_recorded_micro_volt = 1;
1378}
1379
1380/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001381 * Logs the duration of a davey (jank of >=700ms) when it occurs
1382 *
1383 * Logged from:
1384 * frameworks/base/libs/hwui/JankTracker.cpp
1385 */
1386message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001387 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001388 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001389
Tej Singhbb8554a2018-01-26 11:59:14 -08001390 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001391 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001392}
1393
1394/**
Bookatze5885242017-10-24 20:10:31 -07001395 * Logs phone signal strength changes.
1396 *
1397 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001398 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001399 */
1400message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001401 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1402 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001403}
1404
1405/**
1406 * Logs that a setting was updated.
1407 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001408 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001409 * The tag and is_default allow resetting of settings to default values based on the specified
1410 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1411 */
1412message SettingChanged {
1413 // The name of the setting.
1414 optional string setting = 1;
1415
1416 // The change being imposed on this setting. May represent a number, eg "3".
1417 optional string value = 2;
1418
1419 // The new value of this setting. For most settings, this is same as value. For some settings,
1420 // value is +X or -X where X represents an element in a set. For example, if the previous value
1421 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1422 // The +/- feature is currently only used for location_providers_allowed.
1423 optional string new_value = 3;
1424
1425 // The previous value of this setting.
1426 optional string prev_value = 4;
1427
1428 // The tag used with the is_default for resetting sets of settings. This is generally null.
1429 optional string tag = 5;
1430
Bookatz90867622018-01-31 15:05:57 -08001431 // True if this setting with tag should be resettable.
1432 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001433
David Chenbd789912018-03-16 17:19:55 -07001434 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001435 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001436
1437 enum ChangeReason {
1438 UPDATED = 1; // Updated can be an insertion or an update.
1439 DELETED = 2;
1440 }
1441 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001442}
Chenjie Yub3dda412017-10-24 13:41:59 -07001443
Chenjie Yu05013b32017-11-21 10:21:41 -08001444/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001445 * Logs activity going to foreground or background
1446 *
1447 * Logged from:
1448 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1449 */
1450message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001451 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001452 optional string pkg_name = 2;
1453 optional string class_name = 3;
1454
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001455 enum State {
1456 BACKGROUND = 0;
1457 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001458 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001459 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001460}
David Chenc8a43242017-10-17 16:23:28 -07001461
1462/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001463 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001464 * Logged from:
1465 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1466 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001467message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001468 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001469
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001470 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001471
1472 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001473 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001474 optional string process_name = 3;
1475
1476 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001477 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001478
1479 optional string package_name = 5;
1480
1481 enum InstantApp {
1482 UNAVAILABLE = 0;
1483 FALSE = 1;
1484 TRUE = 2;
1485 }
1486 optional InstantApp is_instant_app = 6;
1487
1488 enum ForegroundState {
1489 UNKNOWN = 0;
1490 BACKGROUND = 1;
1491 FOREGROUND = 2;
1492 }
1493 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001494}
David Chen9e3808c2017-11-20 17:25:34 -08001495
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001496/**
1497 * Logs when a WTF (What a Terrible Failure) happened.
1498 * Logged from:
1499 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1500 */
1501message WTFOccurred {
1502 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001503
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001504 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001505
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001506 // The name of the process.
1507 // system_server if it is not by an app
1508 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001509
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001510 // The pid if available. -1 means not available.
1511 optional sint32 pid = 4;
1512}
1513
1514/**
1515 * Logs when system server reports low memory.
1516 * Logged from:
1517 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1518 */
1519message LowMemReported {
1520}
1521
1522/**
1523 * Logs when an app ANR (App Not Responding) occurs.
1524 * Logged from:
1525 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1526 */
1527message ANROccurred {
1528 optional int32 uid = 1 [(is_uid) = true];
1529
1530 optional string process_name = 2;
1531
1532 optional string short_component_name = 3;
1533
1534 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001535
1536 enum InstantApp {
1537 UNAVAILABLE = 0;
1538 FALSE = 1;
1539 TRUE = 2;
1540 }
1541 optional InstantApp is_instant_app = 5;
1542
1543 enum ForegroundState {
1544 UNKNOWN = 0;
1545 BACKGROUND = 1;
1546 FOREGROUND = 2;
1547 }
1548 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08001549}
1550
Bookatza7020bd2018-08-28 16:29:35 -07001551/**
1552 * Logs when the vibrator state changes.
1553 * Logged from:
1554 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1555 */
1556message VibratorStateChanged {
1557 repeated AttributionNode attribution_node = 1;
1558
1559 enum State {
1560 OFF = 0;
1561 ON = 1;
1562 }
1563 optional State state = 2;
1564
1565 // Duration (in milliseconds) requested to keep the vibrator on.
1566 // Only applicable for State == ON.
1567 optional int64 duration_millis = 3;
1568}
1569
David Chen0a368b22017-12-06 16:28:16 -08001570/*
1571 * Allows other apps to push events into statsd.
1572 * Logged from:
1573 * frameworks/base/core/java/android/util/StatsLog.java
1574 */
David Chen0b5c90c2018-01-25 16:51:49 -08001575message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001576 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001577 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001578
1579 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1580 optional int32 label = 2;
1581
1582 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1583 // predicates for the metrics).
1584 enum State {
1585 UNKNOWN = 0;
1586 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1587 STOP = 2;
1588 START = 3;
1589 }
1590 optional State state = 3;
1591}
1592
David Chen9e3808c2017-11-20 17:25:34 -08001593/**
Bookatz7948c872018-09-04 12:58:33 -07001594 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1595 * For example, this could be due to the user manually changing the time.
1596 *
1597 * Logged from:
1598 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1599 */
1600message WallClockTimeShifted {
1601 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1602 optional int64 wall_clock_timestamp_millis = 1;
1603}
1604
1605/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001606 * Logs when statsd detects an anomaly.
1607 *
1608 * Logged from:
1609 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1610 */
1611message AnomalyDetected {
1612 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001613 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001614
Yangster-mac94e197c2018-01-02 16:03:03 -08001615 // Id of the config whose anomaly detection alert fired.
1616 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001617
Yangster-mac94e197c2018-01-02 16:03:03 -08001618 // Id of the alert (i.e. name of the anomaly that was detected).
1619 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001620}
1621
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001622message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001623 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001624 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001625
1626 // The app package name.
1627 optional string pkg_name = 2;
1628
1629 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001630 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001631 WARM = 1;
1632 HOT = 2;
1633 COLD = 3;
1634 }
1635 // The transition type.
1636 optional TransitionType type = 3;
1637
1638 // The activity name.
1639 optional string activity_name = 4;
1640
1641 // The name of the calling app. Empty if not set.
1642 optional string calling_pkg_name = 5;
1643
1644 // Whether the app is an instant app.
1645 optional bool is_instant_app = 6;
1646
1647 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001648 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001649
Bookatz80d11a02018-01-16 10:46:35 -08001650 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001651
David Chen0b5c90c2018-01-25 16:51:49 -08001652 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001653 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001654 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001655 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001656 optional int32 bind_application_delay_millis = 11;
1657 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001658
1659 // Empty if not set.
1660 optional string launch_token = 13;
1661
Calin Juravle759fbda2018-02-20 19:52:30 +00001662 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001663 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001664
1665 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001666 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001667}
1668
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001669message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001670 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001671 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001672
1673 // The app package name.
1674 optional string pkg_name = 2;
1675
1676 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001677 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001678 WARM = 1;
1679 HOT = 2;
1680 COLD = 3;
1681 }
1682 // The transition type.
1683 optional TransitionType type = 3;
1684
1685 // The activity name.
1686 optional string activity_name = 4;
1687}
1688
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001689message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001690 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001691 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001692
1693 // The app package name.
1694 optional string pkg_name = 2;
1695
1696 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001697 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001698 WITH_BUNDLE = 1;
1699 WITHOUT_BUNDLE = 2;
1700 }
1701 // The transition type.
1702 optional TransitionType type = 3;
1703
1704 // The activity name.
1705 optional string activity_name = 4;
1706
1707 optional bool transition_process_running = 5;
1708
1709 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001710 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001711}
1712
Bookatz8fcd09a2017-12-18 13:01:10 -08001713/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001714 * Logs a picture-in-picture action
1715 * Logged from:
1716 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1717 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1718 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1719 */
1720message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001721 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001722 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001723
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001724 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001725
Chenjie Yu52cacc62017-12-08 18:11:45 -08001726 enum State {
1727 ENTERED = 1;
1728 EXPANDED_TO_FULL_SCREEN = 2;
1729 MINIMIZED = 3;
1730 DISMISSED = 4;
1731 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001732 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001733}
1734
1735/**
Chenjie Yue8904192017-12-08 19:12:57 -08001736 * Logs overlay action
1737 * Logged from:
1738 * services/core/java/com/android/server/wm/Session.java
1739 */
1740message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001741 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001742
1743 optional string package_name = 2;
1744
1745 optional bool using_alert_window = 3;
1746
1747 enum State {
1748 ENTERED = 1;
1749 EXITED = 2;
1750 }
1751 optional State state = 4;
1752}
1753
Chenjie Yuccfe6452018-01-30 11:33:21 -08001754/*
1755 * Logs foreground service starts and stops.
1756 * Note that this is not when a service starts or stops, but when it is
1757 * considered foreground.
1758 * Logged from
1759 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1760 */
1761message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001762 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001763 // package_name + "/" + class_name
1764 optional string short_name = 2;
1765
1766 enum State {
1767 ENTER = 1;
1768 EXIT = 2;
1769 }
1770 optional State state = 3;
1771}
1772
Chenjie Yue8904192017-12-08 19:12:57 -08001773/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001774 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1775 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1776 * attributed back to the parent (host) uid. One example is Chrome.
1777 *
1778 * Logged from:
1779 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1780 */
1781message IsolatedUidChanged {
1782 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001783 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001784 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001785 optional int32 parent_uid = 1;
1786
1787 optional int32 isolated_uid = 2;
1788
1789 // We expect an isolated uid to be removed before if it's used for another parent uid.
1790 enum Event {
1791 REMOVED = 0;
1792 CREATED = 1;
1793 }
1794 optional Event event = 3;
1795}
1796
1797/*
1798 * Logs the reception of an incoming network packet causing the main system to wake up for
1799 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1800 * and processed by WakeupController.cpp.
1801 */
1802message PacketWakeupOccurred {
1803 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1804 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001805 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001806 // The interface name on which the packet was received.
1807 optional string iface = 2;
1808 // The ethertype value of the packet.
1809 optional int32 ethertype = 3;
1810 // String representation of the destination MAC address of the packet.
1811 optional string destination_hardware_address = 4;
1812 // String representation of the source address of the packet if this was an IP packet.
1813 optional string source_ip = 5;
1814 // String representation of the destination address of the packet if this was an IP packet.
1815 optional string destination_ip = 6;
1816 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1817 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1818 // families.
1819 optional int32 ip_next_header = 7;
1820 // The source port if this was a TCP or UDP packet.
1821 optional int32 source_port = 8;
1822 // The destination port if this was a TCP or UDP packet.
1823 optional int32 destination_port = 9;
1824}
1825
1826/*
1827 * Logs the memory stats for an app on startup.
1828 * Logged from:
1829 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1830 */
1831message AppStartMemoryStateCaptured {
1832 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001833 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001834
1835 // The process name.
1836 optional string process_name = 2;
1837
1838 // The activity name.
1839 optional string activity_name = 3;
1840
1841 // # of page-faults
1842 optional int64 pgfault = 4;
1843
1844 // # of major page-faults
1845 optional int64 pgmajfault = 5;
1846
1847 // RSS
1848 optional int64 rss_in_bytes = 6;
1849
1850 // CACHE
1851 optional int64 cache_in_bytes = 7;
1852
1853 // SWAP
1854 optional int64 swap_in_bytes = 8;
1855}
1856
1857/*
1858 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1859 * for LMK event.
1860 * Logged from:
1861 * system/core/lmkd/lmkd.c
1862 */
1863message LmkStateChanged {
1864 enum State {
1865 UNKNOWN = 0;
1866 START = 1;
1867 STOP = 2;
1868 }
1869 optional State state = 1;
1870}
1871
1872/*
1873 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1874 * Logged from:
1875 * system/core/lmkd/lmkd.c
1876 */
1877message LmkKillOccurred {
1878 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001879 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001880
1881 // The process name.
1882 optional string process_name = 2;
1883
1884 // oom adj score.
1885 optional int32 oom_score = 3;
1886
1887 // # of page-faults
1888 optional int64 pgfault = 4;
1889
1890 // # of major page-faults
1891 optional int64 pgmajfault = 5;
1892
1893 // RSS
1894 optional int64 rss_in_bytes = 6;
1895
1896 // CACHE
1897 optional int64 cache_in_bytes = 7;
1898
1899 // SWAP
1900 optional int64 swap_in_bytes = 8;
1901}
1902
Rajeev Kumar51b54602018-03-01 12:18:26 -08001903/*
1904 * Logs when the ActivityManagerService detects that an app died.
1905 *
1906 * Logged from:
1907 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1908 */
1909message AppDied {
1910 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07001911 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08001912}
1913
Howard Ro21a039c2018-08-06 14:55:47 -07001914/**
1915 * An atom for generic metrics logging. Available from Android Q.
1916 */
1917message GenericAtom {
1918 // The uid of the application that sent this custom atom.
1919 optional int32 uid = 1 [(is_uid) = true];
1920
1921 // An event_id indicates the type of event.
Howard Ro0546d542018-08-30 16:23:44 -07001922 optional android.os.statsd.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07001923}
1924
Tej Singhd6d6d772018-09-05 17:41:25 -07001925/**
1926 * Logs when a fingerprint acquire event occurs.
1927 *
1928 * Logged from:
1929 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1930 */
1931message FingerprintAcquired {
1932 // The associated user. Eg: 0 for owners, 10+ for others.
1933 // Defined in android/os/UserHandle.java
1934 optional int32 user = 1;
1935 // If this acquire is for a crypto fingerprint.
1936 // e.g. Secure purchases, unlock password storage.
1937 optional bool is_crypto = 2;
1938}
1939
1940/**
1941 * Logs when a fingerprint authentication event occurs.
1942 *
1943 * Logged from:
1944 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1945 */
1946message FingerprintAuthenticated {
1947 // The associated user. Eg: 0 for owners, 10+ for others.
1948 // Defined in android/os/UserHandle.java
1949 optional int32 user = 1;
1950 // If this authentication is for a crypto fingerprint.
1951 // e.g. Secure purchases, unlock password storage.
1952 optional bool is_crypto = 2;
1953 // Whether or not this authentication was successful.
1954 optional bool is_authenticated = 3;
1955}
1956
1957/**
1958 * Logs when a fingerprint error occurs.
1959 *
1960 * Logged from:
1961 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1962 */
1963message FingerprintErrorOccurred {
1964 // The associated user. Eg: 0 for owners, 10+ for others.
1965 // Defined in android/os/UserHandle.java
1966 optional int32 user = 1;
1967 // If this error is for a crypto fingerprint.
1968 // e.g. Secure purchases, unlock password storage.
1969 optional bool is_crypto = 2;
1970
1971 enum Error {
1972 UNKNOWN = 0;
1973 LOCKOUT = 1;
1974 PERMANENT_LOCKOUT = 2;
1975 }
1976 // The type of error.
1977 optional Error error = 3;
1978}
Howard Ro688ae182018-09-25 00:09:36 -07001979
1980message Notification {
1981
1982 // Type of notification event.
1983 enum Type {
1984 TYPE_UNKNOWN = 0;
1985 // Notification became visible to the user.
1986 TYPE_OPEN = 1;
1987 // Notification became hidden.
1988 TYPE_CLOSE = 2;
1989 // Notification switched to detail mode.
1990 TYPE_DETAIL = 3;
1991 // Notification was clicked.
1992 TYPE_ACTION = 4;
1993 // Notification was dismissed.
1994 TYPE_DISMISS = 5;
1995 // Notification switched to summary mode. The enum value of 14 is to
1996 // match that of metrics_constants.
1997 TYPE_COLLAPSE = 14;
1998 }
1999 optional Type type = 1;
2000
2001 // Package name associated with the notification.
2002 optional string package_name = 2;
2003
2004 // Tag associated with notification.
2005 optional string tag = 3;
2006
2007 // Application-supplied ID associated with the notification.
2008 optional int32 id = 4;
2009
2010 // Index of notification in the notification panel.
2011 optional int32 shade_index = 5;
2012
2013 // The number of notifications in the notification panel.
2014 optional int32 shade_count = 6;
2015
2016 // Importance for the notification.
2017 optional int32 importance = 7;
2018
2019 // ID for the notification channel.
2020 optional int32 channel_id = 8;
2021
2022 // Importance for the notification channel.
2023 optional int32 channel_importance = 9;
2024
2025 // Whether notification was a group summary.
2026 optional bool group_summary = 10;
2027
2028 // Time since notification was created in milliseconds.
2029 optional int64 since_create_millis = 11;
2030
2031 // Time since notification was interrupted in milliseconds.
2032 optional int64 since_interruption_millis = 12;
2033
2034 // Time since notification was updated in milliseconds.
2035 optional int64 since_update_millis = 13;
2036
2037 // Time since notification was visible in milliseconds.
2038 optional int64 since_visible_millis = 14;
2039}
2040
2041
Chenjie Yubbcbc602018-02-05 16:51:52 -08002042//////////////////////////////////////////////////////////////////////
2043// Pulled atoms below this line //
2044//////////////////////////////////////////////////////////////////////
2045
2046/**
David Chenc8a43242017-10-17 16:23:28 -07002047 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2048 *
2049 * Pulled from:
2050 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2051 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002052message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002053 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002054
2055 optional int64 rx_bytes = 2;
2056
2057 optional int64 rx_packets = 3;
2058
2059 optional int64 tx_bytes = 4;
2060
2061 optional int64 tx_packets = 5;
2062}
2063
2064/**
2065 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2066 *
2067 * Pulled from:
2068 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2069 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002070message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002071 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002072
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002073 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2074 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002075
2076 optional int64 rx_bytes = 3;
2077
2078 optional int64 rx_packets = 4;
2079
2080 optional int64 tx_bytes = 5;
2081
2082 optional int64 tx_packets = 6;
2083}
2084
2085/**
2086 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2087 *
2088 * Pulled from:
2089 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2090 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002091message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002092 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002093
2094 optional int64 rx_bytes = 2;
2095
2096 optional int64 rx_packets = 3;
2097
2098 optional int64 tx_bytes = 4;
2099
2100 optional int64 tx_packets = 5;
2101}
2102
2103/**
2104 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2105 *
2106 * Pulled from:
2107 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2108 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002109message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002110 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002111
Yao Chenc40a19d2018-03-15 16:48:25 -07002112 // 1 denotes foreground and 0 denotes background. This is called Set in
2113 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002114 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002115
2116 optional int64 rx_bytes = 3;
2117
2118 optional int64 rx_packets = 4;
2119
2120 optional int64 tx_bytes = 5;
2121
2122 optional int64 tx_packets = 6;
2123}
2124
2125/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002126 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2127 *
2128 * Pulled from:
2129 * StatsCompanionService
2130 */
2131message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002132 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002133
2134 optional int64 rx_bytes = 2;
2135
2136 optional int64 tx_bytes = 3;
2137}
2138
2139/**
David Chenc8a43242017-10-17 16:23:28 -07002140 * Pulls the kernel wakelock durations. This atom is adapted from
2141 * android/internal/os/KernelWakelockStats.java
2142 *
2143 * Pulled from:
2144 * StatsCompanionService using KernelWakelockReader.
2145 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002146message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002147 optional string name = 1;
2148
2149 optional int32 count = 2;
2150
2151 optional int32 version = 3;
2152
2153 optional int64 time = 4;
2154}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002155
Chenjie Yu05013b32017-11-21 10:21:41 -08002156/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002157 * Pulls low power state information. This includes platform and subsystem sleep state information,
2158 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002159 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002160 * hardware/interfaces/power/1.1/types.hal
2161 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002162message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002163 // Subsystem name
2164 optional string subsystem_name = 1;
2165 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2166 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2167 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002168 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002169 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002170 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002171 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002172}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002173
Chenjie Yu05013b32017-11-21 10:21:41 -08002174/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002175 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002176 * Pulls the time the cpu spend on the frequency index. Frequency index
2177 * starts from highest to lowest. The value should be monotonically
2178 * increasing since boot. However, if there is a cpu
2179 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002180 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002181message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002182 optional uint32 cluster = 1;
2183 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002184 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002185}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002186
Chenjie Yu05013b32017-11-21 10:21:41 -08002187/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002188 * Pulls Cpu Time Per Uid.
2189 * Note that isolated process uid time should be attributed to host uids.
2190 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002191message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002192 optional int32 uid = 1 [(is_uid) = true];
David Chen0b5c90c2018-01-25 16:51:49 -08002193 optional uint64 user_time_millis = 2;
2194 optional uint64 sys_time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002195}
2196
2197/**
2198 * Pulls Cpu Time Per Uid per frequency.
2199 * Note that isolated process uid time should be attributed to host uids.
2200 * For each uid, we order the time by descending frequencies.
2201 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002202message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002203 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002204 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002205 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002206}
Hugo Benichi884970e2017-11-14 22:42:46 +09002207
Chenjie Yu05013b32017-11-21 10:21:41 -08002208/**
2209 * Pulls Wifi Controller Activity Energy Info
2210 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002211message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002212 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002213 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002214 // stack reported state
2215 // TODO: replace this with proto enum
2216 optional int32 stack_state = 2;
2217 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002218 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002219 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002220 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002221 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002222 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002223 // product of current(mA), voltage(V) and time(ms)
2224 optional uint64 controller_energy_used = 6;
2225}
2226
2227/**
2228 * Pulls Modem Activity Energy Info
2229 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002230message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002231 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002232 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002233 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08002234 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08002235 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002236 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002237 /**
2238 * Tx power index
2239 * index 0 = tx_power < 0dBm
2240 * index 1 = 0dBm < tx_power < 5dBm
2241 * index 2 = 5dBm < tx_power < 15dBm
2242 * index 3 = 15dBm < tx_power < 20dBm
2243 * index 4 = tx_power > 20dBm
2244 */
2245 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002246 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002247 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002248 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002249 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002250 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002251 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002252 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002253 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002254 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002255 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002256 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002257 // product of current(mA), voltage(V) and time(ms)
2258 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002259}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002260
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002261/**
2262 * Pulls Bluetooth Activity Energy Info
2263 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2264 */
2265message BluetoothActivityInfo {
2266 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002267 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002268 // bluetooth stack state
2269 optional int32 bluetooth_stack_state = 2;
2270 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002271 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002272 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002273 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002274 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002275 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002276 // product of current(mA), voltage(V) and time(ms)
2277 optional uint64 energy_used = 6;
2278}
2279
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002280/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002281 * Logs the memory stats for a process.
2282 */
2283message ProcessMemoryState {
2284 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002285 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002286
2287 // The process name.
2288 optional string process_name = 2;
2289
2290 // oom adj score.
2291 optional int32 oom_score = 3;
2292
2293 // # of page-faults
2294 optional int64 pgfault = 4;
2295
2296 // # of major page-faults
2297 optional int64 pgmajfault = 5;
2298
Rajeev Kumar90235992018-01-29 11:06:48 -08002299 // RSS
2300 optional int64 rss_in_bytes = 6;
2301
2302 // CACHE
2303 optional int64 cache_in_bytes = 7;
2304
2305 // SWAP
2306 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002307
2308 // RSS high watermark.
2309 // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status or
2310 // from memory.max_usage_in_bytes under /dev/memcg if the device uses per-app memory cgroups.
2311 optional int64 rss_high_watermark_in_bytes = 9;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002312}
2313
2314/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002315 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002316 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002317message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002318 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002319}
2320
2321/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002322 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002323 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002324message SystemUptime {
2325 // Milliseconds since the system was booted.
2326 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2327 // for external input).
2328 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002329 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002330}
2331
2332/*
2333 * Reads from /proc/uid_concurrent_active_time which has the format:
2334 * active: X (X is # cores)
2335 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2336 * [uid1]: [time-0] [time-1] [time-2] ... ...
2337 * ...
2338 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2339 * The file contains a monotonically increasing count of time for a single boot.
2340 */
2341message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002342 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002343 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002344}
2345
2346/**
2347 * Reads from /proc/uid_concurrent_policy_time which has the format:
2348 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2349 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2350 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2351 * ...
2352 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2353 * The file contains a monotonically increasing count of time for a single boot.
2354 */
2355message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002356 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002357 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002358 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002359}
2360
2361/*
2362 * Pulls free disk space, for data, system partition and temporary directory.
2363 */
2364message DiskSpace {
2365 // available bytes in data partition
2366 optional uint64 data_available_bytes = 1;
2367 // available bytes in system partition
2368 optional uint64 system_available_bytes = 2;
2369 // available bytes in download cache or temp directories
2370 optional uint64 temp_available_bytes = 3;
2371}
Tej Singhbf972d92018-01-10 20:51:13 -08002372
2373/**
2374 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002375 * Pulled from:
2376 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002377 */
2378message RemainingBatteryCapacity {
2379 optional int32 charge_uAh = 1;
2380}
2381
2382/**
2383 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002384 * Pulled from:
2385 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002386 */
2387message FullBatteryCapacity {
2388 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08002389}
2390
2391/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002392 * Pulls battery voltage.
2393 * Pulled from:
2394 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2395 */
2396message BatteryVoltage {
2397 // The voltage of the battery, in millivolts.
2398 optional int32 voltage_mV = 1;
2399}
2400
2401/**
Tej Singhd89137e2018-03-26 14:51:40 -07002402 * Pulls the temperature of various parts of the device.
2403 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002404 *
2405 * Pulled from:
2406 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2407 */
2408message Temperature {
2409 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2410 optional android.os.TemperatureTypeEnum sensor_location = 1;
2411
2412 // The name of the temperature source. Eg. CPU0
2413 optional string sensor_name = 2;
2414
Tej Singhd89137e2018-03-26 14:51:40 -07002415 // Temperature in tenths of a degree C.
2416 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08002417}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002418
2419/**
2420 * Pulls the statistics of calls to Binder.
2421 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002422 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2423 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002424 *
2425 * Next tag: 14
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002426 */
2427message BinderCalls {
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002428 optional int32 uid = 1 [(is_uid) = true];
2429 // Fully qualified class name of the API call.
2430 //
2431 // This is a system server class name.
2432 //
2433 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2434 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2435 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2436 // commonly used APIs.
2437 optional string service_class_name = 2;
2438 // Method name of the API call. It can also be a transaction code if we cannot
2439 // resolve it to a name. See Binder#getTransactionName.
2440 //
2441 // This is a system server method name.
2442 optional string service_method_name = 3;
2443 // Total number of API calls.
2444 optional int64 call_count = 4;
2445 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2446 optional bool screen_interactive = 13;
2447 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2448 // call_count will be equal to recorded_call_count.
2449 //
2450 // If recorded_call_count is different than call_count, it means data collection has been
2451 // sampled. All the fields below will be sampled in this case.
2452 optional int64 recorded_call_count = 12;
2453 // Number of exceptions thrown by the API.
2454 optional int64 recorded_exception_count = 5;
2455 // Total latency of all API calls.
2456 // Average can be computed using total_latency_micros / recorded_call_count.
2457 optional int64 recorded_total_latency_micros = 6;
2458 // Maximum latency of one API call.
2459 optional int64 recorded_max_latency_micros = 7;
2460 // Total CPU usage of all API calls.
2461 // Average can be computed using total_cpu_micros / recorded_call_count.
2462 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2463 optional int64 recorded_total_cpu_micros = 8;
2464 // Maximum CPU usage of one API call.
2465 optional int64 recorded_max_cpu_micros = 9;
2466 // Maximum parcel reply size of one API call.
2467 optional int64 recorded_max_reply_size_bytes = 10;
2468 // Maximum parcel request size of one API call.
2469 optional int64 recorded_max_request_size_bytes = 11;
2470}
2471
2472/**
2473 * Pulls the statistics of exceptions during calls to Binder.
2474 *
2475 * Binder stats are cumulative from boot unless somebody reset the data using
2476 * > adb shell dumpsys binder_calls_stats --reset
2477 */
2478message BinderCallsExceptions {
2479 // Exception class name, e.g. java.lang.IllegalArgumentException.
2480 //
2481 // This is an exception class name thrown by the system server.
2482 optional string exception_class_name = 1;
2483 // Total number of exceptions.
2484 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002485}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002486
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002487/**
2488 * Pulls the statistics of message dispatching on HandlerThreads.
2489 *
2490 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2491 * config on the device.
2492 *
2493 * Next tag: 11
2494 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002495message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002496 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002497 optional int32 uid = 1 [(is_uid) = true];
2498
2499 // Fully qualified class name of the handler target class.
2500 //
2501 // This field does not contain PII. This is a system server class name.
2502 optional string handler_class_name = 2;
2503
2504 // The name of the thread that runs the Looper.
2505 //
2506 // This field does not contain PII. This is a system server thread name.
2507 optional string looper_thread_name = 3;
2508
2509 // The name of the dispatched message.
2510 //
2511 // This field does not contain PII. This is a system server constant or class
2512 // name.
2513 optional string message_name = 4;
2514
2515 // Total number of successfully dispatched messages.
2516 optional int64 message_count = 5;
2517
2518 // Total number of messages that failed dispatching.
2519 optional int64 exception_count = 6;
2520
2521 // Total number of processed messages we have data recorded for. If we
2522 // collected data for all the messages, message_count will be equal to
2523 // recorded_message_count.
2524 //
2525 // If recorded_message_count is different than message_count, it means data
2526 // collection has been sampled. All the fields below will be sampled in this
2527 // case.
2528 optional int64 recorded_message_count = 7;
2529
2530 // Total latency of all processed messages.
2531 // Average can be computed using recorded_total_latency_micros /
2532 // recorded_message_count.
2533 optional int64 recorded_total_latency_micros = 8;
2534
2535 // Total CPU usage of all processed message.
2536 // Average can be computed using recorded_total_cpu_micros /
2537 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002538 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002539 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002540
2541 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2542 optional bool screen_interactive = 10;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002543}
Tej Singh86dc9db2018-09-06 00:39:57 +00002544
2545/**
2546 * Pulls disk information, such as write speed and latency.
2547 */
2548message DiskStats {
2549 // Time taken to open, write 512B to, and close a file.
2550 // -1 if error performing the check.
2551 optional int64 data_write_latency_millis = 1;
2552
2553 optional bool file_based_encryption = 2;
2554
2555 // Recent disk write speed in kB/s.
2556 // -1 if error querying storageed.
2557 // 0 if data is unavailable.
2558 optional int32 recent_disk_write_speed = 3;
2559}
2560
2561
2562/**
2563 * Free and total bytes of the Data, Cache, and System partition.
2564 */
2565message DirectoryUsage {
2566 enum Directory {
2567 UNKNOWN = 0;
2568 DATA = 1;
2569 CACHE = 2;
2570 SYSTEM = 3;
2571 }
2572 optional Directory directory = 1;
2573 optional int64 free_bytes = 2;
2574 optional int64 total_bytes = 3;
2575}
2576
2577
2578/**
2579 * Size of an application: apk size, data size, and cache size.
2580 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2581 * Information is only reported for apps with the primary user (user 0).
2582 * Sizes are aggregated by package name.
2583 */
2584message AppSize {
2585 // Including uids will involve modifying diskstats logic.
2586 optional string package_name = 1;
2587 // App size in bytes. -1 if unavailable.
2588 optional int64 app_size_bytes = 2;
2589 // App data size in bytes. -1 if unavailable.
2590 optional int64 app_data_size_bytes = 3;
2591 // App cache size in bytes. -1 if unavailable.
2592 optional int64 app_cache_size_bytes = 4;
2593 // Time that the cache file was produced.
2594 // Uses System.currentTimeMillis(), which is wall clock time.
2595 optional int64 cache_time_millis = 5;
2596}
2597
2598
2599/**
2600 * Size of a particular category. Eg: photos, videos.
2601 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2602 */
2603message CategorySize {
2604 enum Category {
2605 UNKNOWN = 0;
2606 APP_SIZE = 1;
2607 APP_DATA_SIZE = 2;
2608 APP_CACHE_SIZE = 3;
2609 PHOTOS = 4;
2610 VIDEOS = 5;
2611 AUDIO = 6;
2612 DOWNLOADS = 7;
2613 SYSTEM = 8;
2614 OTHER = 9;
2615 }
2616 optional Category category = 1;
2617 // Category size in bytes.
2618 optional int64 size_bytes = 2;
2619 // Time that the cache file was produced.
2620 // Uses System.currentTimeMillis(), which is wall clock time.
2621 optional int64 cache_time_millis = 3;
2622}
Tej Singhd6d6d772018-09-05 17:41:25 -07002623
2624/**
2625 * Pulls the number of fingerprints for each user.
2626 *
2627 * Pulled from StatsCompanionService, which queries FingerprintManager.
2628 */
2629message NumFingerprints {
2630 // The associated user. Eg: 0 for owners, 10+ for others.
2631 // Defined in android/os/UserHandle.java
2632 optional int32 user = 1;
2633 // Number of fingerprints registered to that user.
2634 optional int32 num_fingerprints = 2;
2635}
Chenjie Yu12e5e672018-09-14 15:54:59 -07002636
2637/**
2638 * Pulled from ProcessStatsService.java
2639 */
2640message ProcStats {
2641 optional android.service.procstats.ProcessStatsSectionProto proc_stats_section = 1;
2642}