blob: 485b91fb8ece9bb89705124e30c1011e92813d21 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080026import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080027import "frameworks/base/core/proto/android/os/enums.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080028import "frameworks/base/core/proto/android/server/enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080029import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080030import "frameworks/base/core/proto/android/telephony/enums.proto";
31import "frameworks/base/core/proto/android/view/enums.proto";
Howard Ro0546d542018-08-30 16:23:44 -070032import "frameworks/base/proto/src/stats_enums.proto";
Chenjie Yu159e4f82018-08-29 11:49:11 -070033import "frameworks/base/core/proto/android/service/procstats.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080034
Yao Chend54f9dd2017-10-17 17:37:48 +000035/**
Stefan Lafonae2df012017-11-14 09:17:21 -080036 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000037 * raw stats log events from the Android system, also known as "atoms."
38 *
39 * This field contains a single oneof with all of the available messages.
40 * The stats-log-api-gen tool runs as part of the Android build and
41 * generates the android.util.StatsLog class, which contains the constants
42 * and methods that Android uses to log.
43 *
Stefan Lafonae2df012017-11-14 09:17:21 -080044 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000045 * Instead, statsd on Android constructs these messages synthetically,
46 * in the format defined here and in stats_log.proto.
47 */
Stefan Lafonae2df012017-11-14 09:17:21 -080048message Atom {
49 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070050 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070051 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
52 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070053 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070054 BleScanResultReceived ble_scan_result_received = 4;
55 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080056 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070057 SyncStateChanged sync_state_changed = 7;
58 ScheduledJobStateChanged scheduled_job_state_changed = 8;
59 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070060 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080061 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
62 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
63 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070064 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
65 MemoryFactorStateChanged memory_factor_state_changed = 15;
66 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
67 CachedKillReported cached_kill_reported = 17;
68 ProcessMemoryStatReported process_memory_stat_reported = 18;
69 // 19 is available
Bookatzddccf0a2017-11-28 16:48:14 -080070 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
71 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
72 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070073 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080074 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070075 CameraStateChanged camera_state_changed = 25;
76 FlashlightStateChanged flashlight_state_changed = 26;
77 UidProcessStateChanged uid_process_state_changed = 27;
78 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
79 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070080 BatteryLevelChanged battery_level_changed = 30;
81 ChargingStateChanged charging_state_changed = 31;
82 PluggedStateChanged plugged_state_changed = 32;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080083 // 33 - 34 are available
Bookatz8c6571b2017-10-24 15:04:41 -070084 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
85 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070086 WifiLockStateChanged wifi_lock_state_changed = 37;
87 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
88 WifiScanStateChanged wifi_scan_state_changed = 39;
89 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070090 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070091 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070092 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090093 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -070094 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -080095 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080096 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080097 AppStartOccurred app_start_occurred = 48;
98 AppStartCanceled app_start_canceled = 49;
99 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800100 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800101 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800102 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800103 LmkStateChanged lmk_state_changed = 54;
104 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800105 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800106 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800107 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800108 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800109 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800110 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800111 KeyguardStateChanged keyguard_state_changed = 62;
112 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
113 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800114 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800115 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800116 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
117 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Tej Singh02200f92018-04-02 19:37:59 -0700118 // 69 is blank but need not be.
Andrew Chantb56388b2018-03-22 21:07:33 -0700119 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800120 SpeakerImpedanceReported speaker_impedance_reported = 71;
121 HardwareFailed hardware_failed = 72;
122 PhysicalDropDetected physical_drop_detected = 73;
123 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800124 MobileConnectionStateChanged mobile_connection_state_changed = 75;
125 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700126 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800127 AppCrashOccurred app_crash_occurred = 78;
128 ANROccurred anr_occurred = 79;
129 WTFOccurred wtf_occurred = 80;
130 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700131 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700132 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700133 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700134 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700135 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700136 FingerprintAcquired fingerprint_acquired = 87;
137 FingerprintAuthenticated fingerprint_authenticated = 88;
138 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Yao Chend54f9dd2017-10-17 17:37:48 +0000139 }
David Chenc8a43242017-10-17 16:23:28 -0700140
David Chen6e3e6cb2018-01-03 16:14:06 -0800141 // Pulled events will start at field 10000.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100142 // Next: 10025
David Chenc8a43242017-10-17 16:23:28 -0700143 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800144 WifiBytesTransfer wifi_bytes_transfer = 10000;
145 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
146 MobileBytesTransfer mobile_bytes_transfer = 10002;
147 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800148 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800149 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800150 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800151 CpuTimePerFreq cpu_time_per_freq = 10008;
152 CpuTimePerUid cpu_time_per_uid = 10009;
153 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800154 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800155 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800156 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800157 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800158 SystemElapsedRealtime system_elapsed_realtime = 10014;
159 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800160 CpuActiveTime cpu_active_time = 10016;
161 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000162 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800163 RemainingBatteryCapacity remaining_battery_capacity = 10019;
164 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800165 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100166 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100167 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100168 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000169 DiskStats disk_stats = 10025;
170 DirectoryUsage directory_usage = 10026;
171 AppSize app_size = 10027;
172 CategorySize category_size = 10028;
Bookatz17f0d8a2018-09-13 12:56:32 -0700173 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700174 NumFingerprints num_fingerprints = 10031;
Chenjie Yu12e5e672018-09-14 15:54:59 -0700175 ProcStats proc_stats = 10029;
David Chenc8a43242017-10-17 16:23:28 -0700176 }
yroa1fe77c2018-02-26 14:22:54 -0800177
Bookatz76aafcf2018-09-17 16:17:10 -0700178 // DO NOT USE field numbers above 100,000 in AOSP.
179 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
180 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700181}
182
Yao Chend54f9dd2017-10-17 17:37:48 +0000183/**
Yangster-mac20877162017-12-22 17:19:39 -0800184 * This proto represents a node of an attribution chain.
185 * Note: All attribution chains are represented as a repeated field of type
186 * AttributionNode. It is understood that in such arrays, the order is that
187 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000188 */
Yangster-mac20877162017-12-22 17:19:39 -0800189message AttributionNode {
190 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800191 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800192
Yangster-mac20877162017-12-22 17:19:39 -0800193 // The (optional) string tag for an element in the attribution chain. If the
194 // element has no tag, it is encoded as an empty string.
195 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700196}
197
Yangster-mac48b3d622018-08-18 12:38:11 -0700198message KeyValuePair {
199 optional int32 key = 1;
200 oneof value {
201 int64 value_int = 2;
202 string value_str = 3;
203 float value_float = 4;
204 }
205}
206
207message KeyValuePairsAtom {
208 optional int32 uid = 1;
209 repeated KeyValuePair pairs = 2;
210}
211
Yao Chend54f9dd2017-10-17 17:37:48 +0000212/*
213 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800214 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000215 *
216 * RULES:
217 * - The field ids for each atom must start at 1, and count upwards by 1.
218 * Skipping field ids is not allowed.
219 * - These form an API, so renaming, renumbering or removing fields is
220 * not allowed between android releases. (This is not currently enforced,
221 * but there will be a tool to enforce this restriction).
222 * - The types must be built-in protocol buffer types, namely, no sub-messages
223 * are allowed (yet). The bytes type is also not allowed.
224 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800225 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000226 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800227 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000228 * - A field that is a uid should be a string field, tagged with the [xxx]
229 * annotation. The generated code on android will be represented by UIDs,
230 * and those UIDs will be translated in xxx to those strings.
231 *
232 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700233 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000234 * - If there is a UID, it goes first. Think in an object-oriented fashion.
235 * *****************************************************************************
236 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700237
Yao Chend54f9dd2017-10-17 17:37:48 +0000238/**
Yangster-mace16189a2018-08-26 12:20:16 -0700239 * Logs when the Thermal service HAL notifies the throttling start/stop events.
240 *
241 * Logged from:
242 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
243 */
244message ThermalThrottlingStateChanged {
245 optional android.os.TemperatureTypeEnum sensor_type = 1;
246
247 enum State {
248 UNKNOWN = 0;
249 START = 1;
250 STOP = 2;
251 }
252
253 optional State state = 2;
254
255 optional float temperature = 3;
256}
257
258/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000259 * Logs when the screen state changes.
260 *
261 * Logged from:
262 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
263 */
264message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800265 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800266 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700267}
Yao Chend54f9dd2017-10-17 17:37:48 +0000268
269/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700270 * Logs that the process state of the uid, as determined by ActivityManager
271 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000272 *
273 * Logged from:
274 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
275 */
Bookatzc1a050a2017-10-10 15:49:28 -0700276message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700277 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000278
Bookatzdb026a22018-01-10 19:01:56 -0800279 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800280 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000281}
282
283/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700284 * Logs process state change of a process, as per the activity manager.
285 *
286 * Logged from:
287 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
288 */
289message ProcessStateChanged {
290 optional int32 uid = 1;
291 optional string process_name = 2;
292 optional string package_name = 3;
293 // TODO: remove this when validation is done
294 optional int64 version = 5;
295 // The state, from frameworks/base/core/proto/android/app/enums.proto.
296 optional android.app.ProcessStateEnum state = 4;
297}
298
299/**
300 * Logs when ActivityManagerService sleep state is changed.
301 *
302 * Logged from:
303 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
304 */
305message ActivityManagerSleepStateChanged {
306 // TODO: import frameworks proto
307 enum State {
308 UNKNOWN = 0;
309 ASLEEP = 1;
310 AWAKE = 2;
311 }
312 optional State state = 1 [(stateFieldOption).option = EXCLUSIVE];
313}
314
315/**
316 * Logs when system memory state changes.
317 *
318 * Logged from:
319 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
320 */
321message MemoryFactorStateChanged {
322 // TODO: import frameworks proto
323 enum State {
324 MEMORY_UNKNOWN = 0;
325 NORMAL = 1; // normal.
326 MODERATE = 2; // moderate memory pressure.
327 LOW = 3; // low memory.
328 CRITICAL = 4; // critical memory.
329
330 }
331 optional State factor = 1 [(stateFieldOption).option = EXCLUSIVE];
332}
333
334/**
335 * Logs when app is using too much cpu, according to ActivityManagerService.
336 *
337 * Logged from:
338 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
339 */
340message ExcessiveCpuUsageReported {
341 optional int32 uid = 1;
342 optional string process_name = 2;
343 optional string package_name = 3;
344 // package version. TODO: remove this when validation is done
345 optional int64 version = 4;
346}
347
348/**
349 * Logs when a cached process is killed, along with its pss.
350 *
351 * Logged from:
352 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
353 */
354message CachedKillReported {
355 optional int32 uid = 1;
356 optional string process_name = 2;
357 optional string package_name = 3;
358 // TODO: remove this when validation is done
359 optional int64 version = 5;
360 optional int64 pss = 4;
361}
362
363/**
364 * Logs when memory stats of a process is reported.
365 *
366 * Logged from:
367 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
368 */
369message ProcessMemoryStatReported {
370 optional int32 uid = 1;
371 optional string process_name = 2;
372 optional string package_name = 3;
373 //TODO: remove this when validation is done
374 optional int64 version = 9;
375 optional int64 pss = 4;
376 optional int64 uss = 5;
377 optional int64 rss = 6;
378 enum Type {
379 ADD_PSS_INTERNAL_SINGLE = 0;
380 ADD_PSS_INTERNAL_ALL_MEM = 1;
381 ADD_PSS_INTERNAL_ALL_POLL = 2;
382 ADD_PSS_EXTERNAL = 3;
383 ADD_PSS_EXTERNAL_SLOW = 4;
384 }
385 optional Type type = 7;
386 optional int64 duration = 8;
387}
388
389/**
Bookatzc1a050a2017-10-10 15:49:28 -0700390 * Logs that a process started, finished, crashed, or ANRed.
391 *
392 * Logged from:
393 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
394 */
395message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700396 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700397
David Chen0b5c90c2018-01-25 16:51:49 -0800398 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800399 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700400
Bookatzddccf0a2017-11-28 16:48:14 -0800401 // What lifecycle state the process changed to.
402 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800403 enum State {
404 FINISHED = 0;
405 STARTED = 1;
406 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800407 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800408 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700409}
410
Bookatzc1a050a2017-10-10 15:49:28 -0700411/**
412 * Logs when the ble scan state changes.
413 *
414 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700415 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700416 */
417message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800418 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700419
420 enum State {
421 OFF = 0;
422 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700423 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
424 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700425 }
426 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700427
Bookatze5ec0b42018-03-26 13:34:56 -0700428 // Does the scan have a filter.
429 optional bool is_filtered = 3;
430 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
431 optional bool is_first_match = 4;
432 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
433 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700434}
435
436/**
437 * Logs reporting of a ble scan finding results.
438 *
439 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700440 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700441 */
Bookatzae6738e2018-09-13 11:38:56 -0700442// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700443message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800444 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700445
446 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800447 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700448}
449
450/**
451 * Logs when a sensor state changes.
452 *
453 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700454 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700455 */
456message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800457 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700458
Bookatzc1a050a2017-10-10 15:49:28 -0700459 // The id (int) of the sensor.
460 optional int32 sensor_id = 2;
461
462 enum State {
463 OFF = 0;
464 ON = 1;
465 }
466 optional State state = 3;
467}
468
469
470/**
471 * Logs when GPS state changes.
472 *
473 * Logged from:
474 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
475 */
476message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800477 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700478
479 enum State {
480 OFF = 0;
481 ON = 1;
482 }
483 optional State state = 2;
484}
485
486
487/**
488 * Logs when a sync manager sync state changes.
489 *
490 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700491 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700492 */
493message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800494 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700495
David Chen0b5c90c2018-01-25 16:51:49 -0800496 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800497 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700498
499 enum State {
500 OFF = 0;
501 ON = 1;
502 }
503 optional State state = 3;
504}
505
Yangster-mac96353002018-09-05 11:18:55 -0700506/*
507 * Deferred job stats.
508 *
509 * Logged from:
510 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
511*/
512message DeferredJobStatsReported {
513 repeated AttributionNode attribution_node = 1;
514
515 // Number of jobs deferred.
516 optional int32 num_jobs_deferred = 2;
517
518 // Time since the last job runs.
519 optional int64 time_since_last_job_millis = 3;
520}
521
Bookatzc1a050a2017-10-10 15:49:28 -0700522/**
523 * Logs when a job scheduler job state changes.
524 *
525 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700526 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700527 */
528message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800529 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700530
531 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800532 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700533
534 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800535 FINISHED = 0;
536 STARTED = 1;
537 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700538 }
539 optional State state = 3;
540
Tej Singh33a412b2018-03-16 18:43:59 -0700541 // The reason a job has stopped.
542 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700543 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700544 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700545}
546
547/**
548 * Logs when the audio state changes.
549 *
550 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700551 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700552 */
553message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800554 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700555
556 enum State {
557 OFF = 0;
558 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700559 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
560 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700561 }
562 optional State state = 2;
563}
564
565/**
566 * Logs when the video codec state changes.
567 *
568 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700569 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700570 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800571message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800572 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700573
574 enum State {
575 OFF = 0;
576 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700577 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
578 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700579 }
580 optional State state = 2;
581}
582
583/**
584 * Logs when the flashlight state changes.
585 *
586 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700587 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700588 */
589message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800590 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700591
592 enum State {
593 OFF = 0;
594 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700595 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
596 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700597 }
598 optional State state = 2;
599}
600
601/**
602 * Logs when the camera state changes.
603 *
604 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700605 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700606 */
607message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800608 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700609
610 enum State {
611 OFF = 0;
612 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700613 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
614 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700615 }
616 optional State state = 2;
617}
618
619/**
620 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000621 *
622 * Logged from:
623 * TODO
624 */
Bookatzd6746242017-10-24 18:39:35 -0700625message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800626 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000627
Bookatz1a1b0462018-01-12 11:47:03 -0800628 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
629 // From frameworks/base/core/proto/android/os/enums.proto.
630 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700631
632 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
633 optional string tag = 3;
634
635 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800636 RELEASE = 0;
637 ACQUIRE = 1;
638 CHANGE_RELEASE = 2;
639 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700640 }
641 optional State state = 4;
642}
643
644/**
Bookatzc1a050a2017-10-10 15:49:28 -0700645 * Logs when a partial wakelock is considered 'long' (over 1 min).
646 *
647 * Logged from:
648 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
649 */
650message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800651 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700652
Yao Chend54f9dd2017-10-17 17:37:48 +0000653 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
654 optional string tag = 2;
655
Bookatzc1a050a2017-10-10 15:49:28 -0700656 // TODO: I have no idea what this is.
657 optional string history_tag = 3;
658
659 enum State {
660 OFF = 0;
661 ON = 1;
662 }
663 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000664}
665
Bookatzc1a050a2017-10-10 15:49:28 -0700666/**
667 * Logs Battery Saver state change.
668 *
669 * Logged from:
670 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
671 */
672message BatterySaverModeStateChanged {
673 enum State {
674 OFF = 0;
675 ON = 1;
676 }
677 optional State state = 1;
678}
679
680/**
681 * Logs Doze mode state change.
682 *
683 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800684 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700685 */
686message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800687 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800688}
689
690
691/**
692 * Logs state change of Doze mode including maintenance windows.
693 *
694 * Logged from:
695 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
696 */
697message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800698 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700699}
700
701/**
702 * Logs screen brightness level.
703 *
704 * Logged from:
705 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
706 */
707message ScreenBrightnessChanged {
708 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
709 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700710}
711
712/**
713 * Logs battery level (percent full, from 0 to 100).
714 *
715 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700716 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700717 */
718message BatteryLevelChanged {
719 // Battery level. Should be in [0, 100].
720 optional int32 battery_level = 1;
721}
722
723/**
724 * Logs change in charging status of the device.
725 *
726 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700727 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700728 */
729message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800730 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
731 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700732}
733
734/**
735 * Logs whether the device is plugged in, and what power source it is using.
736 *
737 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700738 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700739 */
740message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800741 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
742 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700743}
744
Bookatz8c6571b2017-10-24 15:04:41 -0700745/**
746 * Logs when an app's wakeup alarm fires.
747 *
748 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700749 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700750 */
751message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800752 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800753
754 // Name of the wakeup alarm.
755 optional string tag = 2;
756}
757
758/**
759 * Logs when an an app causes the mobile radio to change state.
760 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
761 *
762 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700763 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800764 */
765message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800766 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800767
Bookatz1a1b0462018-01-12 11:47:03 -0800768 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
769 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800770}
771
772/**
773 * Logs when an an app causes the wifi radio to change state.
774 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
775 *
776 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700777 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800778 */
779message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800780 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800781
Bookatz1a1b0462018-01-12 11:47:03 -0800782 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
783 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700784}
785
786/**
787 * Logs kernel wakeup reasons and aborts.
788 *
789 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700790 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700791 */
792message KernelWakeupReported {
793 // Name of the kernel wakeup reason (or abort).
794 optional string wakeup_reason_name = 1;
795
796 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800797 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700798}
799
800/**
801 * Logs wifi locks held by an app.
802 *
803 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700804 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700805 */
806message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800807 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700808
809 enum State {
810 OFF = 0;
811 ON = 1;
812 }
813 optional State state = 2;
814}
815
816/**
817 * Logs wifi signal strength changes.
818 *
819 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700820 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700821 */
822message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800823 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
824 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700825}
826
827/**
828 * Logs wifi scans performed by an app.
829 *
830 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700831 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700832 */
833message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800834 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700835
836 enum State {
837 OFF = 0;
838 ON = 1;
839 }
840 optional State state = 2;
841}
842
843/**
Tej Singh4503e102018-01-04 14:35:01 -0800844 * Logs wifi multicast locks held by an app
845 *
846 * Logged from:
847 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
848 */
849message WifiMulticastLockStateChanged {
850 repeated AttributionNode attribution_node = 1;
851
852 enum State {
853 OFF = 0;
854 ON = 1;
855 }
856 optional State state = 2;
857}
858
859/**
Tej Singh1ea42892018-01-19 09:27:00 -0800860 * Logs shutdown reason and duration on next boot.
861 *
862 * Logged from:
863 * frameworks/base/core/java/com/android/server/BootReceiver.java
864 */
865message ShutdownSequenceReported {
866 // True if shutdown is for a reboot. Default: false if we do not know.
867 optional bool reboot = 1;
868
869 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
870 optional string reason = 2;
871
872 // Beginning of shutdown time in ms using wall clock time since unix epoch.
873 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800874 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800875
876 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800877 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800878}
879
Tej Singh6483ea42018-01-25 17:45:49 -0800880
881/**
882 * Logs boot reason and duration.
883 *
884 * Logged from:
885 * system/core/bootstat/bootstat.cpp
886 */
887message BootSequenceReported {
888 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
889 // Default: "<EMPTY>" if not available.
890 optional string bootloader_reason = 1;
891
892 // Reason for system boot. Eg. bootloader, reboot,userrequested
893 // Default: "<EMPTY>" if not available.
894 optional string system_reason = 2;
895
896 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800897 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800898
899 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800900 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800901
902 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800903 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800904
905 // Time since last boot in ms. Default: 0 if not available.
906 optional int64 time_since_last_boot = 6;
907}
908
Tej Singhc477d9c2018-02-05 18:31:39 -0800909
910/**
911 * Logs call state and disconnect cause (if applicable).
912 *
913 * Logged from:
914 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
915 */
916message CallStateChanged {
917 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
918 // From frameworks/base/core/proto/android/telecomm/enums.proto.
919 optional android.telecom.CallStateEnum call_state = 1;
920
921 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
922 // This value is only applicable when the call_state is DISCONNECTED, and
923 // should always be UNKNOWN if the call_state is not DISCONNECTED.
924 // From frameworks/base/core/proto/android/telecomm/enums.proto.
925 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
926
927 // True if the call is self-managed, which are apps that use the
928 // telecom infrastructure to make their own calls.
929 optional bool self_managed = 3;
930
931 // True if call is external. External calls are calls on connected Wear
932 // devices but show up in Telecom so the user can pull them onto the device.
933 optional bool external_call = 4;
934}
935
Tej Singh1ea42892018-01-19 09:27:00 -0800936/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800937 * Logs keyguard state. The keyguard is the lock screen.
938 *
939 * Logged from:
940 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
941 */
942message KeyguardStateChanged {
943 enum State {
944 UNKNOWN = 0;
945 // The keyguard is hidden when the phone is unlocked.
946 HIDDEN = 1;
947 // The keyguard is shown when the phone is locked (screen turns off).
948 SHOWN= 2;
949 // The keyguard is occluded when something is overlaying the keyguard.
950 // Eg. Opening the camera while on the lock screen.
951 OCCLUDED = 3;
952 }
953 optional State state = 1;
954}
955
956/**
957 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
958 * prompts the user to enter a password (pattern, pin, etc).
959 *
960 * Logged from:
961 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
962 */
963
964message KeyguardBouncerStateChanged {
965 enum State {
966 UNKNOWN = 0;
967 // Bouncer is hidden, either as a result of successfully entering the
968 // password, screen timing out, or user going back to lock screen.
969 HIDDEN = 1;
970 // This is when the user is being prompted to enter the password.
971 SHOWN = 2;
972 }
973 optional State state = 1;
974}
975
976/**
977 * Logs the result of entering a password into the keyguard bouncer.
978 *
979 * Logged from:
980 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
981 */
982message KeyguardBouncerPasswordEntered {
983 enum BouncerResult {
984 UNKNOWN = 0;
985 // The password entered was incorrect.
986 FAILURE = 1;
987 // The password entered was correct.
988 SUCCESS = 2;
989 }
990 optional BouncerResult result = 1;
991}
992
Tej Singha883b372018-02-15 11:30:01 -0800993/*
994 * Logs changes to the configuration of the device. The configuration is defined
995 * in frameworks/base/core/java/android/content/res/Configuration.java
996 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
997 * Please go there to interpret the possible values each field can be.
998 *
999 * Logged from:
1000 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1001 */
1002message ResourceConfigurationChanged {
1003 // Bit mask of color capabilities of the screen.
1004 // Contains information about the color gamut and hdr mode of the screen.
1005 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
1006 optional int32 colorMode = 1;
1007
1008 // The target screen density being rendered to.
1009 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
1010 optional int32 densityDpi = 2;
1011
1012 // Current user preference for the scaling factor for fonts,
1013 // relative to the base density scaling.
1014 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
1015 optional float fontScale = 3;
1016
1017 // Flag indicating whether the hard keyboard is hidden.
1018 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
1019 optional int32 hardKeyboardHidden = 4;
1020
1021 // The type of keyboard attached to the device.
1022 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1023 optional int32 keyboard = 5;
1024
1025 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1026 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
1027 optional int32 keyboardHideen = 6;
1028
1029 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1030 // 0 if undefined.
1031 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1032 optional int32 mcc = 7;
1033
1034 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1035 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1036 // MNC_ZERO symbol defined in Configuration.java.
1037 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1038 optional int32 mnc = 8;
1039
1040 // The kind of navigation available on the device.
1041 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1042 optional int32 navigation = 9;
1043
1044 // Flag indicating whether the navigation is available.
1045 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
1046 optional int32 navigationHidden = 10;
1047
1048 // Overall orientation of the screen.
1049 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1050 optional int32 orientation = 11;
1051
1052 // The current height of the available screen space, in dp units.
1053 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
1054 optional int32 screenHeightDp = 12;
1055
1056 // Bit mask of overall layout of the screen.
1057 // Contains information about screen size, whether the screen is wider/taller
1058 // than normal, whether the screen layout is right-tl-left or left-to-right,
1059 // and whether the screen has a rounded shape.
1060 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
1061 optional int32 screenLayout = 13;
1062
1063 // Current width of the available screen space, in dp units.
1064 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
1065 optional int32 screenWidthDp = 14;
1066
1067 // The smallest screen size an application will see in normal operation.
1068 // This is the smallest value of both screenWidthDp and screenHeightDp
1069 // in portrait and landscape.
1070 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
1071 optional int32 smallestScreenWidthDp = 15;
1072
1073 // The type of touch screen attached to the device.
1074 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1075 optional int32 touchscreen = 16;
1076
1077 // Bit mask of the ui mode.
1078 // Contains information about the overall ui mode of the device.
1079 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1080 // Also contains information about whether the device is in night mode.
1081 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
1082 optional int32 uiMode = 17;
1083}
1084
Tej Singheee317b2018-03-07 19:28:05 -08001085
1086/**
1087 * Logs changes in the connection state of the mobile radio.
1088 *
1089 * Logged from:
1090 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1091 */
1092message MobileConnectionStateChanged {
1093 // States are from the state machine DataConnection.java.
1094 enum State {
1095 UNKNOWN = 0;
1096 // The connection is inactive, or disconnected.
1097 INACTIVE = 1;
1098 // The connection is being activated, or connecting.
1099 ACTIVATING = 2;
1100 // The connection is active, or connected.
1101 ACTIVE = 3;
1102 // The connection is disconnecting.
1103 DISCONNECTING = 4;
1104 // The connection is disconnecting after creating a connection.
1105 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1106 }
1107 optional State state = 1;
1108 // For multi-sim phones, this distinguishes between the sim cards.
1109 optional int32 sim_slot_index = 2;
1110 // Used to identify the connection. Starts at 0 and increments by 1 for
1111 // every new network created. Resets whenever the device reboots.
1112 optional int32 data_connection_id = 3;
1113 // A bitmask for the capabilities of this connection.
1114 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1115 // Default value (if we have no information): 0
1116 optional int64 capabilities = 4;
1117 // If this connection has internet.
1118 // This just checks if the DEFAULT bit of capabilities is set.
1119 optional bool has_internet = 5;
1120}
1121
1122/**
1123 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1124 *
1125 * Logged from:
1126 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1127 */
1128message MobileRadioTechnologyChanged {
1129 optional android.telephony.NetworkTypeEnum state = 1;
1130 // For multi-sim phones, this distinguishes between the sim cards.
1131 optional int32 sim_slot_index = 2;
1132}
1133
Andrew Chantb56388b2018-03-22 21:07:33 -07001134/**
1135 * Logs the VID and PID of any connected USB devices.
1136 *
1137 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1138 *
1139 * Logged by Vendor.
1140 */
1141message UsbDeviceAttached {
1142 optional int32 vid = 1;
1143 optional int32 pid = 2;
1144 optional bool has_audio = 3;
1145 optional bool has_hid = 4;
1146 optional bool has_storage = 5;
1147}
1148
Tej Singheee317b2018-03-07 19:28:05 -08001149
Tej Singhdd7bd352018-02-09 19:33:15 -08001150/**
Tej Singh5d991e12018-03-09 19:48:11 -08001151 * Logs when Bluetooth is enabled and disabled.
1152 *
1153 * Logged from:
1154 * services/core/java/com/android/server/BluetoothManagerService.java
1155 */
1156message BluetoothEnabledStateChanged {
1157 repeated AttributionNode attribution_node = 1;
1158 // Whether or not bluetooth is enabled on the device.
1159 enum State {
1160 UNKNOWN = 0;
1161 ENABLED = 1;
1162 DISABLED = 2;
1163 }
1164 optional State state = 2;
1165 // The reason for being enabled/disabled.
1166 // Eg. Airplane mode, crash, application request.
1167 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1168 // If the reason is an application request, this will be the package name.
1169 optional string pkgName = 4;
1170}
1171
1172/**
1173 * Logs when a Bluetooth device connects and disconnects.
1174 *
1175 * Logged from:
1176 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1177 */
1178message BluetoothConnectionStateChanged {
1179 // The state of the connection.
1180 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1181 optional android.bluetooth.ConnectionStateEnum state = 1;
1182 // An identifier that can be used to match connect and disconnect events.
1183 // Currently is last two bytes of a hash of a device level ID and
1184 // the mac address of the bluetooth device that is connected.
1185 optional int32 obfuscated_id = 2;
1186 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1187 // From android.bluetooth.BluetoothAdapter.java
1188 optional int32 bt_profile = 3;
1189}
1190
1191/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001192 * Logs when something is plugged into or removed from the USB-C connector.
1193 *
1194 * Logged from:
1195 * Vendor USB HAL.
1196 */
1197message UsbConnectorStateChanged {
1198 enum State {
1199 DISCONNECTED = 0;
1200 CONNECTED = 1;
1201 }
1202 optional State state = 1;
1203}
1204
1205/**
1206 * Logs the reported speaker impedance.
1207 *
1208 * Logged from:
1209 * Vendor audio implementation.
1210 */
1211message SpeakerImpedanceReported {
1212 optional int32 speaker_location = 1;
1213 optional int32 impedance = 2;
1214}
1215
1216/**
1217 * Logs the report of a failed hardware.
1218 *
1219 * Logged from:
1220 * Vendor HALs.
1221 *
1222 */
1223message HardwareFailed {
1224 enum HardwareType {
1225 HARDWARE_FAILED_UNKNOWN = 0;
1226 HARDWARE_FAILED_MICROPHONE = 1;
1227 HARDWARE_FAILED_CODEC = 2;
1228 HARDWARE_FAILED_SPEAKER = 3;
1229 HARDWARE_FAILED_FINGERPRINT = 4;
1230 }
1231 optional HardwareType hardware_type = 1;
1232
1233 /* hardware_location allows vendors to differentiate between multiple instances of
1234 * the same hardware_type. The specific locations are vendor defined integers,
1235 * referring to board-specific numbering schemes.
1236 */
1237 optional int32 hardware_location = 2;
1238
1239 /* failure_code is specific to the HardwareType of the failed hardware.
1240 * It should use the enum values defined below.
1241 */
1242 enum MicrophoneFailureCode {
1243 MICROPHONE_FAILURE_COMPLETE = 0;
1244 }
1245 enum CodecFailureCode {
1246 CODEC_FAILURE_COMPLETE = 0;
1247 }
1248 enum SpeakerFailureCode {
1249 SPEAKER_FAILURE_COMPLETE = 0;
1250 SPEAKER_FAILURE_HIGH_Z = 1;
1251 SPEAKER_FAILURE_SHORT = 2;
1252 }
1253 enum FingerprintFailureCode {
1254 FINGERPRINT_FAILURE_COMPLETE = 0;
1255 FINGERPRINT_SENSOR_BROKEN = 1;
1256 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1257 }
1258 optional int32 failure_code = 3;
1259}
1260
1261/**
1262 * Log an event when the device has been physically dropped.
1263 * Reported from the /vendor partition.
1264 */
1265message PhysicalDropDetected {
1266 // Confidence that the event was actually a drop, 0 -> 100
1267 optional int32 confidence_pctg = 1;
1268 // Peak acceleration of the drop, in 1/1000s of a g.
1269 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001270 // Duration of freefall in ms
1271 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001272}
1273
1274/**
1275 * Log bucketed battery charge cycles.
1276 *
1277 * Each bucket represents cycles of the battery past
1278 * a given charge point. For example, bucket 1 is the
1279 * lowest 1/8th of the battery, and bucket 8 is 100%.
1280 *
1281 * Logged from:
1282 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1283 */
1284message ChargeCyclesReported {
1285 optional int32 cycle_bucket_1 = 1;
1286 optional int32 cycle_bucket_2 = 2;
1287 optional int32 cycle_bucket_3 = 3;
1288 optional int32 cycle_bucket_4 = 4;
1289 optional int32 cycle_bucket_5 = 5;
1290 optional int32 cycle_bucket_6 = 6;
1291 optional int32 cycle_bucket_7 = 7;
1292 optional int32 cycle_bucket_8 = 8;
1293}
1294
1295/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001296 * Logs the duration of a davey (jank of >=700ms) when it occurs
1297 *
1298 * Logged from:
1299 * frameworks/base/libs/hwui/JankTracker.cpp
1300 */
1301message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001302 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001303 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001304
Tej Singhbb8554a2018-01-26 11:59:14 -08001305 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001306 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001307}
1308
1309/**
Bookatze5885242017-10-24 20:10:31 -07001310 * Logs phone signal strength changes.
1311 *
1312 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001313 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001314 */
1315message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001316 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1317 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001318}
1319
1320/**
1321 * Logs that a setting was updated.
1322 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001323 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001324 * The tag and is_default allow resetting of settings to default values based on the specified
1325 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1326 */
1327message SettingChanged {
1328 // The name of the setting.
1329 optional string setting = 1;
1330
1331 // The change being imposed on this setting. May represent a number, eg "3".
1332 optional string value = 2;
1333
1334 // The new value of this setting. For most settings, this is same as value. For some settings,
1335 // value is +X or -X where X represents an element in a set. For example, if the previous value
1336 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1337 // The +/- feature is currently only used for location_providers_allowed.
1338 optional string new_value = 3;
1339
1340 // The previous value of this setting.
1341 optional string prev_value = 4;
1342
1343 // The tag used with the is_default for resetting sets of settings. This is generally null.
1344 optional string tag = 5;
1345
Bookatz90867622018-01-31 15:05:57 -08001346 // True if this setting with tag should be resettable.
1347 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001348
David Chenbd789912018-03-16 17:19:55 -07001349 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001350 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001351
1352 enum ChangeReason {
1353 UPDATED = 1; // Updated can be an insertion or an update.
1354 DELETED = 2;
1355 }
1356 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001357}
Chenjie Yub3dda412017-10-24 13:41:59 -07001358
Chenjie Yu05013b32017-11-21 10:21:41 -08001359/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001360 * Logs activity going to foreground or background
1361 *
1362 * Logged from:
1363 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1364 */
1365message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001366 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001367 optional string pkg_name = 2;
1368 optional string class_name = 3;
1369
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001370 enum State {
1371 BACKGROUND = 0;
1372 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001373 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001374 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001375}
David Chenc8a43242017-10-17 16:23:28 -07001376
1377/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001378 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001379 * Logged from:
1380 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1381 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001382message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001383 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001384
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001385 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001386
1387 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001388 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001389 optional string process_name = 3;
1390
1391 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001392 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001393
1394 optional string package_name = 5;
1395
1396 enum InstantApp {
1397 UNAVAILABLE = 0;
1398 FALSE = 1;
1399 TRUE = 2;
1400 }
1401 optional InstantApp is_instant_app = 6;
1402
1403 enum ForegroundState {
1404 UNKNOWN = 0;
1405 BACKGROUND = 1;
1406 FOREGROUND = 2;
1407 }
1408 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001409}
David Chen9e3808c2017-11-20 17:25:34 -08001410
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001411/**
1412 * Logs when a WTF (What a Terrible Failure) happened.
1413 * Logged from:
1414 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1415 */
1416message WTFOccurred {
1417 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001418
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001419 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001420
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001421 // The name of the process.
1422 // system_server if it is not by an app
1423 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001424
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001425 // The pid if available. -1 means not available.
1426 optional sint32 pid = 4;
1427}
1428
1429/**
1430 * Logs when system server reports low memory.
1431 * Logged from:
1432 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1433 */
1434message LowMemReported {
1435}
1436
1437/**
1438 * Logs when an app ANR (App Not Responding) occurs.
1439 * Logged from:
1440 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1441 */
1442message ANROccurred {
1443 optional int32 uid = 1 [(is_uid) = true];
1444
1445 optional string process_name = 2;
1446
1447 optional string short_component_name = 3;
1448
1449 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001450
1451 enum InstantApp {
1452 UNAVAILABLE = 0;
1453 FALSE = 1;
1454 TRUE = 2;
1455 }
1456 optional InstantApp is_instant_app = 5;
1457
1458 enum ForegroundState {
1459 UNKNOWN = 0;
1460 BACKGROUND = 1;
1461 FOREGROUND = 2;
1462 }
1463 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08001464}
1465
Bookatza7020bd2018-08-28 16:29:35 -07001466/**
1467 * Logs when the vibrator state changes.
1468 * Logged from:
1469 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1470 */
1471message VibratorStateChanged {
1472 repeated AttributionNode attribution_node = 1;
1473
1474 enum State {
1475 OFF = 0;
1476 ON = 1;
1477 }
1478 optional State state = 2;
1479
1480 // Duration (in milliseconds) requested to keep the vibrator on.
1481 // Only applicable for State == ON.
1482 optional int64 duration_millis = 3;
1483}
1484
David Chen0a368b22017-12-06 16:28:16 -08001485/*
1486 * Allows other apps to push events into statsd.
1487 * Logged from:
1488 * frameworks/base/core/java/android/util/StatsLog.java
1489 */
David Chen0b5c90c2018-01-25 16:51:49 -08001490message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001491 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001492 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001493
1494 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1495 optional int32 label = 2;
1496
1497 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1498 // predicates for the metrics).
1499 enum State {
1500 UNKNOWN = 0;
1501 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1502 STOP = 2;
1503 START = 3;
1504 }
1505 optional State state = 3;
1506}
1507
David Chen9e3808c2017-11-20 17:25:34 -08001508/**
Bookatz7948c872018-09-04 12:58:33 -07001509 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1510 * For example, this could be due to the user manually changing the time.
1511 *
1512 * Logged from:
1513 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1514 */
1515message WallClockTimeShifted {
1516 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1517 optional int64 wall_clock_timestamp_millis = 1;
1518}
1519
1520/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001521 * Logs when statsd detects an anomaly.
1522 *
1523 * Logged from:
1524 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1525 */
1526message AnomalyDetected {
1527 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001528 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001529
Yangster-mac94e197c2018-01-02 16:03:03 -08001530 // Id of the config whose anomaly detection alert fired.
1531 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001532
Yangster-mac94e197c2018-01-02 16:03:03 -08001533 // Id of the alert (i.e. name of the anomaly that was detected).
1534 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001535}
1536
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001537message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001538 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001539 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001540
1541 // The app package name.
1542 optional string pkg_name = 2;
1543
1544 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001545 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001546 WARM = 1;
1547 HOT = 2;
1548 COLD = 3;
1549 }
1550 // The transition type.
1551 optional TransitionType type = 3;
1552
1553 // The activity name.
1554 optional string activity_name = 4;
1555
1556 // The name of the calling app. Empty if not set.
1557 optional string calling_pkg_name = 5;
1558
1559 // Whether the app is an instant app.
1560 optional bool is_instant_app = 6;
1561
1562 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001563 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001564
Bookatz80d11a02018-01-16 10:46:35 -08001565 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001566
David Chen0b5c90c2018-01-25 16:51:49 -08001567 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001568 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001569 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001570 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001571 optional int32 bind_application_delay_millis = 11;
1572 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001573
1574 // Empty if not set.
1575 optional string launch_token = 13;
1576
Calin Juravle759fbda2018-02-20 19:52:30 +00001577 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001578 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001579
1580 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001581 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001582}
1583
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001584message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001585 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001586 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001587
1588 // The app package name.
1589 optional string pkg_name = 2;
1590
1591 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001592 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001593 WARM = 1;
1594 HOT = 2;
1595 COLD = 3;
1596 }
1597 // The transition type.
1598 optional TransitionType type = 3;
1599
1600 // The activity name.
1601 optional string activity_name = 4;
1602}
1603
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001604message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001605 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001606 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001607
1608 // The app package name.
1609 optional string pkg_name = 2;
1610
1611 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001612 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001613 WITH_BUNDLE = 1;
1614 WITHOUT_BUNDLE = 2;
1615 }
1616 // The transition type.
1617 optional TransitionType type = 3;
1618
1619 // The activity name.
1620 optional string activity_name = 4;
1621
1622 optional bool transition_process_running = 5;
1623
1624 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001625 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001626}
1627
Bookatz8fcd09a2017-12-18 13:01:10 -08001628/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001629 * Logs a picture-in-picture action
1630 * Logged from:
1631 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1632 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1633 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1634 */
1635message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001636 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001637 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001638
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001639 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001640
Chenjie Yu52cacc62017-12-08 18:11:45 -08001641 enum State {
1642 ENTERED = 1;
1643 EXPANDED_TO_FULL_SCREEN = 2;
1644 MINIMIZED = 3;
1645 DISMISSED = 4;
1646 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001647 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001648}
1649
1650/**
Chenjie Yue8904192017-12-08 19:12:57 -08001651 * Logs overlay action
1652 * Logged from:
1653 * services/core/java/com/android/server/wm/Session.java
1654 */
1655message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001656 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001657
1658 optional string package_name = 2;
1659
1660 optional bool using_alert_window = 3;
1661
1662 enum State {
1663 ENTERED = 1;
1664 EXITED = 2;
1665 }
1666 optional State state = 4;
1667}
1668
Chenjie Yuccfe6452018-01-30 11:33:21 -08001669/*
1670 * Logs foreground service starts and stops.
1671 * Note that this is not when a service starts or stops, but when it is
1672 * considered foreground.
1673 * Logged from
1674 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1675 */
1676message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001677 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001678 // package_name + "/" + class_name
1679 optional string short_name = 2;
1680
1681 enum State {
1682 ENTER = 1;
1683 EXIT = 2;
1684 }
1685 optional State state = 3;
1686}
1687
Chenjie Yue8904192017-12-08 19:12:57 -08001688/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001689 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1690 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1691 * attributed back to the parent (host) uid. One example is Chrome.
1692 *
1693 * Logged from:
1694 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1695 */
1696message IsolatedUidChanged {
1697 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001698 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001699 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001700 optional int32 parent_uid = 1;
1701
1702 optional int32 isolated_uid = 2;
1703
1704 // We expect an isolated uid to be removed before if it's used for another parent uid.
1705 enum Event {
1706 REMOVED = 0;
1707 CREATED = 1;
1708 }
1709 optional Event event = 3;
1710}
1711
1712/*
1713 * Logs the reception of an incoming network packet causing the main system to wake up for
1714 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1715 * and processed by WakeupController.cpp.
1716 */
1717message PacketWakeupOccurred {
1718 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1719 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001720 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001721 // The interface name on which the packet was received.
1722 optional string iface = 2;
1723 // The ethertype value of the packet.
1724 optional int32 ethertype = 3;
1725 // String representation of the destination MAC address of the packet.
1726 optional string destination_hardware_address = 4;
1727 // String representation of the source address of the packet if this was an IP packet.
1728 optional string source_ip = 5;
1729 // String representation of the destination address of the packet if this was an IP packet.
1730 optional string destination_ip = 6;
1731 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1732 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1733 // families.
1734 optional int32 ip_next_header = 7;
1735 // The source port if this was a TCP or UDP packet.
1736 optional int32 source_port = 8;
1737 // The destination port if this was a TCP or UDP packet.
1738 optional int32 destination_port = 9;
1739}
1740
1741/*
1742 * Logs the memory stats for an app on startup.
1743 * Logged from:
1744 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1745 */
1746message AppStartMemoryStateCaptured {
1747 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001748 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001749
1750 // The process name.
1751 optional string process_name = 2;
1752
1753 // The activity name.
1754 optional string activity_name = 3;
1755
1756 // # of page-faults
1757 optional int64 pgfault = 4;
1758
1759 // # of major page-faults
1760 optional int64 pgmajfault = 5;
1761
1762 // RSS
1763 optional int64 rss_in_bytes = 6;
1764
1765 // CACHE
1766 optional int64 cache_in_bytes = 7;
1767
1768 // SWAP
1769 optional int64 swap_in_bytes = 8;
1770}
1771
1772/*
1773 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1774 * for LMK event.
1775 * Logged from:
1776 * system/core/lmkd/lmkd.c
1777 */
1778message LmkStateChanged {
1779 enum State {
1780 UNKNOWN = 0;
1781 START = 1;
1782 STOP = 2;
1783 }
1784 optional State state = 1;
1785}
1786
1787/*
1788 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1789 * Logged from:
1790 * system/core/lmkd/lmkd.c
1791 */
1792message LmkKillOccurred {
1793 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001794 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001795
1796 // The process name.
1797 optional string process_name = 2;
1798
1799 // oom adj score.
1800 optional int32 oom_score = 3;
1801
1802 // # of page-faults
1803 optional int64 pgfault = 4;
1804
1805 // # of major page-faults
1806 optional int64 pgmajfault = 5;
1807
1808 // RSS
1809 optional int64 rss_in_bytes = 6;
1810
1811 // CACHE
1812 optional int64 cache_in_bytes = 7;
1813
1814 // SWAP
1815 optional int64 swap_in_bytes = 8;
1816}
1817
Rajeev Kumar51b54602018-03-01 12:18:26 -08001818/*
1819 * Logs when the ActivityManagerService detects that an app died.
1820 *
1821 * Logged from:
1822 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1823 */
1824message AppDied {
1825 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07001826 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08001827}
1828
Howard Ro21a039c2018-08-06 14:55:47 -07001829/**
1830 * An atom for generic metrics logging. Available from Android Q.
1831 */
1832message GenericAtom {
1833 // The uid of the application that sent this custom atom.
1834 optional int32 uid = 1 [(is_uid) = true];
1835
1836 // An event_id indicates the type of event.
Howard Ro0546d542018-08-30 16:23:44 -07001837 optional android.os.statsd.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07001838}
1839
Tej Singhd6d6d772018-09-05 17:41:25 -07001840/**
1841 * Logs when a fingerprint acquire event occurs.
1842 *
1843 * Logged from:
1844 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1845 */
1846message FingerprintAcquired {
1847 // The associated user. Eg: 0 for owners, 10+ for others.
1848 // Defined in android/os/UserHandle.java
1849 optional int32 user = 1;
1850 // If this acquire is for a crypto fingerprint.
1851 // e.g. Secure purchases, unlock password storage.
1852 optional bool is_crypto = 2;
1853}
1854
1855/**
1856 * Logs when a fingerprint authentication event occurs.
1857 *
1858 * Logged from:
1859 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1860 */
1861message FingerprintAuthenticated {
1862 // The associated user. Eg: 0 for owners, 10+ for others.
1863 // Defined in android/os/UserHandle.java
1864 optional int32 user = 1;
1865 // If this authentication is for a crypto fingerprint.
1866 // e.g. Secure purchases, unlock password storage.
1867 optional bool is_crypto = 2;
1868 // Whether or not this authentication was successful.
1869 optional bool is_authenticated = 3;
1870}
1871
1872/**
1873 * Logs when a fingerprint error occurs.
1874 *
1875 * Logged from:
1876 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1877 */
1878message FingerprintErrorOccurred {
1879 // The associated user. Eg: 0 for owners, 10+ for others.
1880 // Defined in android/os/UserHandle.java
1881 optional int32 user = 1;
1882 // If this error is for a crypto fingerprint.
1883 // e.g. Secure purchases, unlock password storage.
1884 optional bool is_crypto = 2;
1885
1886 enum Error {
1887 UNKNOWN = 0;
1888 LOCKOUT = 1;
1889 PERMANENT_LOCKOUT = 2;
1890 }
1891 // The type of error.
1892 optional Error error = 3;
1893}
Chenjie Yubbcbc602018-02-05 16:51:52 -08001894//////////////////////////////////////////////////////////////////////
1895// Pulled atoms below this line //
1896//////////////////////////////////////////////////////////////////////
1897
1898/**
David Chenc8a43242017-10-17 16:23:28 -07001899 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
1900 *
1901 * Pulled from:
1902 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1903 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001904message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001905 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001906
1907 optional int64 rx_bytes = 2;
1908
1909 optional int64 rx_packets = 3;
1910
1911 optional int64 tx_bytes = 4;
1912
1913 optional int64 tx_packets = 5;
1914}
1915
1916/**
1917 * Pulls bytes transferred via wifi (separated by foreground and background usage).
1918 *
1919 * Pulled from:
1920 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1921 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001922message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001923 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001924
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001925 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
1926 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07001927
1928 optional int64 rx_bytes = 3;
1929
1930 optional int64 rx_packets = 4;
1931
1932 optional int64 tx_bytes = 5;
1933
1934 optional int64 tx_packets = 6;
1935}
1936
1937/**
1938 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
1939 *
1940 * Pulled from:
1941 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1942 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001943message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001944 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001945
1946 optional int64 rx_bytes = 2;
1947
1948 optional int64 rx_packets = 3;
1949
1950 optional int64 tx_bytes = 4;
1951
1952 optional int64 tx_packets = 5;
1953}
1954
1955/**
1956 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
1957 *
1958 * Pulled from:
1959 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1960 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001961message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001962 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001963
Yao Chenc40a19d2018-03-15 16:48:25 -07001964 // 1 denotes foreground and 0 denotes background. This is called Set in
1965 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001966 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07001967
1968 optional int64 rx_bytes = 3;
1969
1970 optional int64 rx_packets = 4;
1971
1972 optional int64 tx_bytes = 5;
1973
1974 optional int64 tx_packets = 6;
1975}
1976
1977/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001978 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
1979 *
1980 * Pulled from:
1981 * StatsCompanionService
1982 */
1983message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001984 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001985
1986 optional int64 rx_bytes = 2;
1987
1988 optional int64 tx_bytes = 3;
1989}
1990
1991/**
David Chenc8a43242017-10-17 16:23:28 -07001992 * Pulls the kernel wakelock durations. This atom is adapted from
1993 * android/internal/os/KernelWakelockStats.java
1994 *
1995 * Pulled from:
1996 * StatsCompanionService using KernelWakelockReader.
1997 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001998message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07001999 optional string name = 1;
2000
2001 optional int32 count = 2;
2002
2003 optional int32 version = 3;
2004
2005 optional int64 time = 4;
2006}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002007
Chenjie Yu05013b32017-11-21 10:21:41 -08002008/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002009 * Pulls low power state information. This includes platform and subsystem sleep state information,
2010 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002011 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002012 * hardware/interfaces/power/1.1/types.hal
2013 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002014message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002015 // Subsystem name
2016 optional string subsystem_name = 1;
2017 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2018 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2019 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002020 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002021 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002022 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002023 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002024}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002025
Chenjie Yu05013b32017-11-21 10:21:41 -08002026/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002027 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002028 * Pulls the time the cpu spend on the frequency index. Frequency index
2029 * starts from highest to lowest. The value should be monotonically
2030 * increasing since boot. However, if there is a cpu
2031 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002032 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002033message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002034 optional uint32 cluster = 1;
2035 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002036 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002037}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002038
Chenjie Yu05013b32017-11-21 10:21:41 -08002039/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002040 * Pulls Cpu Time Per Uid.
2041 * Note that isolated process uid time should be attributed to host uids.
2042 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002043message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002044 optional int32 uid = 1 [(is_uid) = true];
David Chen0b5c90c2018-01-25 16:51:49 -08002045 optional uint64 user_time_millis = 2;
2046 optional uint64 sys_time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002047}
2048
2049/**
2050 * Pulls Cpu Time Per Uid per frequency.
2051 * Note that isolated process uid time should be attributed to host uids.
2052 * For each uid, we order the time by descending frequencies.
2053 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002054message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002055 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002056 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002057 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002058}
Hugo Benichi884970e2017-11-14 22:42:46 +09002059
Chenjie Yu05013b32017-11-21 10:21:41 -08002060/**
2061 * Pulls Wifi Controller Activity Energy Info
2062 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002063message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002064 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002065 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002066 // stack reported state
2067 // TODO: replace this with proto enum
2068 optional int32 stack_state = 2;
2069 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002070 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002071 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002072 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002073 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002074 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002075 // product of current(mA), voltage(V) and time(ms)
2076 optional uint64 controller_energy_used = 6;
2077}
2078
2079/**
2080 * Pulls Modem Activity Energy Info
2081 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002082message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002083 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002084 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002085 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08002086 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08002087 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002088 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002089 /**
2090 * Tx power index
2091 * index 0 = tx_power < 0dBm
2092 * index 1 = 0dBm < tx_power < 5dBm
2093 * index 2 = 5dBm < tx_power < 15dBm
2094 * index 3 = 15dBm < tx_power < 20dBm
2095 * index 4 = tx_power > 20dBm
2096 */
2097 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002098 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002099 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002100 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002101 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002102 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002103 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002104 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002105 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002106 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002107 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002108 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002109 // product of current(mA), voltage(V) and time(ms)
2110 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002111}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002112
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002113/**
2114 * Pulls Bluetooth Activity Energy Info
2115 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2116 */
2117message BluetoothActivityInfo {
2118 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002119 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002120 // bluetooth stack state
2121 optional int32 bluetooth_stack_state = 2;
2122 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002123 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002124 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002125 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002126 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002127 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002128 // product of current(mA), voltage(V) and time(ms)
2129 optional uint64 energy_used = 6;
2130}
2131
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002132/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002133 * Logs the memory stats for a process.
2134 */
2135message ProcessMemoryState {
2136 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002137 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002138
2139 // The process name.
2140 optional string process_name = 2;
2141
2142 // oom adj score.
2143 optional int32 oom_score = 3;
2144
2145 // # of page-faults
2146 optional int64 pgfault = 4;
2147
2148 // # of major page-faults
2149 optional int64 pgmajfault = 5;
2150
Rajeev Kumar90235992018-01-29 11:06:48 -08002151 // RSS
2152 optional int64 rss_in_bytes = 6;
2153
2154 // CACHE
2155 optional int64 cache_in_bytes = 7;
2156
2157 // SWAP
2158 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002159}
2160
2161/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002162 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002163 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002164message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002165 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002166}
2167
2168/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002169 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002170 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002171message SystemUptime {
2172 // Milliseconds since the system was booted.
2173 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2174 // for external input).
2175 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002176 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002177}
2178
2179/*
2180 * Reads from /proc/uid_concurrent_active_time which has the format:
2181 * active: X (X is # cores)
2182 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2183 * [uid1]: [time-0] [time-1] [time-2] ... ...
2184 * ...
2185 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2186 * The file contains a monotonically increasing count of time for a single boot.
2187 */
2188message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002189 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002190 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002191}
2192
2193/**
2194 * Reads from /proc/uid_concurrent_policy_time which has the format:
2195 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2196 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2197 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2198 * ...
2199 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2200 * The file contains a monotonically increasing count of time for a single boot.
2201 */
2202message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002203 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002204 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002205 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002206}
2207
2208/*
2209 * Pulls free disk space, for data, system partition and temporary directory.
2210 */
2211message DiskSpace {
2212 // available bytes in data partition
2213 optional uint64 data_available_bytes = 1;
2214 // available bytes in system partition
2215 optional uint64 system_available_bytes = 2;
2216 // available bytes in download cache or temp directories
2217 optional uint64 temp_available_bytes = 3;
2218}
Tej Singhbf972d92018-01-10 20:51:13 -08002219
2220/**
2221 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002222 * Pulled from:
2223 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002224 */
2225message RemainingBatteryCapacity {
2226 optional int32 charge_uAh = 1;
2227}
2228
2229/**
2230 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002231 * Pulled from:
2232 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002233 */
2234message FullBatteryCapacity {
2235 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08002236}
2237
2238/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002239 * Pulls battery voltage.
2240 * Pulled from:
2241 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2242 */
2243message BatteryVoltage {
2244 // The voltage of the battery, in millivolts.
2245 optional int32 voltage_mV = 1;
2246}
2247
2248/**
Tej Singhd89137e2018-03-26 14:51:40 -07002249 * Pulls the temperature of various parts of the device.
2250 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002251 *
2252 * Pulled from:
2253 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2254 */
2255message Temperature {
2256 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2257 optional android.os.TemperatureTypeEnum sensor_location = 1;
2258
2259 // The name of the temperature source. Eg. CPU0
2260 optional string sensor_name = 2;
2261
Tej Singhd89137e2018-03-26 14:51:40 -07002262 // Temperature in tenths of a degree C.
2263 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08002264}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002265
2266/**
2267 * Pulls the statistics of calls to Binder.
2268 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002269 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2270 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002271 *
2272 * Next tag: 14
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002273 */
2274message BinderCalls {
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002275 optional int32 uid = 1 [(is_uid) = true];
2276 // Fully qualified class name of the API call.
2277 //
2278 // This is a system server class name.
2279 //
2280 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2281 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2282 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2283 // commonly used APIs.
2284 optional string service_class_name = 2;
2285 // Method name of the API call. It can also be a transaction code if we cannot
2286 // resolve it to a name. See Binder#getTransactionName.
2287 //
2288 // This is a system server method name.
2289 optional string service_method_name = 3;
2290 // Total number of API calls.
2291 optional int64 call_count = 4;
2292 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2293 optional bool screen_interactive = 13;
2294 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2295 // call_count will be equal to recorded_call_count.
2296 //
2297 // If recorded_call_count is different than call_count, it means data collection has been
2298 // sampled. All the fields below will be sampled in this case.
2299 optional int64 recorded_call_count = 12;
2300 // Number of exceptions thrown by the API.
2301 optional int64 recorded_exception_count = 5;
2302 // Total latency of all API calls.
2303 // Average can be computed using total_latency_micros / recorded_call_count.
2304 optional int64 recorded_total_latency_micros = 6;
2305 // Maximum latency of one API call.
2306 optional int64 recorded_max_latency_micros = 7;
2307 // Total CPU usage of all API calls.
2308 // Average can be computed using total_cpu_micros / recorded_call_count.
2309 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2310 optional int64 recorded_total_cpu_micros = 8;
2311 // Maximum CPU usage of one API call.
2312 optional int64 recorded_max_cpu_micros = 9;
2313 // Maximum parcel reply size of one API call.
2314 optional int64 recorded_max_reply_size_bytes = 10;
2315 // Maximum parcel request size of one API call.
2316 optional int64 recorded_max_request_size_bytes = 11;
2317}
2318
2319/**
2320 * Pulls the statistics of exceptions during calls to Binder.
2321 *
2322 * Binder stats are cumulative from boot unless somebody reset the data using
2323 * > adb shell dumpsys binder_calls_stats --reset
2324 */
2325message BinderCallsExceptions {
2326 // Exception class name, e.g. java.lang.IllegalArgumentException.
2327 //
2328 // This is an exception class name thrown by the system server.
2329 optional string exception_class_name = 1;
2330 // Total number of exceptions.
2331 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002332}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002333
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002334/**
2335 * Pulls the statistics of message dispatching on HandlerThreads.
2336 *
2337 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2338 * config on the device.
2339 *
2340 * Next tag: 11
2341 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002342message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002343 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002344 optional int32 uid = 1 [(is_uid) = true];
2345
2346 // Fully qualified class name of the handler target class.
2347 //
2348 // This field does not contain PII. This is a system server class name.
2349 optional string handler_class_name = 2;
2350
2351 // The name of the thread that runs the Looper.
2352 //
2353 // This field does not contain PII. This is a system server thread name.
2354 optional string looper_thread_name = 3;
2355
2356 // The name of the dispatched message.
2357 //
2358 // This field does not contain PII. This is a system server constant or class
2359 // name.
2360 optional string message_name = 4;
2361
2362 // Total number of successfully dispatched messages.
2363 optional int64 message_count = 5;
2364
2365 // Total number of messages that failed dispatching.
2366 optional int64 exception_count = 6;
2367
2368 // Total number of processed messages we have data recorded for. If we
2369 // collected data for all the messages, message_count will be equal to
2370 // recorded_message_count.
2371 //
2372 // If recorded_message_count is different than message_count, it means data
2373 // collection has been sampled. All the fields below will be sampled in this
2374 // case.
2375 optional int64 recorded_message_count = 7;
2376
2377 // Total latency of all processed messages.
2378 // Average can be computed using recorded_total_latency_micros /
2379 // recorded_message_count.
2380 optional int64 recorded_total_latency_micros = 8;
2381
2382 // Total CPU usage of all processed message.
2383 // Average can be computed using recorded_total_cpu_micros /
2384 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002385 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002386 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002387
2388 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2389 optional bool screen_interactive = 10;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002390}
Tej Singh86dc9db2018-09-06 00:39:57 +00002391
2392/**
2393 * Pulls disk information, such as write speed and latency.
2394 */
2395message DiskStats {
2396 // Time taken to open, write 512B to, and close a file.
2397 // -1 if error performing the check.
2398 optional int64 data_write_latency_millis = 1;
2399
2400 optional bool file_based_encryption = 2;
2401
2402 // Recent disk write speed in kB/s.
2403 // -1 if error querying storageed.
2404 // 0 if data is unavailable.
2405 optional int32 recent_disk_write_speed = 3;
2406}
2407
2408
2409/**
2410 * Free and total bytes of the Data, Cache, and System partition.
2411 */
2412message DirectoryUsage {
2413 enum Directory {
2414 UNKNOWN = 0;
2415 DATA = 1;
2416 CACHE = 2;
2417 SYSTEM = 3;
2418 }
2419 optional Directory directory = 1;
2420 optional int64 free_bytes = 2;
2421 optional int64 total_bytes = 3;
2422}
2423
2424
2425/**
2426 * Size of an application: apk size, data size, and cache size.
2427 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2428 * Information is only reported for apps with the primary user (user 0).
2429 * Sizes are aggregated by package name.
2430 */
2431message AppSize {
2432 // Including uids will involve modifying diskstats logic.
2433 optional string package_name = 1;
2434 // App size in bytes. -1 if unavailable.
2435 optional int64 app_size_bytes = 2;
2436 // App data size in bytes. -1 if unavailable.
2437 optional int64 app_data_size_bytes = 3;
2438 // App cache size in bytes. -1 if unavailable.
2439 optional int64 app_cache_size_bytes = 4;
2440 // Time that the cache file was produced.
2441 // Uses System.currentTimeMillis(), which is wall clock time.
2442 optional int64 cache_time_millis = 5;
2443}
2444
2445
2446/**
2447 * Size of a particular category. Eg: photos, videos.
2448 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2449 */
2450message CategorySize {
2451 enum Category {
2452 UNKNOWN = 0;
2453 APP_SIZE = 1;
2454 APP_DATA_SIZE = 2;
2455 APP_CACHE_SIZE = 3;
2456 PHOTOS = 4;
2457 VIDEOS = 5;
2458 AUDIO = 6;
2459 DOWNLOADS = 7;
2460 SYSTEM = 8;
2461 OTHER = 9;
2462 }
2463 optional Category category = 1;
2464 // Category size in bytes.
2465 optional int64 size_bytes = 2;
2466 // Time that the cache file was produced.
2467 // Uses System.currentTimeMillis(), which is wall clock time.
2468 optional int64 cache_time_millis = 3;
2469}
Tej Singhd6d6d772018-09-05 17:41:25 -07002470
2471/**
2472 * Pulls the number of fingerprints for each user.
2473 *
2474 * Pulled from StatsCompanionService, which queries FingerprintManager.
2475 */
2476message NumFingerprints {
2477 // The associated user. Eg: 0 for owners, 10+ for others.
2478 // Defined in android/os/UserHandle.java
2479 optional int32 user = 1;
2480 // Number of fingerprints registered to that user.
2481 optional int32 num_fingerprints = 2;
2482}
Chenjie Yu12e5e672018-09-14 15:54:59 -07002483
2484/**
2485 * Pulled from ProcessStatsService.java
2486 */
2487message ProcStats {
2488 optional android.service.procstats.ProcessStatsSectionProto proc_stats_section = 1;
2489}