blob: 9b01e4bbbdb200dbbafbbdfaa4bc880458de8a6f [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 {
David Chen77ef6712018-02-23 18:23:42 -0800766 // The UID that logged this atom.
767 optional int32 uid = 1;
768
Tej Singhbb8554a2018-01-26 11:59:14 -0800769 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -0800770 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -0800771}
772
773/**
Bookatze5885242017-10-24 20:10:31 -0700774 * Logs phone signal strength changes.
775 *
776 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700777 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700778 */
779message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800780 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
781 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -0700782}
783
784/**
785 * Logs that a setting was updated.
786 * Logged from:
787 * frameworks/base/core/java/android/provider/Settings.java
788 * The tag and is_default allow resetting of settings to default values based on the specified
789 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
790 */
791message SettingChanged {
792 // The name of the setting.
793 optional string setting = 1;
794
795 // The change being imposed on this setting. May represent a number, eg "3".
796 optional string value = 2;
797
798 // The new value of this setting. For most settings, this is same as value. For some settings,
799 // value is +X or -X where X represents an element in a set. For example, if the previous value
800 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
801 // The +/- feature is currently only used for location_providers_allowed.
802 optional string new_value = 3;
803
804 // The previous value of this setting.
805 optional string prev_value = 4;
806
807 // The tag used with the is_default for resetting sets of settings. This is generally null.
808 optional string tag = 5;
809
Bookatz90867622018-01-31 15:05:57 -0800810 // True if this setting with tag should be resettable.
811 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -0700812
813 // The user ID associated. Defined in android/os/UserHandle.java
814 optional int32 user = 7;
815}
Chenjie Yub3dda412017-10-24 13:41:59 -0700816
Chenjie Yu05013b32017-11-21 10:21:41 -0800817/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -0700818 * Logs activity going to foreground or background
819 *
820 * Logged from:
821 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
822 */
823message ActivityForegroundStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800824 optional int32 uid = 1;
825 optional string pkg_name = 2;
826 optional string class_name = 3;
827
Chenjie Yu3d4f6042017-10-27 15:39:34 -0700828 enum Activity {
829 MOVE_TO_BACKGROUND = 0;
830 MOVE_TO_FOREGROUND = 1;
831 }
Chenjie Yu3d4f6042017-10-27 15:39:34 -0700832 optional Activity activity = 4;
833}
David Chenc8a43242017-10-17 16:23:28 -0700834
835/**
David Chen9e3808c2017-11-20 17:25:34 -0800836 * Logs when an error is written to dropbox.
837 * Logged from:
838 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
839 */
840message DropboxErrorChanged {
841 // The uid if available. -1 means not available.
842 optional int32 uid = 1;
843
844 // Tag used when recording this error to dropbox. Contains data_ or system_ prefix.
845 optional string tag = 2;
846
847 // The name of the process.
848 optional string process_name = 3;
849
850 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -0800851 optional sint32 pid = 4;
David Chen9e3808c2017-11-20 17:25:34 -0800852
853 // 1 indicates is instant app. -1 indicates Not applicable.
David Chen6e3e6cb2018-01-03 16:14:06 -0800854 optional sint32 is_instant_app = 5;
David Chen9e3808c2017-11-20 17:25:34 -0800855
856 // The activity name if available.
857 optional string activity_name = 6;
858
David Chen6e3e6cb2018-01-03 16:14:06 -0800859 // The package name if available.
860 optional string package_name = 7;
861
David Chen9e3808c2017-11-20 17:25:34 -0800862 // 1 indicates in foreground. -1 indicates not available.
David Chen6e3e6cb2018-01-03 16:14:06 -0800863 optional sint32 is_foreground = 8;
David Chen9e3808c2017-11-20 17:25:34 -0800864}
865
David Chen0a368b22017-12-06 16:28:16 -0800866/*
867 * Allows other apps to push events into statsd.
868 * Logged from:
869 * frameworks/base/core/java/android/util/StatsLog.java
870 */
David Chen0b5c90c2018-01-25 16:51:49 -0800871message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -0800872 // The uid of the application that sent this custom atom.
873 optional int32 uid = 1;
874
875 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
876 optional int32 label = 2;
877
878 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
879 // predicates for the metrics).
880 enum State {
881 UNKNOWN = 0;
882 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
883 STOP = 2;
884 START = 3;
885 }
886 optional State state = 3;
887}
888
David Chen9e3808c2017-11-20 17:25:34 -0800889/**
Bookatz8fcd09a2017-12-18 13:01:10 -0800890 * Logs when statsd detects an anomaly.
891 *
892 * Logged from:
893 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
894 */
895message AnomalyDetected {
896 // Uid that owns the config whose anomaly detection alert fired.
897 optional int32 config_uid = 1;
898
Yangster-mac94e197c2018-01-02 16:03:03 -0800899 // Id of the config whose anomaly detection alert fired.
900 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -0800901
Yangster-mac94e197c2018-01-02 16:03:03 -0800902 // Id of the alert (i.e. name of the anomaly that was detected).
903 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -0800904}
905
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000906message AppStartChanged {
907 // The uid if available. -1 means not available.
908 optional int32 uid = 1;
909
910 // The app package name.
911 optional string pkg_name = 2;
912
913 enum TransitionType {
914 APP_START_TRANSITION_TYPE_UNKNOWN = 0;
915 WARM = 1;
916 HOT = 2;
917 COLD = 3;
918 }
919 // The transition type.
920 optional TransitionType type = 3;
921
922 // The activity name.
923 optional string activity_name = 4;
924
925 // The name of the calling app. Empty if not set.
926 optional string calling_pkg_name = 5;
927
928 // Whether the app is an instant app.
929 optional bool is_instant_app = 6;
930
931 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -0800932 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000933
Bookatz80d11a02018-01-16 10:46:35 -0800934 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000935
David Chen0b5c90c2018-01-25 16:51:49 -0800936 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000937 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -0800938 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000939 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -0800940 optional int32 bind_application_delay_millis = 11;
941 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000942
943 // Empty if not set.
944 optional string launch_token = 13;
945
946}
947
948message AppStartCancelChanged {
949 // The uid if available. -1 means not available.
950 optional int32 uid = 1;
951
952 // The app package name.
953 optional string pkg_name = 2;
954
955 enum TransitionType {
956 APP_START_TRANSITION_TYPE_UNKNOWN = 0;
957 WARM = 1;
958 HOT = 2;
959 COLD = 3;
960 }
961 // The transition type.
962 optional TransitionType type = 3;
963
964 // The activity name.
965 optional string activity_name = 4;
966}
967
968message AppStartFullyDrawnChanged {
969 // The uid if available. -1 means not available.
970 optional int32 uid = 1;
971
972 // The app package name.
973 optional string pkg_name = 2;
974
975 enum TransitionType {
976 APP_START_TRANSITION_TYPE_UNKNOWN = 0;
977 WITH_BUNDLE = 1;
978 WITHOUT_BUNDLE = 2;
979 }
980 // The transition type.
981 optional TransitionType type = 3;
982
983 // The activity name.
984 optional string activity_name = 4;
985
986 optional bool transition_process_running = 5;
987
988 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -0800989 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000990}
991
Bookatz8fcd09a2017-12-18 13:01:10 -0800992/**
Chenjie Yu52cacc62017-12-08 18:11:45 -0800993 * Logs a picture-in-picture action
994 * Logged from:
995 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
996 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
997 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
998 */
999message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001000 // -1 if it is not available
Chenjie Yu52cacc62017-12-08 18:11:45 -08001001 optional int32 uid = 1;
1002
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001003 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001004
Chenjie Yu52cacc62017-12-08 18:11:45 -08001005 enum State {
1006 ENTERED = 1;
1007 EXPANDED_TO_FULL_SCREEN = 2;
1008 MINIMIZED = 3;
1009 DISMISSED = 4;
1010 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001011 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001012}
1013
1014/**
Chenjie Yue8904192017-12-08 19:12:57 -08001015 * Logs overlay action
1016 * Logged from:
1017 * services/core/java/com/android/server/wm/Session.java
1018 */
1019message OverlayStateChanged {
1020 optional int32 uid = 1;
1021
1022 optional string package_name = 2;
1023
1024 optional bool using_alert_window = 3;
1025
1026 enum State {
1027 ENTERED = 1;
1028 EXITED = 2;
1029 }
1030 optional State state = 4;
1031}
1032
Chenjie Yuccfe6452018-01-30 11:33:21 -08001033/*
1034 * Logs foreground service starts and stops.
1035 * Note that this is not when a service starts or stops, but when it is
1036 * considered foreground.
1037 * Logged from
1038 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1039 */
1040message ForegroundServiceStateChanged {
1041 optional int32 uid = 1;
1042 // package_name + "/" + class_name
1043 optional string short_name = 2;
1044
1045 enum State {
1046 ENTER = 1;
1047 EXIT = 2;
1048 }
1049 optional State state = 3;
1050}
1051
Chenjie Yue8904192017-12-08 19:12:57 -08001052/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001053 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1054 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1055 * attributed back to the parent (host) uid. One example is Chrome.
1056 *
1057 * Logged from:
1058 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1059 */
1060message IsolatedUidChanged {
1061 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
1062 optional int32 parent_uid = 1;
1063
1064 optional int32 isolated_uid = 2;
1065
1066 // We expect an isolated uid to be removed before if it's used for another parent uid.
1067 enum Event {
1068 REMOVED = 0;
1069 CREATED = 1;
1070 }
1071 optional Event event = 3;
1072}
1073
1074/*
1075 * Logs the reception of an incoming network packet causing the main system to wake up for
1076 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1077 * and processed by WakeupController.cpp.
1078 */
1079message PacketWakeupOccurred {
1080 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1081 // delivered nowhere.
1082 optional int32 uid = 1;
1083 // The interface name on which the packet was received.
1084 optional string iface = 2;
1085 // The ethertype value of the packet.
1086 optional int32 ethertype = 3;
1087 // String representation of the destination MAC address of the packet.
1088 optional string destination_hardware_address = 4;
1089 // String representation of the source address of the packet if this was an IP packet.
1090 optional string source_ip = 5;
1091 // String representation of the destination address of the packet if this was an IP packet.
1092 optional string destination_ip = 6;
1093 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1094 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1095 // families.
1096 optional int32 ip_next_header = 7;
1097 // The source port if this was a TCP or UDP packet.
1098 optional int32 source_port = 8;
1099 // The destination port if this was a TCP or UDP packet.
1100 optional int32 destination_port = 9;
1101}
1102
1103/*
1104 * Logs the memory stats for an app on startup.
1105 * Logged from:
1106 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1107 */
1108message AppStartMemoryStateCaptured {
1109 // The uid if available. -1 means not available.
1110 optional int32 uid = 1;
1111
1112 // The process name.
1113 optional string process_name = 2;
1114
1115 // The activity name.
1116 optional string activity_name = 3;
1117
1118 // # of page-faults
1119 optional int64 pgfault = 4;
1120
1121 // # of major page-faults
1122 optional int64 pgmajfault = 5;
1123
1124 // RSS
1125 optional int64 rss_in_bytes = 6;
1126
1127 // CACHE
1128 optional int64 cache_in_bytes = 7;
1129
1130 // SWAP
1131 optional int64 swap_in_bytes = 8;
1132}
1133
1134/*
1135 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1136 * for LMK event.
1137 * Logged from:
1138 * system/core/lmkd/lmkd.c
1139 */
1140message LmkStateChanged {
1141 enum State {
1142 UNKNOWN = 0;
1143 START = 1;
1144 STOP = 2;
1145 }
1146 optional State state = 1;
1147}
1148
1149/*
1150 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1151 * Logged from:
1152 * system/core/lmkd/lmkd.c
1153 */
1154message LmkKillOccurred {
1155 // The uid if available. -1 means not available.
1156 optional int32 uid = 1;
1157
1158 // The process name.
1159 optional string process_name = 2;
1160
1161 // oom adj score.
1162 optional int32 oom_score = 3;
1163
1164 // # of page-faults
1165 optional int64 pgfault = 4;
1166
1167 // # of major page-faults
1168 optional int64 pgmajfault = 5;
1169
1170 // RSS
1171 optional int64 rss_in_bytes = 6;
1172
1173 // CACHE
1174 optional int64 cache_in_bytes = 7;
1175
1176 // SWAP
1177 optional int64 swap_in_bytes = 8;
1178}
1179
1180//////////////////////////////////////////////////////////////////////
1181// Pulled atoms below this line //
1182//////////////////////////////////////////////////////////////////////
1183
1184/**
David Chenc8a43242017-10-17 16:23:28 -07001185 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
1186 *
1187 * Pulled from:
1188 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1189 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001190message WifiBytesTransfer {
David Chenc8a43242017-10-17 16:23:28 -07001191 optional int32 uid = 1;
1192
1193 optional int64 rx_bytes = 2;
1194
1195 optional int64 rx_packets = 3;
1196
1197 optional int64 tx_bytes = 4;
1198
1199 optional int64 tx_packets = 5;
1200}
1201
1202/**
1203 * Pulls bytes transferred via wifi (separated by foreground and background usage).
1204 *
1205 * Pulled from:
1206 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1207 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001208message WifiBytesTransferByFgBg {
David Chenc8a43242017-10-17 16:23:28 -07001209 optional int32 uid = 1;
1210
1211 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
1212 optional int32 is_foreground = 2;
1213
1214 optional int64 rx_bytes = 3;
1215
1216 optional int64 rx_packets = 4;
1217
1218 optional int64 tx_bytes = 5;
1219
1220 optional int64 tx_packets = 6;
1221}
1222
1223/**
1224 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
1225 *
1226 * Pulled from:
1227 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1228 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001229message MobileBytesTransfer {
David Chenc8a43242017-10-17 16:23:28 -07001230 optional int32 uid = 1;
1231
1232 optional int64 rx_bytes = 2;
1233
1234 optional int64 rx_packets = 3;
1235
1236 optional int64 tx_bytes = 4;
1237
1238 optional int64 tx_packets = 5;
1239}
1240
1241/**
1242 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
1243 *
1244 * Pulled from:
1245 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1246 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001247message MobileBytesTransferByFgBg {
David Chenc8a43242017-10-17 16:23:28 -07001248 optional int32 uid = 1;
1249
1250 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
1251 optional int32 is_foreground = 2;
1252
1253 optional int64 rx_bytes = 3;
1254
1255 optional int64 rx_packets = 4;
1256
1257 optional int64 tx_bytes = 5;
1258
1259 optional int64 tx_packets = 6;
1260}
1261
1262/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001263 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
1264 *
1265 * Pulled from:
1266 * StatsCompanionService
1267 */
1268message BluetoothBytesTransfer {
1269 optional int32 uid = 1;
1270
1271 optional int64 rx_bytes = 2;
1272
1273 optional int64 tx_bytes = 3;
1274}
1275
1276/**
David Chenc8a43242017-10-17 16:23:28 -07001277 * Pulls the kernel wakelock durations. This atom is adapted from
1278 * android/internal/os/KernelWakelockStats.java
1279 *
1280 * Pulled from:
1281 * StatsCompanionService using KernelWakelockReader.
1282 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001283message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07001284 optional string name = 1;
1285
1286 optional int32 count = 2;
1287
1288 optional int32 version = 3;
1289
1290 optional int64 time = 4;
1291}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001292
Chenjie Yu05013b32017-11-21 10:21:41 -08001293/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001294 * Pulls low power state information. This includes platform and subsystem sleep state information,
1295 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001296 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001297 * hardware/interfaces/power/1.1/types.hal
1298 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001299message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08001300 // Subsystem name
1301 optional string subsystem_name = 1;
1302 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
1303 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
1304 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001305 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08001306 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001307 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08001308 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07001309}
Chenjie Yu7f8def92017-11-03 09:33:15 -07001310
Chenjie Yu05013b32017-11-21 10:21:41 -08001311/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07001312 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08001313 * Pulls the time the cpu spend on the frequency index. Frequency index
1314 * starts from highest to lowest. The value should be monotonically
1315 * increasing since boot. However, if there is a cpu
1316 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07001317 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001318message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07001319 optional uint32 cluster = 1;
1320 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001321 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07001322}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001323
Chenjie Yu05013b32017-11-21 10:21:41 -08001324/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001325 * Pulls Cpu Time Per Uid.
1326 * Note that isolated process uid time should be attributed to host uids.
1327 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001328message CpuTimePerUid {
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001329 optional uint64 uid = 1;
David Chen0b5c90c2018-01-25 16:51:49 -08001330 optional uint64 user_time_millis = 2;
1331 optional uint64 sys_time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001332}
1333
1334/**
1335 * Pulls Cpu Time Per Uid per frequency.
1336 * Note that isolated process uid time should be attributed to host uids.
1337 * For each uid, we order the time by descending frequencies.
1338 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001339message CpuTimePerUidFreq {
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001340 optional uint64 uid = 1;
1341 optional uint64 freq_idx = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001342 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001343}
Hugo Benichi884970e2017-11-14 22:42:46 +09001344
Chenjie Yu05013b32017-11-21 10:21:41 -08001345/**
1346 * Pulls Wifi Controller Activity Energy Info
1347 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001348message WifiActivityEnergyInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001349 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001350 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001351 // stack reported state
1352 // TODO: replace this with proto enum
1353 optional int32 stack_state = 2;
1354 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001355 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001356 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001357 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001358 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001359 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001360 // product of current(mA), voltage(V) and time(ms)
1361 optional uint64 controller_energy_used = 6;
1362}
1363
1364/**
1365 * Pulls Modem Activity Energy Info
1366 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001367message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001368 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001369 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001370 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001371 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08001372 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001373 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001374 /**
1375 * Tx power index
1376 * index 0 = tx_power < 0dBm
1377 * index 1 = 0dBm < tx_power < 5dBm
1378 * index 2 = 5dBm < tx_power < 15dBm
1379 * index 3 = 15dBm < tx_power < 20dBm
1380 * index 4 = tx_power > 20dBm
1381 */
1382 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08001383 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001384 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08001385 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001386 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08001387 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08001388 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08001389 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08001390 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08001391 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08001392 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08001393 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08001394 // product of current(mA), voltage(V) and time(ms)
1395 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08001396}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001397
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001398/**
1399 * Pulls Bluetooth Activity Energy Info
1400 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
1401 */
1402message BluetoothActivityInfo {
1403 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001404 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001405 // bluetooth stack state
1406 optional int32 bluetooth_stack_state = 2;
1407 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001408 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001409 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001410 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001411 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001412 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001413 // product of current(mA), voltage(V) and time(ms)
1414 optional uint64 energy_used = 6;
1415}
1416
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001417/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001418 * Logs the memory stats for a process.
1419 */
1420message ProcessMemoryState {
1421 // The uid if available. -1 means not available.
1422 optional int32 uid = 1;
1423
1424 // The process name.
1425 optional string process_name = 2;
1426
1427 // oom adj score.
1428 optional int32 oom_score = 3;
1429
1430 // # of page-faults
1431 optional int64 pgfault = 4;
1432
1433 // # of major page-faults
1434 optional int64 pgmajfault = 5;
1435
Rajeev Kumar90235992018-01-29 11:06:48 -08001436 // RSS
1437 optional int64 rss_in_bytes = 6;
1438
1439 // CACHE
1440 optional int64 cache_in_bytes = 7;
1441
1442 // SWAP
1443 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001444}
1445
1446/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001447 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001448 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001449message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08001450 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001451}
1452
1453/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001454 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001455 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001456message SystemUptime {
1457 // Milliseconds since the system was booted.
1458 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
1459 // for external input).
1460 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08001461 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001462}
1463
1464/*
1465 * Reads from /proc/uid_concurrent_active_time which has the format:
1466 * active: X (X is # cores)
1467 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
1468 * [uid1]: [time-0] [time-1] [time-2] ... ...
1469 * ...
1470 * Time-N means the CPU time a UID spent running concurrently with N other processes.
1471 * The file contains a monotonically increasing count of time for a single boot.
1472 */
1473message CpuActiveTime {
1474 optional uint64 uid = 1;
David Chenb639d142018-02-14 17:29:54 -08001475 optional uint32 cluster_number = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001476 optional uint64 idx = 3;
1477 optional uint64 time_millis = 4;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001478}
1479
1480/**
1481 * Reads from /proc/uid_concurrent_policy_time which has the format:
1482 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
1483 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1484 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1485 * ...
1486 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
1487 * The file contains a monotonically increasing count of time for a single boot.
1488 */
1489message CpuClusterTime {
1490 optional uint64 uid = 1;
1491 optional uint64 idx = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001492 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08001493}
1494
1495/*
1496 * Pulls free disk space, for data, system partition and temporary directory.
1497 */
1498message DiskSpace {
1499 // available bytes in data partition
1500 optional uint64 data_available_bytes = 1;
1501 // available bytes in system partition
1502 optional uint64 system_available_bytes = 2;
1503 // available bytes in download cache or temp directories
1504 optional uint64 temp_available_bytes = 3;
1505}
Tej Singhbf972d92018-01-10 20:51:13 -08001506
1507/**
1508 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
1509 * Logged from: frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
1510 */
1511message RemainingBatteryCapacity {
1512 optional int32 charge_uAh = 1;
1513}
1514
1515/**
1516 * Pulls battery capacity, which is the battery capacity when full in uAh.
1517 * Logged from: frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
1518 */
1519message FullBatteryCapacity {
1520 optional int32 capacity_uAh = 1;
Yao Chen9c1debe2018-02-19 14:39:19 -08001521}