blob: 9af31b9ead80a6242a419533db552fbe9ae24fa8 [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
Yao Chend54f9dd2017-10-17 17:37:48 +000019// TODO: Not the right package and class name
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070021option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080022option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070023
Yao Chen9c1debe2018-02-19 14:39:19 -080024import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080025import "frameworks/base/core/proto/android/app/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080026import "frameworks/base/core/proto/android/os/enums.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080027import "frameworks/base/core/proto/android/server/enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080028import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080029import "frameworks/base/core/proto/android/telephony/enums.proto";
30import "frameworks/base/core/proto/android/view/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080031
Yao Chend54f9dd2017-10-17 17:37:48 +000032/**
Stefan Lafonae2df012017-11-14 09:17:21 -080033 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000034 * raw stats log events from the Android system, also known as "atoms."
35 *
36 * This field contains a single oneof with all of the available messages.
37 * The stats-log-api-gen tool runs as part of the Android build and
38 * generates the android.util.StatsLog class, which contains the constants
39 * and methods that Android uses to log.
40 *
Stefan Lafonae2df012017-11-14 09:17:21 -080041 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000042 * Instead, statsd on Android constructs these messages synthetically,
43 * in the format defined here and in stats_log.proto.
44 */
Stefan Lafonae2df012017-11-14 09:17:21 -080045message Atom {
46 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070047 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070048 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
49 BleScanStateChanged ble_scan_state_changed = 2;
50 BleUnoptimizedScanStateChanged ble_unoptimized_scan_state_changed = 3;
51 BleScanResultReceived ble_scan_result_received = 4;
52 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080053 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070054 SyncStateChanged sync_state_changed = 7;
55 ScheduledJobStateChanged scheduled_job_state_changed = 8;
56 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070057 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080058 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
59 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
60 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
61 // TODO: 14-19 are blank, but need not be
62 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
63 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
64 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070065 AudioStateChanged audio_state_changed = 23;
66 MediaCodecActivityChanged media_codec_activity_changed = 24;
67 CameraStateChanged camera_state_changed = 25;
68 FlashlightStateChanged flashlight_state_changed = 26;
69 UidProcessStateChanged uid_process_state_changed = 27;
70 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
71 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070072 BatteryLevelChanged battery_level_changed = 30;
73 ChargingStateChanged charging_state_changed = 31;
74 PluggedStateChanged plugged_state_changed = 32;
75 DeviceTemperatureReported device_temperature_reported = 33;
76 DeviceOnStatusChanged device_on_status_changed = 34;
77 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
78 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070079 WifiLockStateChanged wifi_lock_state_changed = 37;
80 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
81 WifiScanStateChanged wifi_scan_state_changed = 39;
82 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070083 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070084 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070085 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090086 PacketWakeupOccurred packet_wakeup_occurred = 44;
David Chen9e3808c2017-11-20 17:25:34 -080087 DropboxErrorChanged dropbox_error_changed = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -080088 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080089 AppBreadcrumbReported app_breadcrumb_reported = 47;
Olivier Gaillardaed7f122017-12-12 14:26:22 +000090 AppStartChanged app_start_changed = 48;
91 AppStartCancelChanged app_start_cancel_changed = 49;
92 AppStartFullyDrawnChanged app_start_fully_drawn_changed = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -080093 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -080094 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -080095 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -080096 LmkStateChanged lmk_state_changed = 54;
97 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -080098 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -080099 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800100 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800101 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800102 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800103 CallStateChanged call_state_changed = 61;
Bookatzc1a050a2017-10-10 15:49:28 -0700104 // TODO: Reorder the numbering so that the most frequent occur events occur in the first 15.
Yao Chend54f9dd2017-10-17 17:37:48 +0000105 }
David Chenc8a43242017-10-17 16:23:28 -0700106
David Chen6e3e6cb2018-01-03 16:14:06 -0800107 // Pulled events will start at field 10000.
Tej Singhbf972d92018-01-10 20:51:13 -0800108 // Next: 10021
David Chenc8a43242017-10-17 16:23:28 -0700109 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800110 WifiBytesTransfer wifi_bytes_transfer = 10000;
111 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
112 MobileBytesTransfer mobile_bytes_transfer = 10002;
113 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800114 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800115 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800116 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800117 CpuTimePerFreq cpu_time_per_freq = 10008;
118 CpuTimePerUid cpu_time_per_uid = 10009;
119 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
120 WifiActivityEnergyInfo wifi_activity_energy_info = 10011;
121 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800122 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800123 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800124 SystemElapsedRealtime system_elapsed_realtime = 10014;
125 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800126 CpuActiveTime cpu_active_time = 10016;
127 CpuClusterTime cpu_cluster_time = 10017;
Chenjie Yu937d7422018-01-10 16:37:53 -0800128 DiskSpace disk_space = 10018;
Tej Singhbf972d92018-01-10 20:51:13 -0800129 RemainingBatteryCapacity remaining_battery_capacity = 10019;
130 FullBatteryCapacity full_battery_capacity = 10020;
David Chenc8a43242017-10-17 16:23:28 -0700131 }
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700132}
133
Yao Chend54f9dd2017-10-17 17:37:48 +0000134/**
Yangster-mac20877162017-12-22 17:19:39 -0800135 * This proto represents a node of an attribution chain.
136 * Note: All attribution chains are represented as a repeated field of type
137 * AttributionNode. It is understood that in such arrays, the order is that
138 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000139 */
Yangster-mac20877162017-12-22 17:19:39 -0800140message AttributionNode {
141 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800142 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800143
Yangster-mac20877162017-12-22 17:19:39 -0800144 // The (optional) string tag for an element in the attribution chain. If the
145 // element has no tag, it is encoded as an empty string.
146 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700147}
148
Yao Chend54f9dd2017-10-17 17:37:48 +0000149/*
150 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800151 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000152 *
153 * RULES:
154 * - The field ids for each atom must start at 1, and count upwards by 1.
155 * Skipping field ids is not allowed.
156 * - These form an API, so renaming, renumbering or removing fields is
157 * not allowed between android releases. (This is not currently enforced,
158 * but there will be a tool to enforce this restriction).
159 * - The types must be built-in protocol buffer types, namely, no sub-messages
160 * are allowed (yet). The bytes type is also not allowed.
161 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800162 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000163 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800164 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000165 * - A field that is a uid should be a string field, tagged with the [xxx]
166 * annotation. The generated code on android will be represented by UIDs,
167 * and those UIDs will be translated in xxx to those strings.
168 *
169 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700170 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000171 * - If there is a UID, it goes first. Think in an object-oriented fashion.
172 * *****************************************************************************
173 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700174
Yao Chend54f9dd2017-10-17 17:37:48 +0000175/**
176 * Logs when the screen state changes.
177 *
178 * Logged from:
179 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
180 */
181message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800182 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800183 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700184}
Yao Chend54f9dd2017-10-17 17:37:48 +0000185
186/**
Bookatzc1a050a2017-10-10 15:49:28 -0700187 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000188 *
189 * Logged from:
190 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
191 */
Bookatzc1a050a2017-10-10 15:49:28 -0700192message UidProcessStateChanged {
Yao Chen9c1debe2018-02-19 14:39:19 -0800193 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY];
Yao Chend54f9dd2017-10-17 17:37:48 +0000194
Bookatzdb026a22018-01-10 19:01:56 -0800195 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800196 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000197}
198
199/**
Bookatzc1a050a2017-10-10 15:49:28 -0700200 * Logs that a process started, finished, crashed, or ANRed.
201 *
202 * Logged from:
203 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
204 */
205message ProcessLifeCycleStateChanged {
David Chen0b5c90c2018-01-25 16:51:49 -0800206 // TODO: should be a string tagged w/ uid annotation
207 optional int32 uid = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700208
David Chen0b5c90c2018-01-25 16:51:49 -0800209 // The process name (usually same as the app name).
Bookatzc1a050a2017-10-10 15:49:28 -0700210 optional string name = 2;
211
Bookatzddccf0a2017-11-28 16:48:14 -0800212 // What lifecycle state the process changed to.
213 // This enum is specific to atoms.proto.
214 enum Event {
215 PROCESS_FINISHED = 0;
216 PROCESS_STARTED = 1;
217 PROCESS_CRASHED = 2;
218 PROCESS_ANRED = 3;
219 }
220 optional Event event = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700221}
222
Bookatzc1a050a2017-10-10 15:49:28 -0700223/**
224 * Logs when the ble scan state changes.
225 *
226 * Logged from:
227 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
228 */
229message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800230 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700231
232 enum State {
233 OFF = 0;
234 ON = 1;
235 }
236 optional State state = 2;
237}
238
239/**
240 * Logs when an unoptimized ble scan state changes.
241 *
242 * Logged from:
243 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
244 */
245// TODO: Consider changing to tracking per-scanner-id (log from AppScanStats).
246message BleUnoptimizedScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800247 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700248
249 enum State {
250 OFF = 0;
251 ON = 1;
252 }
253 optional State state = 2;
254}
255
256/**
257 * Logs reporting of a ble scan finding results.
258 *
259 * Logged from:
260 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
261 */
262// TODO: Consider changing to tracking per-scanner-id (log from AppScanStats).
263message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800264 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700265
266 // Number of ble scan results returned.
267 optional int32 num_of_results = 2;
268}
269
270/**
271 * Logs when a sensor state changes.
272 *
273 * Logged from:
274 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
275 */
276message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800277 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700278
279 // TODO: Is there a way to get the actual name of the sensor?
280 // The id (int) of the sensor.
281 optional int32 sensor_id = 2;
282
283 enum State {
284 OFF = 0;
285 ON = 1;
286 }
287 optional State state = 3;
288}
289
290
291/**
292 * Logs when GPS state changes.
293 *
294 * Logged from:
295 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
296 */
297message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800298 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700299
300 enum State {
301 OFF = 0;
302 ON = 1;
303 }
304 optional State state = 2;
305}
306
307
308/**
309 * Logs when a sync manager sync state changes.
310 *
311 * Logged from:
312 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
313 */
314message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800315 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700316
David Chen0b5c90c2018-01-25 16:51:49 -0800317 // Name of the sync (as named in the app). Can be chosen at run-time.
Bookatzc1a050a2017-10-10 15:49:28 -0700318 optional string name = 2;
319
320 enum State {
321 OFF = 0;
322 ON = 1;
323 }
324 optional State state = 3;
325}
326
327/**
328 * Logs when a job scheduler job state changes.
329 *
330 * Logged from:
331 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
332 */
333message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800334 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700335
336 // Name of the job (as named in the app)
337 optional string name = 2;
338
339 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800340 FINISHED = 0;
341 STARTED = 1;
342 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700343 }
344 optional State state = 3;
345
346 // TODO: Consider adding the stopReason (int)
347}
348
349/**
350 * Logs when the audio state changes.
351 *
352 * Logged from:
353 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
354 */
355message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800356 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700357
358 enum State {
359 OFF = 0;
360 ON = 1;
361 }
362 optional State state = 2;
363}
364
365/**
366 * Logs when the video codec state changes.
367 *
368 * Logged from:
369 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
370 */
371message MediaCodecActivityChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800372 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700373
374 enum State {
375 OFF = 0;
376 ON = 1;
377 }
378 optional State state = 2;
379}
380
381/**
382 * Logs when the flashlight state changes.
383 *
384 * Logged from:
385 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
386 */
387message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800388 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700389
390 enum State {
391 OFF = 0;
392 ON = 1;
393 }
394 optional State state = 2;
395}
396
397/**
398 * Logs when the camera state changes.
399 *
400 * Logged from:
401 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
402 */
403message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800404 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700405
406 enum State {
407 OFF = 0;
408 ON = 1;
409 }
410 optional State state = 2;
411}
412
413/**
414 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000415 *
416 * Logged from:
417 * TODO
418 */
Bookatzd6746242017-10-24 18:39:35 -0700419message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800420 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000421
Bookatz1a1b0462018-01-12 11:47:03 -0800422 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
423 // From frameworks/base/core/proto/android/os/enums.proto.
424 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700425
426 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
427 optional string tag = 3;
428
429 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800430 RELEASE = 0;
431 ACQUIRE = 1;
432 CHANGE_RELEASE = 2;
433 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700434 }
435 optional State state = 4;
436}
437
438/**
Bookatzc1a050a2017-10-10 15:49:28 -0700439 * Logs when a partial wakelock is considered 'long' (over 1 min).
440 *
441 * Logged from:
442 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
443 */
444message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800445 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700446
Yao Chend54f9dd2017-10-17 17:37:48 +0000447 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
448 optional string tag = 2;
449
Bookatzc1a050a2017-10-10 15:49:28 -0700450 // TODO: I have no idea what this is.
451 optional string history_tag = 3;
452
453 enum State {
454 OFF = 0;
455 ON = 1;
456 }
457 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000458}
459
Bookatzc1a050a2017-10-10 15:49:28 -0700460/**
461 * Logs Battery Saver state change.
462 *
463 * Logged from:
464 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
465 */
466message BatterySaverModeStateChanged {
467 enum State {
468 OFF = 0;
469 ON = 1;
470 }
471 optional State state = 1;
472}
473
474/**
475 * Logs Doze mode state change.
476 *
477 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800478 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700479 */
480message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800481 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800482}
483
484
485/**
486 * Logs state change of Doze mode including maintenance windows.
487 *
488 * Logged from:
489 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
490 */
491message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800492 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700493}
494
495/**
496 * Logs screen brightness level.
497 *
498 * Logged from:
499 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
500 */
501message ScreenBrightnessChanged {
502 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
503 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700504}
505
506/**
507 * Logs battery level (percent full, from 0 to 100).
508 *
509 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700510 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700511 */
512message BatteryLevelChanged {
513 // Battery level. Should be in [0, 100].
514 optional int32 battery_level = 1;
515}
516
517/**
518 * Logs change in charging status of the device.
519 *
520 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700521 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700522 */
523message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800524 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
525 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700526}
527
528/**
529 * Logs whether the device is plugged in, and what power source it is using.
530 *
531 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700532 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700533 */
534message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800535 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
536 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700537}
538
539/**
540 * Logs the temperature of the device, in tenths of a degree Celsius.
541 *
542 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700543 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700544 */
545message DeviceTemperatureReported {
546 // Temperature in tenths of a degree C.
547 optional int32 temperature = 1;
548}
549
550// TODO: Define this more precisely.
551// TODO: Log the ON state somewhere. It isn't currently logged anywhere.
552/**
553 * Logs when the device turns off or on.
554 *
555 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700556 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700557 */
558message DeviceOnStatusChanged {
559 enum State {
560 OFF = 0;
561 ON = 1;
562 }
563 optional State state = 1;
564}
565
566/**
567 * Logs when an app's wakeup alarm fires.
568 *
569 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700570 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700571 */
572message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800573 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800574
575 // Name of the wakeup alarm.
576 optional string tag = 2;
577}
578
579/**
580 * Logs when an an app causes the mobile radio to change state.
581 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
582 *
583 * Logged from:
584 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
585 */
586message MobileRadioPowerStateChanged {
587 // TODO: Add attribution instead of uid?
588 optional int32 uid = 1;
589
Bookatz1a1b0462018-01-12 11:47:03 -0800590 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
591 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800592}
593
594/**
595 * Logs when an an app causes the wifi radio to change state.
596 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
597 *
598 * Logged from:
599 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
600 */
601message WifiRadioPowerStateChanged {
602 // TODO: Add attribution instead of uid?
603 optional int32 uid = 1;
604
Bookatz1a1b0462018-01-12 11:47:03 -0800605 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
606 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700607}
608
609/**
610 * Logs kernel wakeup reasons and aborts.
611 *
612 * Logged from:
613 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
614 */
615message KernelWakeupReported {
616 // Name of the kernel wakeup reason (or abort).
617 optional string wakeup_reason_name = 1;
618
619 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800620 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700621}
622
623/**
624 * Logs wifi locks held by an app.
625 *
626 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700627 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700628 */
629message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800630 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700631
632 enum State {
633 OFF = 0;
634 ON = 1;
635 }
636 optional State state = 2;
637}
638
639/**
640 * Logs wifi signal strength changes.
641 *
642 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700643 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700644 */
645message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800646 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
647 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700648}
649
650/**
651 * Logs wifi scans performed by an app.
652 *
653 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700654 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700655 */
656message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800657 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700658
659 enum State {
660 OFF = 0;
661 ON = 1;
662 }
663 optional State state = 2;
664}
665
666/**
Tej Singh4503e102018-01-04 14:35:01 -0800667 * Logs wifi multicast locks held by an app
668 *
669 * Logged from:
670 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
671 */
672message WifiMulticastLockStateChanged {
673 repeated AttributionNode attribution_node = 1;
674
675 enum State {
676 OFF = 0;
677 ON = 1;
678 }
679 optional State state = 2;
680}
681
682/**
Tej Singh1ea42892018-01-19 09:27:00 -0800683 * Logs shutdown reason and duration on next boot.
684 *
685 * Logged from:
686 * frameworks/base/core/java/com/android/server/BootReceiver.java
687 */
688message ShutdownSequenceReported {
689 // True if shutdown is for a reboot. Default: false if we do not know.
690 optional bool reboot = 1;
691
692 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
693 optional string reason = 2;
694
695 // Beginning of shutdown time in ms using wall clock time since unix epoch.
696 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800697 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800698
699 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800700 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800701}
702
Tej Singh6483ea42018-01-25 17:45:49 -0800703
704/**
705 * Logs boot reason and duration.
706 *
707 * Logged from:
708 * system/core/bootstat/bootstat.cpp
709 */
710message BootSequenceReported {
711 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
712 // Default: "<EMPTY>" if not available.
713 optional string bootloader_reason = 1;
714
715 // Reason for system boot. Eg. bootloader, reboot,userrequested
716 // Default: "<EMPTY>" if not available.
717 optional string system_reason = 2;
718
719 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800720 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800721
722 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800723 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800724
725 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800726 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800727
728 // Time since last boot in ms. Default: 0 if not available.
729 optional int64 time_since_last_boot = 6;
730}
731
Tej Singhc477d9c2018-02-05 18:31:39 -0800732
733/**
734 * Logs call state and disconnect cause (if applicable).
735 *
736 * Logged from:
737 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
738 */
739message CallStateChanged {
740 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
741 // From frameworks/base/core/proto/android/telecomm/enums.proto.
742 optional android.telecom.CallStateEnum call_state = 1;
743
744 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
745 // This value is only applicable when the call_state is DISCONNECTED, and
746 // should always be UNKNOWN if the call_state is not DISCONNECTED.
747 // From frameworks/base/core/proto/android/telecomm/enums.proto.
748 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
749
750 // True if the call is self-managed, which are apps that use the
751 // telecom infrastructure to make their own calls.
752 optional bool self_managed = 3;
753
754 // True if call is external. External calls are calls on connected Wear
755 // devices but show up in Telecom so the user can pull them onto the device.
756 optional bool external_call = 4;
757}
758
Tej Singh1ea42892018-01-19 09:27:00 -0800759/**
Tej Singhbb8554a2018-01-26 11:59:14 -0800760 * Logs the duration of a davey (jank of >=700ms) when it occurs
761 *
762 * Logged from:
763 * frameworks/base/libs/hwui/JankTracker.cpp
764 */
765message DaveyOccurred {
766 // Amount of time it took to render the frame. Should be >=700ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800767 optional int64 jank_duration_millis = 1;
Tej Singhbb8554a2018-01-26 11:59:14 -0800768}
769
770/**
Bookatze5885242017-10-24 20:10:31 -0700771 * Logs phone signal strength changes.
772 *
773 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700774 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700775 */
776message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800777 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
778 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -0700779}
780
781/**
782 * Logs that a setting was updated.
783 * Logged from:
784 * frameworks/base/core/java/android/provider/Settings.java
785 * The tag and is_default allow resetting of settings to default values based on the specified
786 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
787 */
788message SettingChanged {
789 // The name of the setting.
790 optional string setting = 1;
791
792 // The change being imposed on this setting. May represent a number, eg "3".
793 optional string value = 2;
794
795 // The new value of this setting. For most settings, this is same as value. For some settings,
796 // value is +X or -X where X represents an element in a set. For example, if the previous value
797 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
798 // The +/- feature is currently only used for location_providers_allowed.
799 optional string new_value = 3;
800
801 // The previous value of this setting.
802 optional string prev_value = 4;
803
804 // The tag used with the is_default for resetting sets of settings. This is generally null.
805 optional string tag = 5;
806
Bookatz90867622018-01-31 15:05:57 -0800807 // True if this setting with tag should be resettable.
808 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -0700809
810 // The user ID associated. Defined in android/os/UserHandle.java
811 optional int32 user = 7;
812}
Chenjie Yub3dda412017-10-24 13:41:59 -0700813
Chenjie Yu05013b32017-11-21 10:21:41 -0800814/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -0700815 * Logs activity going to foreground or background
816 *
817 * Logged from:
818 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
819 */
820message ActivityForegroundStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800821 optional int32 uid = 1;
822 optional string pkg_name = 2;
823 optional string class_name = 3;
824
Chenjie Yu3d4f6042017-10-27 15:39:34 -0700825 enum Activity {
826 MOVE_TO_BACKGROUND = 0;
827 MOVE_TO_FOREGROUND = 1;
828 }
Chenjie Yu3d4f6042017-10-27 15:39:34 -0700829 optional Activity activity = 4;
830}
David Chenc8a43242017-10-17 16:23:28 -0700831
832/**
David Chen9e3808c2017-11-20 17:25:34 -0800833 * Logs when an error is written to dropbox.
834 * Logged from:
835 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
836 */
837message DropboxErrorChanged {
838 // The uid if available. -1 means not available.
839 optional int32 uid = 1;
840
841 // Tag used when recording this error to dropbox. Contains data_ or system_ prefix.
842 optional string tag = 2;
843
844 // The name of the process.
845 optional string process_name = 3;
846
847 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -0800848 optional sint32 pid = 4;
David Chen9e3808c2017-11-20 17:25:34 -0800849
850 // 1 indicates is instant app. -1 indicates Not applicable.
David Chen6e3e6cb2018-01-03 16:14:06 -0800851 optional sint32 is_instant_app = 5;
David Chen9e3808c2017-11-20 17:25:34 -0800852
853 // The activity name if available.
854 optional string activity_name = 6;
855
David Chen6e3e6cb2018-01-03 16:14:06 -0800856 // The package name if available.
857 optional string package_name = 7;
858
David Chen9e3808c2017-11-20 17:25:34 -0800859 // 1 indicates in foreground. -1 indicates not available.
David Chen6e3e6cb2018-01-03 16:14:06 -0800860 optional sint32 is_foreground = 8;
David Chen9e3808c2017-11-20 17:25:34 -0800861}
862
David Chen0a368b22017-12-06 16:28:16 -0800863/*
864 * Allows other apps to push events into statsd.
865 * Logged from:
866 * frameworks/base/core/java/android/util/StatsLog.java
867 */
David Chen0b5c90c2018-01-25 16:51:49 -0800868message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -0800869 // The uid of the application that sent this custom atom.
870 optional int32 uid = 1;
871
872 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
873 optional int32 label = 2;
874
875 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
876 // predicates for the metrics).
877 enum State {
878 UNKNOWN = 0;
879 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
880 STOP = 2;
881 START = 3;
882 }
883 optional State state = 3;
884}
885
David Chen9e3808c2017-11-20 17:25:34 -0800886/**
Bookatz8fcd09a2017-12-18 13:01:10 -0800887 * Logs when statsd detects an anomaly.
888 *
889 * Logged from:
890 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
891 */
892message AnomalyDetected {
893 // Uid that owns the config whose anomaly detection alert fired.
894 optional int32 config_uid = 1;
895
Yangster-mac94e197c2018-01-02 16:03:03 -0800896 // Id of the config whose anomaly detection alert fired.
897 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -0800898
Yangster-mac94e197c2018-01-02 16:03:03 -0800899 // Id of the alert (i.e. name of the anomaly that was detected).
900 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -0800901}
902
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000903message AppStartChanged {
904 // The uid if available. -1 means not available.
905 optional int32 uid = 1;
906
907 // The app package name.
908 optional string pkg_name = 2;
909
910 enum TransitionType {
911 APP_START_TRANSITION_TYPE_UNKNOWN = 0;
912 WARM = 1;
913 HOT = 2;
914 COLD = 3;
915 }
916 // The transition type.
917 optional TransitionType type = 3;
918
919 // The activity name.
920 optional string activity_name = 4;
921
922 // The name of the calling app. Empty if not set.
923 optional string calling_pkg_name = 5;
924
925 // Whether the app is an instant app.
926 optional bool is_instant_app = 6;
927
928 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -0800929 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000930
Bookatz80d11a02018-01-16 10:46:35 -0800931 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000932
David Chen0b5c90c2018-01-25 16:51:49 -0800933 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000934 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -0800935 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000936 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -0800937 optional int32 bind_application_delay_millis = 11;
938 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000939
940 // Empty if not set.
941 optional string launch_token = 13;
942
Calin Juravle0a8bea82018-02-13 12:01:41 -0800943 // The compiler filter used when when the package was optimized.
944 optional string package_optimization_compilation_filter = 14;
945
946 // The reason why the package was optimized.
947 optional string package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000948}
949
950message AppStartCancelChanged {
951 // The uid if available. -1 means not available.
952 optional int32 uid = 1;
953
954 // The app package name.
955 optional string pkg_name = 2;
956
957 enum TransitionType {
958 APP_START_TRANSITION_TYPE_UNKNOWN = 0;
959 WARM = 1;
960 HOT = 2;
961 COLD = 3;
962 }
963 // The transition type.
964 optional TransitionType type = 3;
965
966 // The activity name.
967 optional string activity_name = 4;
968}
969
970message AppStartFullyDrawnChanged {
971 // The uid if available. -1 means not available.
972 optional int32 uid = 1;
973
974 // The app package name.
975 optional string pkg_name = 2;
976
977 enum TransitionType {
978 APP_START_TRANSITION_TYPE_UNKNOWN = 0;
979 WITH_BUNDLE = 1;
980 WITHOUT_BUNDLE = 2;
981 }
982 // The transition type.
983 optional TransitionType type = 3;
984
985 // The activity name.
986 optional string activity_name = 4;
987
988 optional bool transition_process_running = 5;
989
990 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -0800991 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000992}
993
Bookatz8fcd09a2017-12-18 13:01:10 -0800994/**
Chenjie Yu52cacc62017-12-08 18:11:45 -0800995 * Logs a picture-in-picture action
996 * Logged from:
997 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
998 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
999 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1000 */
1001message PictureInPictureStateChanged {
1002 optional int32 uid = 1;
1003
1004 optional string package_name = 2;
1005
1006 optional string class_name = 3;
1007
1008 // Picture-in-Picture action occurred, similar to
1009 // frameworks/base/proto/src/metrics_constants.proto
1010 enum State {
1011 ENTERED = 1;
1012 EXPANDED_TO_FULL_SCREEN = 2;
1013 MINIMIZED = 3;
1014 DISMISSED = 4;
1015 }
1016 optional State state = 4;
1017}
1018
1019/**
Chenjie Yue8904192017-12-08 19:12:57 -08001020 * Logs overlay action
1021 * Logged from:
1022 * services/core/java/com/android/server/wm/Session.java
1023 */
1024message OverlayStateChanged {
1025 optional int32 uid = 1;
1026
1027 optional string package_name = 2;
1028
1029 optional bool using_alert_window = 3;
1030
1031 enum State {
1032 ENTERED = 1;
1033 EXITED = 2;
1034 }
1035 optional State state = 4;
1036}
1037
Chenjie Yuccfe6452018-01-30 11:33:21 -08001038/*
1039 * Logs foreground service starts and stops.
1040 * Note that this is not when a service starts or stops, but when it is
1041 * considered foreground.
1042 * Logged from
1043 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1044 */
1045message ForegroundServiceStateChanged {
1046 optional int32 uid = 1;
1047 // package_name + "/" + class_name
1048 optional string short_name = 2;
1049
1050 enum State {
1051 ENTER = 1;
1052 EXIT = 2;
1053 }
1054 optional State state = 3;
1055}
1056
Chenjie Yue8904192017-12-08 19:12:57 -08001057/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001058 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1059 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1060 * attributed back to the parent (host) uid. One example is Chrome.
1061 *
1062 * Logged from:
1063 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1064 */
1065message IsolatedUidChanged {
1066 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
1067 optional int32 parent_uid = 1;
1068
1069 optional int32 isolated_uid = 2;
1070
1071 // We expect an isolated uid to be removed before if it's used for another parent uid.
1072 enum Event {
1073 REMOVED = 0;
1074 CREATED = 1;
1075 }
1076 optional Event event = 3;
1077}
1078
1079/*
1080 * Logs the reception of an incoming network packet causing the main system to wake up for
1081 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1082 * and processed by WakeupController.cpp.
1083 */
1084message PacketWakeupOccurred {
1085 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1086 // delivered nowhere.
1087 optional int32 uid = 1;
1088 // The interface name on which the packet was received.
1089 optional string iface = 2;
1090 // The ethertype value of the packet.
1091 optional int32 ethertype = 3;
1092 // String representation of the destination MAC address of the packet.
1093 optional string destination_hardware_address = 4;
1094 // String representation of the source address of the packet if this was an IP packet.
1095 optional string source_ip = 5;
1096 // String representation of the destination address of the packet if this was an IP packet.
1097 optional string destination_ip = 6;
1098 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1099 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1100 // families.
1101 optional int32 ip_next_header = 7;
1102 // The source port if this was a TCP or UDP packet.
1103 optional int32 source_port = 8;
1104 // The destination port if this was a TCP or UDP packet.
1105 optional int32 destination_port = 9;
1106}
1107
1108/*
1109 * Logs the memory stats for an app on startup.
1110 * Logged from:
1111 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1112 */
1113message AppStartMemoryStateCaptured {
1114 // The uid if available. -1 means not available.
1115 optional int32 uid = 1;
1116
1117 // The process name.
1118 optional string process_name = 2;
1119
1120 // The activity name.
1121 optional string activity_name = 3;
1122
1123 // # of page-faults
1124 optional int64 pgfault = 4;
1125
1126 // # of major page-faults
1127 optional int64 pgmajfault = 5;
1128
1129 // RSS
1130 optional int64 rss_in_bytes = 6;
1131
1132 // CACHE
1133 optional int64 cache_in_bytes = 7;
1134
1135 // SWAP
1136 optional int64 swap_in_bytes = 8;
1137}
1138
1139/*
1140 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1141 * for LMK event.
1142 * Logged from:
1143 * system/core/lmkd/lmkd.c
1144 */
1145message LmkStateChanged {
1146 enum State {
1147 UNKNOWN = 0;
1148 START = 1;
1149 STOP = 2;
1150 }
1151 optional State state = 1;
1152}
1153
1154/*
1155 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1156 * Logged from:
1157 * system/core/lmkd/lmkd.c
1158 */
1159message LmkKillOccurred {
1160 // The uid if available. -1 means not available.
1161 optional int32 uid = 1;
1162
1163 // The process name.
1164 optional string process_name = 2;
1165
1166 // oom adj score.
1167 optional int32 oom_score = 3;
1168
1169 // # of page-faults
1170 optional int64 pgfault = 4;
1171
1172 // # of major page-faults
1173 optional int64 pgmajfault = 5;
1174
1175 // RSS
1176 optional int64 rss_in_bytes = 6;
1177
1178 // CACHE
1179 optional int64 cache_in_bytes = 7;
1180
1181 // SWAP
1182 optional int64 swap_in_bytes = 8;
1183}
1184
1185//////////////////////////////////////////////////////////////////////
1186// Pulled atoms below this line //
1187//////////////////////////////////////////////////////////////////////
1188
1189/**
David Chenc8a43242017-10-17 16:23:28 -07001190 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
1191 *
1192 * Pulled from:
1193 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1194 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001195message WifiBytesTransfer {
David Chenc8a43242017-10-17 16:23:28 -07001196 optional int32 uid = 1;
1197
1198 optional int64 rx_bytes = 2;
1199
1200 optional int64 rx_packets = 3;
1201
1202 optional int64 tx_bytes = 4;
1203
1204 optional int64 tx_packets = 5;
1205}
1206
1207/**
1208 * Pulls bytes transferred via wifi (separated by foreground and background usage).
1209 *
1210 * Pulled from:
1211 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1212 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001213message WifiBytesTransferByFgBg {
David Chenc8a43242017-10-17 16:23:28 -07001214 optional int32 uid = 1;
1215
1216 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
1217 optional int32 is_foreground = 2;
1218
1219 optional int64 rx_bytes = 3;
1220
1221 optional int64 rx_packets = 4;
1222
1223 optional int64 tx_bytes = 5;
1224
1225 optional int64 tx_packets = 6;
1226}
1227
1228/**
1229 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
1230 *
1231 * Pulled from:
1232 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1233 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001234message MobileBytesTransfer {
David Chenc8a43242017-10-17 16:23:28 -07001235 optional int32 uid = 1;
1236
1237 optional int64 rx_bytes = 2;
1238
1239 optional int64 rx_packets = 3;
1240
1241 optional int64 tx_bytes = 4;
1242
1243 optional int64 tx_packets = 5;
1244}
1245
1246/**
1247 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
1248 *
1249 * Pulled from:
1250 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1251 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001252message MobileBytesTransferByFgBg {
David Chenc8a43242017-10-17 16:23:28 -07001253 optional int32 uid = 1;
1254
1255 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
1256 optional int32 is_foreground = 2;
1257
1258 optional int64 rx_bytes = 3;
1259
1260 optional int64 rx_packets = 4;
1261
1262 optional int64 tx_bytes = 5;
1263
1264 optional int64 tx_packets = 6;
1265}
1266
1267/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001268 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
1269 *
1270 * Pulled from:
1271 * StatsCompanionService
1272 */
1273message BluetoothBytesTransfer {
1274 optional int32 uid = 1;
1275
1276 optional int64 rx_bytes = 2;
1277
1278 optional int64 tx_bytes = 3;
1279}
1280
1281/**
David Chenc8a43242017-10-17 16:23:28 -07001282 * Pulls the kernel wakelock durations. This atom is adapted from
1283 * android/internal/os/KernelWakelockStats.java
1284 *
1285 * Pulled from:
1286 * StatsCompanionService using KernelWakelockReader.
1287 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001288message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07001289 optional string name = 1;
1290
1291 optional int32 count = 2;
1292
1293 optional int32 version = 3;
1294
1295 optional int64 time = 4;
1296}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001297
Chenjie Yu05013b32017-11-21 10:21:41 -08001298/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001299 * Pulls low power state information. This includes platform and subsystem sleep state information,
1300 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001301 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001302 * hardware/interfaces/power/1.1/types.hal
1303 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001304message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08001305 // Subsystem name
1306 optional string subsystem_name = 1;
1307 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
1308 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
1309 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001310 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08001311 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001312 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08001313 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07001314}
Chenjie Yu7f8def92017-11-03 09:33:15 -07001315
Chenjie Yu05013b32017-11-21 10:21:41 -08001316/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07001317 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08001318 * Pulls the time the cpu spend on the frequency index. Frequency index
1319 * starts from highest to lowest. The value should be monotonically
1320 * increasing since boot. However, if there is a cpu
1321 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07001322 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001323message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07001324 optional uint32 cluster = 1;
1325 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001326 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07001327}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001328
Chenjie Yu05013b32017-11-21 10:21:41 -08001329/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001330 * Pulls Cpu Time Per Uid.
1331 * Note that isolated process uid time should be attributed to host uids.
1332 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001333message CpuTimePerUid {
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001334 optional uint64 uid = 1;
David Chen0b5c90c2018-01-25 16:51:49 -08001335 optional uint64 user_time_millis = 2;
1336 optional uint64 sys_time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001337}
1338
1339/**
1340 * Pulls Cpu Time Per Uid per frequency.
1341 * Note that isolated process uid time should be attributed to host uids.
1342 * For each uid, we order the time by descending frequencies.
1343 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001344message CpuTimePerUidFreq {
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001345 optional uint64 uid = 1;
1346 optional uint64 freq_idx = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001347 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001348}
Hugo Benichi884970e2017-11-14 22:42:46 +09001349
Chenjie Yu05013b32017-11-21 10:21:41 -08001350/**
1351 * Pulls Wifi Controller Activity Energy Info
1352 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001353message WifiActivityEnergyInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001354 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001355 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001356 // stack reported state
1357 // TODO: replace this with proto enum
1358 optional int32 stack_state = 2;
1359 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001360 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001361 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001362 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001363 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001364 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001365 // product of current(mA), voltage(V) and time(ms)
1366 optional uint64 controller_energy_used = 6;
1367}
1368
1369/**
1370 * Pulls Modem Activity Energy Info
1371 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001372message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001373 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001374 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001375 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001376 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08001377 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001378 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001379 /**
1380 * Tx power index
1381 * index 0 = tx_power < 0dBm
1382 * index 1 = 0dBm < tx_power < 5dBm
1383 * index 2 = 5dBm < tx_power < 15dBm
1384 * index 3 = 15dBm < tx_power < 20dBm
1385 * index 4 = tx_power > 20dBm
1386 */
1387 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08001388 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001389 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08001390 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001391 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08001392 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08001393 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08001394 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08001395 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08001396 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08001397 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08001398 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08001399 // product of current(mA), voltage(V) and time(ms)
1400 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08001401}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001402
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001403/**
1404 * Pulls Bluetooth Activity Energy Info
1405 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
1406 */
1407message BluetoothActivityInfo {
1408 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001409 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001410 // bluetooth stack state
1411 optional int32 bluetooth_stack_state = 2;
1412 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001413 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001414 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001415 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001416 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001417 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001418 // product of current(mA), voltage(V) and time(ms)
1419 optional uint64 energy_used = 6;
1420}
1421
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001422/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001423 * Logs the memory stats for a process.
1424 */
1425message ProcessMemoryState {
1426 // The uid if available. -1 means not available.
1427 optional int32 uid = 1;
1428
1429 // The process name.
1430 optional string process_name = 2;
1431
1432 // oom adj score.
1433 optional int32 oom_score = 3;
1434
1435 // # of page-faults
1436 optional int64 pgfault = 4;
1437
1438 // # of major page-faults
1439 optional int64 pgmajfault = 5;
1440
Rajeev Kumar90235992018-01-29 11:06:48 -08001441 // RSS
1442 optional int64 rss_in_bytes = 6;
1443
1444 // CACHE
1445 optional int64 cache_in_bytes = 7;
1446
1447 // SWAP
1448 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001449}
1450
1451/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001452 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001453 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001454message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08001455 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001456}
1457
1458/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001459 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001460 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001461message SystemUptime {
1462 // Milliseconds since the system was booted.
1463 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
1464 // for external input).
1465 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08001466 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001467}
1468
1469/*
1470 * Reads from /proc/uid_concurrent_active_time which has the format:
1471 * active: X (X is # cores)
1472 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
1473 * [uid1]: [time-0] [time-1] [time-2] ... ...
1474 * ...
1475 * Time-N means the CPU time a UID spent running concurrently with N other processes.
1476 * The file contains a monotonically increasing count of time for a single boot.
1477 */
1478message CpuActiveTime {
1479 optional uint64 uid = 1;
David Chenb639d142018-02-14 17:29:54 -08001480 optional uint32 cluster_number = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001481 optional uint64 idx = 3;
1482 optional uint64 time_millis = 4;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001483}
1484
1485/**
1486 * Reads from /proc/uid_concurrent_policy_time which has the format:
1487 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
1488 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1489 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1490 * ...
1491 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
1492 * The file contains a monotonically increasing count of time for a single boot.
1493 */
1494message CpuClusterTime {
1495 optional uint64 uid = 1;
1496 optional uint64 idx = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001497 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08001498}
1499
1500/*
1501 * Pulls free disk space, for data, system partition and temporary directory.
1502 */
1503message DiskSpace {
1504 // available bytes in data partition
1505 optional uint64 data_available_bytes = 1;
1506 // available bytes in system partition
1507 optional uint64 system_available_bytes = 2;
1508 // available bytes in download cache or temp directories
1509 optional uint64 temp_available_bytes = 3;
1510}
Tej Singhbf972d92018-01-10 20:51:13 -08001511
1512/**
1513 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
1514 * Logged from: frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
1515 */
1516message RemainingBatteryCapacity {
1517 optional int32 charge_uAh = 1;
1518}
1519
1520/**
1521 * Pulls battery capacity, which is the battery capacity when full in uAh.
1522 * Logged from: frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
1523 */
1524message FullBatteryCapacity {
1525 optional int32 capacity_uAh = 1;
Yao Chen9c1debe2018-02-19 14:39:19 -08001526}