blob: 7159b9b24a6ae7c7e7ff71b4f4e62ae68944188d [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;
Tej Singh40298312018-02-16 00:15:09 -080075 // TODO: 33 is blank, but is available for use.
Bookatz8c6571b2017-10-24 15:04:41 -070076 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 Singh40298312018-02-16 00:15:09 -0800108 // Next: 10022
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;
Tej Singh40298312018-02-16 00:15:09 -0800131 Temperature temperature = 10021;
David Chenc8a43242017-10-17 16:23:28 -0700132 }
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700133}
134
Yao Chend54f9dd2017-10-17 17:37:48 +0000135/**
Yangster-mac20877162017-12-22 17:19:39 -0800136 * This proto represents a node of an attribution chain.
137 * Note: All attribution chains are represented as a repeated field of type
138 * AttributionNode. It is understood that in such arrays, the order is that
139 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000140 */
Yangster-mac20877162017-12-22 17:19:39 -0800141message AttributionNode {
142 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800143 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800144
Yangster-mac20877162017-12-22 17:19:39 -0800145 // The (optional) string tag for an element in the attribution chain. If the
146 // element has no tag, it is encoded as an empty string.
147 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700148}
149
Yao Chend54f9dd2017-10-17 17:37:48 +0000150/*
151 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800152 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000153 *
154 * RULES:
155 * - The field ids for each atom must start at 1, and count upwards by 1.
156 * Skipping field ids is not allowed.
157 * - These form an API, so renaming, renumbering or removing fields is
158 * not allowed between android releases. (This is not currently enforced,
159 * but there will be a tool to enforce this restriction).
160 * - The types must be built-in protocol buffer types, namely, no sub-messages
161 * are allowed (yet). The bytes type is also not allowed.
162 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800163 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000164 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800165 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000166 * - A field that is a uid should be a string field, tagged with the [xxx]
167 * annotation. The generated code on android will be represented by UIDs,
168 * and those UIDs will be translated in xxx to those strings.
169 *
170 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700171 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000172 * - If there is a UID, it goes first. Think in an object-oriented fashion.
173 * *****************************************************************************
174 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700175
Yao Chend54f9dd2017-10-17 17:37:48 +0000176/**
177 * Logs when the screen state changes.
178 *
179 * Logged from:
180 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
181 */
182message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800183 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800184 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700185}
Yao Chend54f9dd2017-10-17 17:37:48 +0000186
187/**
Bookatzc1a050a2017-10-10 15:49:28 -0700188 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000189 *
190 * Logged from:
191 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
192 */
Bookatzc1a050a2017-10-10 15:49:28 -0700193message UidProcessStateChanged {
Yao Chen9c1debe2018-02-19 14:39:19 -0800194 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY];
Yao Chend54f9dd2017-10-17 17:37:48 +0000195
Bookatzdb026a22018-01-10 19:01:56 -0800196 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800197 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000198}
199
200/**
Bookatzc1a050a2017-10-10 15:49:28 -0700201 * Logs that a process started, finished, crashed, or ANRed.
202 *
203 * Logged from:
204 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
205 */
206message ProcessLifeCycleStateChanged {
David Chen0b5c90c2018-01-25 16:51:49 -0800207 // TODO: should be a string tagged w/ uid annotation
208 optional int32 uid = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700209
David Chen0b5c90c2018-01-25 16:51:49 -0800210 // The process name (usually same as the app name).
Bookatzc1a050a2017-10-10 15:49:28 -0700211 optional string name = 2;
212
Bookatzddccf0a2017-11-28 16:48:14 -0800213 // What lifecycle state the process changed to.
214 // This enum is specific to atoms.proto.
215 enum Event {
216 PROCESS_FINISHED = 0;
217 PROCESS_STARTED = 1;
218 PROCESS_CRASHED = 2;
219 PROCESS_ANRED = 3;
220 }
221 optional Event event = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700222}
223
Bookatzc1a050a2017-10-10 15:49:28 -0700224/**
225 * Logs when the ble scan state changes.
226 *
227 * Logged from:
228 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
229 */
230message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800231 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700232
233 enum State {
234 OFF = 0;
235 ON = 1;
236 }
237 optional State state = 2;
238}
239
240/**
241 * Logs when an unoptimized ble scan state changes.
242 *
243 * Logged from:
244 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
245 */
246// TODO: Consider changing to tracking per-scanner-id (log from AppScanStats).
247message BleUnoptimizedScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800248 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700249
250 enum State {
251 OFF = 0;
252 ON = 1;
253 }
254 optional State state = 2;
255}
256
257/**
258 * Logs reporting of a ble scan finding results.
259 *
260 * Logged from:
261 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
262 */
263// TODO: Consider changing to tracking per-scanner-id (log from AppScanStats).
264message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800265 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700266
267 // Number of ble scan results returned.
268 optional int32 num_of_results = 2;
269}
270
271/**
272 * Logs when a sensor state changes.
273 *
274 * Logged from:
275 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
276 */
277message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800278 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700279
280 // TODO: Is there a way to get the actual name of the sensor?
281 // The id (int) of the sensor.
282 optional int32 sensor_id = 2;
283
284 enum State {
285 OFF = 0;
286 ON = 1;
287 }
288 optional State state = 3;
289}
290
291
292/**
293 * Logs when GPS state changes.
294 *
295 * Logged from:
296 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
297 */
298message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800299 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700300
301 enum State {
302 OFF = 0;
303 ON = 1;
304 }
305 optional State state = 2;
306}
307
308
309/**
310 * Logs when a sync manager sync state changes.
311 *
312 * Logged from:
313 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
314 */
315message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800316 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700317
David Chen0b5c90c2018-01-25 16:51:49 -0800318 // Name of the sync (as named in the app). Can be chosen at run-time.
Bookatzc1a050a2017-10-10 15:49:28 -0700319 optional string name = 2;
320
321 enum State {
322 OFF = 0;
323 ON = 1;
324 }
325 optional State state = 3;
326}
327
328/**
329 * Logs when a job scheduler job state changes.
330 *
331 * Logged from:
332 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
333 */
334message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800335 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700336
337 // Name of the job (as named in the app)
338 optional string name = 2;
339
340 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800341 FINISHED = 0;
342 STARTED = 1;
343 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700344 }
345 optional State state = 3;
346
347 // TODO: Consider adding the stopReason (int)
348}
349
350/**
351 * Logs when the audio state changes.
352 *
353 * Logged from:
354 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
355 */
356message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800357 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700358
359 enum State {
360 OFF = 0;
361 ON = 1;
362 }
363 optional State state = 2;
364}
365
366/**
367 * Logs when the video codec state changes.
368 *
369 * Logged from:
370 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
371 */
372message MediaCodecActivityChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800373 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700374
375 enum State {
376 OFF = 0;
377 ON = 1;
378 }
379 optional State state = 2;
380}
381
382/**
383 * Logs when the flashlight state changes.
384 *
385 * Logged from:
386 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
387 */
388message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800389 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700390
391 enum State {
392 OFF = 0;
393 ON = 1;
394 }
395 optional State state = 2;
396}
397
398/**
399 * Logs when the camera state changes.
400 *
401 * Logged from:
402 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
403 */
404message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800405 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700406
407 enum State {
408 OFF = 0;
409 ON = 1;
410 }
411 optional State state = 2;
412}
413
414/**
415 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000416 *
417 * Logged from:
418 * TODO
419 */
Bookatzd6746242017-10-24 18:39:35 -0700420message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800421 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000422
Bookatz1a1b0462018-01-12 11:47:03 -0800423 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
424 // From frameworks/base/core/proto/android/os/enums.proto.
425 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700426
427 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
428 optional string tag = 3;
429
430 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800431 RELEASE = 0;
432 ACQUIRE = 1;
433 CHANGE_RELEASE = 2;
434 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700435 }
436 optional State state = 4;
437}
438
439/**
Bookatzc1a050a2017-10-10 15:49:28 -0700440 * Logs when a partial wakelock is considered 'long' (over 1 min).
441 *
442 * Logged from:
443 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
444 */
445message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800446 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700447
Yao Chend54f9dd2017-10-17 17:37:48 +0000448 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
449 optional string tag = 2;
450
Bookatzc1a050a2017-10-10 15:49:28 -0700451 // TODO: I have no idea what this is.
452 optional string history_tag = 3;
453
454 enum State {
455 OFF = 0;
456 ON = 1;
457 }
458 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000459}
460
Bookatzc1a050a2017-10-10 15:49:28 -0700461/**
462 * Logs Battery Saver state change.
463 *
464 * Logged from:
465 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
466 */
467message BatterySaverModeStateChanged {
468 enum State {
469 OFF = 0;
470 ON = 1;
471 }
472 optional State state = 1;
473}
474
475/**
476 * Logs Doze mode state change.
477 *
478 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800479 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700480 */
481message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800482 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800483}
484
485
486/**
487 * Logs state change of Doze mode including maintenance windows.
488 *
489 * Logged from:
490 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
491 */
492message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800493 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700494}
495
496/**
497 * Logs screen brightness level.
498 *
499 * Logged from:
500 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
501 */
502message ScreenBrightnessChanged {
503 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
504 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700505}
506
507/**
508 * Logs battery level (percent full, from 0 to 100).
509 *
510 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700511 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700512 */
513message BatteryLevelChanged {
514 // Battery level. Should be in [0, 100].
515 optional int32 battery_level = 1;
516}
517
518/**
519 * Logs change in charging status of the device.
520 *
521 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700522 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700523 */
524message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800525 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
526 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700527}
528
529/**
530 * Logs whether the device is plugged in, and what power source it is using.
531 *
532 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700533 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700534 */
535message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800536 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
537 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700538}
539
Bookatz8c6571b2017-10-24 15:04:41 -0700540// TODO: Define this more precisely.
541// TODO: Log the ON state somewhere. It isn't currently logged anywhere.
542/**
543 * Logs when the device turns off or on.
544 *
545 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700546 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700547 */
548message DeviceOnStatusChanged {
549 enum State {
550 OFF = 0;
551 ON = 1;
552 }
553 optional State state = 1;
554}
555
556/**
557 * Logs when an app's wakeup alarm fires.
558 *
559 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700560 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700561 */
562message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800563 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800564
565 // Name of the wakeup alarm.
566 optional string tag = 2;
567}
568
569/**
570 * Logs when an an app causes the mobile radio to change state.
571 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
572 *
573 * Logged from:
574 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
575 */
576message MobileRadioPowerStateChanged {
577 // TODO: Add attribution instead of uid?
578 optional int32 uid = 1;
579
Bookatz1a1b0462018-01-12 11:47:03 -0800580 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
581 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800582}
583
584/**
585 * Logs when an an app causes the wifi radio to change state.
586 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
587 *
588 * Logged from:
589 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
590 */
591message WifiRadioPowerStateChanged {
592 // TODO: Add attribution instead of uid?
593 optional int32 uid = 1;
594
Bookatz1a1b0462018-01-12 11:47:03 -0800595 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
596 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700597}
598
599/**
600 * Logs kernel wakeup reasons and aborts.
601 *
602 * Logged from:
603 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
604 */
605message KernelWakeupReported {
606 // Name of the kernel wakeup reason (or abort).
607 optional string wakeup_reason_name = 1;
608
609 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800610 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700611}
612
613/**
614 * Logs wifi locks held by an app.
615 *
616 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700617 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700618 */
619message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800620 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700621
622 enum State {
623 OFF = 0;
624 ON = 1;
625 }
626 optional State state = 2;
627}
628
629/**
630 * Logs wifi signal strength changes.
631 *
632 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700633 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700634 */
635message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800636 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
637 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700638}
639
640/**
641 * Logs wifi scans performed by an app.
642 *
643 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700644 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700645 */
646message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800647 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700648
649 enum State {
650 OFF = 0;
651 ON = 1;
652 }
653 optional State state = 2;
654}
655
656/**
Tej Singh4503e102018-01-04 14:35:01 -0800657 * Logs wifi multicast locks held by an app
658 *
659 * Logged from:
660 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
661 */
662message WifiMulticastLockStateChanged {
663 repeated AttributionNode attribution_node = 1;
664
665 enum State {
666 OFF = 0;
667 ON = 1;
668 }
669 optional State state = 2;
670}
671
672/**
Tej Singh1ea42892018-01-19 09:27:00 -0800673 * Logs shutdown reason and duration on next boot.
674 *
675 * Logged from:
676 * frameworks/base/core/java/com/android/server/BootReceiver.java
677 */
678message ShutdownSequenceReported {
679 // True if shutdown is for a reboot. Default: false if we do not know.
680 optional bool reboot = 1;
681
682 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
683 optional string reason = 2;
684
685 // Beginning of shutdown time in ms using wall clock time since unix epoch.
686 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800687 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800688
689 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800690 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800691}
692
Tej Singh6483ea42018-01-25 17:45:49 -0800693
694/**
695 * Logs boot reason and duration.
696 *
697 * Logged from:
698 * system/core/bootstat/bootstat.cpp
699 */
700message BootSequenceReported {
701 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
702 // Default: "<EMPTY>" if not available.
703 optional string bootloader_reason = 1;
704
705 // Reason for system boot. Eg. bootloader, reboot,userrequested
706 // Default: "<EMPTY>" if not available.
707 optional string system_reason = 2;
708
709 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800710 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800711
712 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800713 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800714
715 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800716 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800717
718 // Time since last boot in ms. Default: 0 if not available.
719 optional int64 time_since_last_boot = 6;
720}
721
Tej Singhc477d9c2018-02-05 18:31:39 -0800722
723/**
724 * Logs call state and disconnect cause (if applicable).
725 *
726 * Logged from:
727 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
728 */
729message CallStateChanged {
730 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
731 // From frameworks/base/core/proto/android/telecomm/enums.proto.
732 optional android.telecom.CallStateEnum call_state = 1;
733
734 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
735 // This value is only applicable when the call_state is DISCONNECTED, and
736 // should always be UNKNOWN if the call_state is not DISCONNECTED.
737 // From frameworks/base/core/proto/android/telecomm/enums.proto.
738 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
739
740 // True if the call is self-managed, which are apps that use the
741 // telecom infrastructure to make their own calls.
742 optional bool self_managed = 3;
743
744 // True if call is external. External calls are calls on connected Wear
745 // devices but show up in Telecom so the user can pull them onto the device.
746 optional bool external_call = 4;
747}
748
Tej Singh1ea42892018-01-19 09:27:00 -0800749/**
Tej Singhbb8554a2018-01-26 11:59:14 -0800750 * Logs the duration of a davey (jank of >=700ms) when it occurs
751 *
752 * Logged from:
753 * frameworks/base/libs/hwui/JankTracker.cpp
754 */
755message DaveyOccurred {
756 // Amount of time it took to render the frame. Should be >=700ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800757 optional int64 jank_duration_millis = 1;
Tej Singhbb8554a2018-01-26 11:59:14 -0800758}
759
760/**
Bookatze5885242017-10-24 20:10:31 -0700761 * Logs phone signal strength changes.
762 *
763 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700764 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700765 */
766message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800767 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
768 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -0700769}
770
771/**
772 * Logs that a setting was updated.
773 * Logged from:
774 * frameworks/base/core/java/android/provider/Settings.java
775 * The tag and is_default allow resetting of settings to default values based on the specified
776 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
777 */
778message SettingChanged {
779 // The name of the setting.
780 optional string setting = 1;
781
782 // The change being imposed on this setting. May represent a number, eg "3".
783 optional string value = 2;
784
785 // The new value of this setting. For most settings, this is same as value. For some settings,
786 // value is +X or -X where X represents an element in a set. For example, if the previous value
787 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
788 // The +/- feature is currently only used for location_providers_allowed.
789 optional string new_value = 3;
790
791 // The previous value of this setting.
792 optional string prev_value = 4;
793
794 // The tag used with the is_default for resetting sets of settings. This is generally null.
795 optional string tag = 5;
796
Bookatz90867622018-01-31 15:05:57 -0800797 // True if this setting with tag should be resettable.
798 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -0700799
800 // The user ID associated. Defined in android/os/UserHandle.java
801 optional int32 user = 7;
802}
Chenjie Yub3dda412017-10-24 13:41:59 -0700803
Chenjie Yu05013b32017-11-21 10:21:41 -0800804/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -0700805 * Logs activity going to foreground or background
806 *
807 * Logged from:
808 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
809 */
810message ActivityForegroundStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800811 optional int32 uid = 1;
812 optional string pkg_name = 2;
813 optional string class_name = 3;
814
Chenjie Yu3d4f6042017-10-27 15:39:34 -0700815 enum Activity {
816 MOVE_TO_BACKGROUND = 0;
817 MOVE_TO_FOREGROUND = 1;
818 }
Chenjie Yu3d4f6042017-10-27 15:39:34 -0700819 optional Activity activity = 4;
820}
David Chenc8a43242017-10-17 16:23:28 -0700821
822/**
David Chen9e3808c2017-11-20 17:25:34 -0800823 * Logs when an error is written to dropbox.
824 * Logged from:
825 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
826 */
827message DropboxErrorChanged {
828 // The uid if available. -1 means not available.
829 optional int32 uid = 1;
830
831 // Tag used when recording this error to dropbox. Contains data_ or system_ prefix.
832 optional string tag = 2;
833
834 // The name of the process.
835 optional string process_name = 3;
836
837 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -0800838 optional sint32 pid = 4;
David Chen9e3808c2017-11-20 17:25:34 -0800839
840 // 1 indicates is instant app. -1 indicates Not applicable.
David Chen6e3e6cb2018-01-03 16:14:06 -0800841 optional sint32 is_instant_app = 5;
David Chen9e3808c2017-11-20 17:25:34 -0800842
843 // The activity name if available.
844 optional string activity_name = 6;
845
David Chen6e3e6cb2018-01-03 16:14:06 -0800846 // The package name if available.
847 optional string package_name = 7;
848
David Chen9e3808c2017-11-20 17:25:34 -0800849 // 1 indicates in foreground. -1 indicates not available.
David Chen6e3e6cb2018-01-03 16:14:06 -0800850 optional sint32 is_foreground = 8;
David Chen9e3808c2017-11-20 17:25:34 -0800851}
852
David Chen0a368b22017-12-06 16:28:16 -0800853/*
854 * Allows other apps to push events into statsd.
855 * Logged from:
856 * frameworks/base/core/java/android/util/StatsLog.java
857 */
David Chen0b5c90c2018-01-25 16:51:49 -0800858message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -0800859 // The uid of the application that sent this custom atom.
860 optional int32 uid = 1;
861
862 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
863 optional int32 label = 2;
864
865 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
866 // predicates for the metrics).
867 enum State {
868 UNKNOWN = 0;
869 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
870 STOP = 2;
871 START = 3;
872 }
873 optional State state = 3;
874}
875
David Chen9e3808c2017-11-20 17:25:34 -0800876/**
Bookatz8fcd09a2017-12-18 13:01:10 -0800877 * Logs when statsd detects an anomaly.
878 *
879 * Logged from:
880 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
881 */
882message AnomalyDetected {
883 // Uid that owns the config whose anomaly detection alert fired.
884 optional int32 config_uid = 1;
885
Yangster-mac94e197c2018-01-02 16:03:03 -0800886 // Id of the config whose anomaly detection alert fired.
887 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -0800888
Yangster-mac94e197c2018-01-02 16:03:03 -0800889 // Id of the alert (i.e. name of the anomaly that was detected).
890 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -0800891}
892
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000893message AppStartChanged {
894 // The uid if available. -1 means not available.
895 optional int32 uid = 1;
896
897 // The app package name.
898 optional string pkg_name = 2;
899
900 enum TransitionType {
901 APP_START_TRANSITION_TYPE_UNKNOWN = 0;
902 WARM = 1;
903 HOT = 2;
904 COLD = 3;
905 }
906 // The transition type.
907 optional TransitionType type = 3;
908
909 // The activity name.
910 optional string activity_name = 4;
911
912 // The name of the calling app. Empty if not set.
913 optional string calling_pkg_name = 5;
914
915 // Whether the app is an instant app.
916 optional bool is_instant_app = 6;
917
918 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -0800919 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000920
Bookatz80d11a02018-01-16 10:46:35 -0800921 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000922
David Chen0b5c90c2018-01-25 16:51:49 -0800923 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000924 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -0800925 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000926 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -0800927 optional int32 bind_application_delay_millis = 11;
928 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000929
930 // Empty if not set.
931 optional string launch_token = 13;
932
Calin Juravle759fbda2018-02-20 19:52:30 +0000933 // The compiler filter used when when the package was optimized.
934 optional string package_optimization_compilation_filter = 14;
935
936 // The reason why the package was optimized.
937 optional string package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000938}
939
940message AppStartCancelChanged {
941 // The uid if available. -1 means not available.
942 optional int32 uid = 1;
943
944 // The app package name.
945 optional string pkg_name = 2;
946
947 enum TransitionType {
948 APP_START_TRANSITION_TYPE_UNKNOWN = 0;
949 WARM = 1;
950 HOT = 2;
951 COLD = 3;
952 }
953 // The transition type.
954 optional TransitionType type = 3;
955
956 // The activity name.
957 optional string activity_name = 4;
958}
959
960message AppStartFullyDrawnChanged {
961 // The uid if available. -1 means not available.
962 optional int32 uid = 1;
963
964 // The app package name.
965 optional string pkg_name = 2;
966
967 enum TransitionType {
968 APP_START_TRANSITION_TYPE_UNKNOWN = 0;
969 WITH_BUNDLE = 1;
970 WITHOUT_BUNDLE = 2;
971 }
972 // The transition type.
973 optional TransitionType type = 3;
974
975 // The activity name.
976 optional string activity_name = 4;
977
978 optional bool transition_process_running = 5;
979
980 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -0800981 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +0000982}
983
Bookatz8fcd09a2017-12-18 13:01:10 -0800984/**
Chenjie Yu52cacc62017-12-08 18:11:45 -0800985 * Logs a picture-in-picture action
986 * Logged from:
987 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
988 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
989 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
990 */
991message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -0800992 // -1 if it is not available
Chenjie Yu52cacc62017-12-08 18:11:45 -0800993 optional int32 uid = 1;
994
Chenjie Yuae9fdf042018-02-15 10:19:32 -0800995 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800996
Chenjie Yu52cacc62017-12-08 18:11:45 -0800997 enum State {
998 ENTERED = 1;
999 EXPANDED_TO_FULL_SCREEN = 2;
1000 MINIMIZED = 3;
1001 DISMISSED = 4;
1002 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001003 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001004}
1005
1006/**
Chenjie Yue8904192017-12-08 19:12:57 -08001007 * Logs overlay action
1008 * Logged from:
1009 * services/core/java/com/android/server/wm/Session.java
1010 */
1011message OverlayStateChanged {
1012 optional int32 uid = 1;
1013
1014 optional string package_name = 2;
1015
1016 optional bool using_alert_window = 3;
1017
1018 enum State {
1019 ENTERED = 1;
1020 EXITED = 2;
1021 }
1022 optional State state = 4;
1023}
1024
Chenjie Yuccfe6452018-01-30 11:33:21 -08001025/*
1026 * Logs foreground service starts and stops.
1027 * Note that this is not when a service starts or stops, but when it is
1028 * considered foreground.
1029 * Logged from
1030 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1031 */
1032message ForegroundServiceStateChanged {
1033 optional int32 uid = 1;
1034 // package_name + "/" + class_name
1035 optional string short_name = 2;
1036
1037 enum State {
1038 ENTER = 1;
1039 EXIT = 2;
1040 }
1041 optional State state = 3;
1042}
1043
Chenjie Yue8904192017-12-08 19:12:57 -08001044/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001045 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1046 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1047 * attributed back to the parent (host) uid. One example is Chrome.
1048 *
1049 * Logged from:
1050 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1051 */
1052message IsolatedUidChanged {
1053 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
1054 optional int32 parent_uid = 1;
1055
1056 optional int32 isolated_uid = 2;
1057
1058 // We expect an isolated uid to be removed before if it's used for another parent uid.
1059 enum Event {
1060 REMOVED = 0;
1061 CREATED = 1;
1062 }
1063 optional Event event = 3;
1064}
1065
1066/*
1067 * Logs the reception of an incoming network packet causing the main system to wake up for
1068 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1069 * and processed by WakeupController.cpp.
1070 */
1071message PacketWakeupOccurred {
1072 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1073 // delivered nowhere.
1074 optional int32 uid = 1;
1075 // The interface name on which the packet was received.
1076 optional string iface = 2;
1077 // The ethertype value of the packet.
1078 optional int32 ethertype = 3;
1079 // String representation of the destination MAC address of the packet.
1080 optional string destination_hardware_address = 4;
1081 // String representation of the source address of the packet if this was an IP packet.
1082 optional string source_ip = 5;
1083 // String representation of the destination address of the packet if this was an IP packet.
1084 optional string destination_ip = 6;
1085 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1086 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1087 // families.
1088 optional int32 ip_next_header = 7;
1089 // The source port if this was a TCP or UDP packet.
1090 optional int32 source_port = 8;
1091 // The destination port if this was a TCP or UDP packet.
1092 optional int32 destination_port = 9;
1093}
1094
1095/*
1096 * Logs the memory stats for an app on startup.
1097 * Logged from:
1098 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1099 */
1100message AppStartMemoryStateCaptured {
1101 // The uid if available. -1 means not available.
1102 optional int32 uid = 1;
1103
1104 // The process name.
1105 optional string process_name = 2;
1106
1107 // The activity name.
1108 optional string activity_name = 3;
1109
1110 // # of page-faults
1111 optional int64 pgfault = 4;
1112
1113 // # of major page-faults
1114 optional int64 pgmajfault = 5;
1115
1116 // RSS
1117 optional int64 rss_in_bytes = 6;
1118
1119 // CACHE
1120 optional int64 cache_in_bytes = 7;
1121
1122 // SWAP
1123 optional int64 swap_in_bytes = 8;
1124}
1125
1126/*
1127 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1128 * for LMK event.
1129 * Logged from:
1130 * system/core/lmkd/lmkd.c
1131 */
1132message LmkStateChanged {
1133 enum State {
1134 UNKNOWN = 0;
1135 START = 1;
1136 STOP = 2;
1137 }
1138 optional State state = 1;
1139}
1140
1141/*
1142 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1143 * Logged from:
1144 * system/core/lmkd/lmkd.c
1145 */
1146message LmkKillOccurred {
1147 // The uid if available. -1 means not available.
1148 optional int32 uid = 1;
1149
1150 // The process name.
1151 optional string process_name = 2;
1152
1153 // oom adj score.
1154 optional int32 oom_score = 3;
1155
1156 // # of page-faults
1157 optional int64 pgfault = 4;
1158
1159 // # of major page-faults
1160 optional int64 pgmajfault = 5;
1161
1162 // RSS
1163 optional int64 rss_in_bytes = 6;
1164
1165 // CACHE
1166 optional int64 cache_in_bytes = 7;
1167
1168 // SWAP
1169 optional int64 swap_in_bytes = 8;
1170}
1171
1172//////////////////////////////////////////////////////////////////////
1173// Pulled atoms below this line //
1174//////////////////////////////////////////////////////////////////////
1175
1176/**
David Chenc8a43242017-10-17 16:23:28 -07001177 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
1178 *
1179 * Pulled from:
1180 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1181 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001182message WifiBytesTransfer {
David Chenc8a43242017-10-17 16:23:28 -07001183 optional int32 uid = 1;
1184
1185 optional int64 rx_bytes = 2;
1186
1187 optional int64 rx_packets = 3;
1188
1189 optional int64 tx_bytes = 4;
1190
1191 optional int64 tx_packets = 5;
1192}
1193
1194/**
1195 * Pulls bytes transferred via wifi (separated by foreground and background usage).
1196 *
1197 * Pulled from:
1198 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1199 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001200message WifiBytesTransferByFgBg {
David Chenc8a43242017-10-17 16:23:28 -07001201 optional int32 uid = 1;
1202
1203 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
1204 optional int32 is_foreground = 2;
1205
1206 optional int64 rx_bytes = 3;
1207
1208 optional int64 rx_packets = 4;
1209
1210 optional int64 tx_bytes = 5;
1211
1212 optional int64 tx_packets = 6;
1213}
1214
1215/**
1216 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
1217 *
1218 * Pulled from:
1219 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1220 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001221message MobileBytesTransfer {
David Chenc8a43242017-10-17 16:23:28 -07001222 optional int32 uid = 1;
1223
1224 optional int64 rx_bytes = 2;
1225
1226 optional int64 rx_packets = 3;
1227
1228 optional int64 tx_bytes = 4;
1229
1230 optional int64 tx_packets = 5;
1231}
1232
1233/**
1234 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
1235 *
1236 * Pulled from:
1237 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1238 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001239message MobileBytesTransferByFgBg {
David Chenc8a43242017-10-17 16:23:28 -07001240 optional int32 uid = 1;
1241
1242 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
1243 optional int32 is_foreground = 2;
1244
1245 optional int64 rx_bytes = 3;
1246
1247 optional int64 rx_packets = 4;
1248
1249 optional int64 tx_bytes = 5;
1250
1251 optional int64 tx_packets = 6;
1252}
1253
1254/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001255 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
1256 *
1257 * Pulled from:
1258 * StatsCompanionService
1259 */
1260message BluetoothBytesTransfer {
1261 optional int32 uid = 1;
1262
1263 optional int64 rx_bytes = 2;
1264
1265 optional int64 tx_bytes = 3;
1266}
1267
1268/**
David Chenc8a43242017-10-17 16:23:28 -07001269 * Pulls the kernel wakelock durations. This atom is adapted from
1270 * android/internal/os/KernelWakelockStats.java
1271 *
1272 * Pulled from:
1273 * StatsCompanionService using KernelWakelockReader.
1274 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001275message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07001276 optional string name = 1;
1277
1278 optional int32 count = 2;
1279
1280 optional int32 version = 3;
1281
1282 optional int64 time = 4;
1283}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001284
Chenjie Yu05013b32017-11-21 10:21:41 -08001285/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001286 * Pulls low power state information. This includes platform and subsystem sleep state information,
1287 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001288 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001289 * hardware/interfaces/power/1.1/types.hal
1290 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001291message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08001292 // Subsystem name
1293 optional string subsystem_name = 1;
1294 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
1295 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
1296 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001297 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08001298 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001299 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08001300 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07001301}
Chenjie Yu7f8def92017-11-03 09:33:15 -07001302
Chenjie Yu05013b32017-11-21 10:21:41 -08001303/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07001304 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08001305 * Pulls the time the cpu spend on the frequency index. Frequency index
1306 * starts from highest to lowest. The value should be monotonically
1307 * increasing since boot. However, if there is a cpu
1308 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07001309 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001310message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07001311 optional uint32 cluster = 1;
1312 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001313 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07001314}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001315
Chenjie Yu05013b32017-11-21 10:21:41 -08001316/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001317 * Pulls Cpu Time Per Uid.
1318 * Note that isolated process uid time should be attributed to host uids.
1319 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001320message CpuTimePerUid {
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001321 optional uint64 uid = 1;
David Chen0b5c90c2018-01-25 16:51:49 -08001322 optional uint64 user_time_millis = 2;
1323 optional uint64 sys_time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001324}
1325
1326/**
1327 * Pulls Cpu Time Per Uid per frequency.
1328 * Note that isolated process uid time should be attributed to host uids.
1329 * For each uid, we order the time by descending frequencies.
1330 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001331message CpuTimePerUidFreq {
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001332 optional uint64 uid = 1;
1333 optional uint64 freq_idx = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001334 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001335}
Hugo Benichi884970e2017-11-14 22:42:46 +09001336
Chenjie Yu05013b32017-11-21 10:21:41 -08001337/**
1338 * Pulls Wifi Controller Activity Energy Info
1339 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001340message WifiActivityEnergyInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001341 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001342 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001343 // stack reported state
1344 // TODO: replace this with proto enum
1345 optional int32 stack_state = 2;
1346 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001347 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001348 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001349 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001350 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001351 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001352 // product of current(mA), voltage(V) and time(ms)
1353 optional uint64 controller_energy_used = 6;
1354}
1355
1356/**
1357 * Pulls Modem Activity Energy Info
1358 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001359message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001360 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001361 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001362 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001363 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08001364 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001365 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001366 /**
1367 * Tx power index
1368 * index 0 = tx_power < 0dBm
1369 * index 1 = 0dBm < tx_power < 5dBm
1370 * index 2 = 5dBm < tx_power < 15dBm
1371 * index 3 = 15dBm < tx_power < 20dBm
1372 * index 4 = tx_power > 20dBm
1373 */
1374 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08001375 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001376 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08001377 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001378 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08001379 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08001380 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08001381 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08001382 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08001383 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08001384 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08001385 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08001386 // product of current(mA), voltage(V) and time(ms)
1387 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08001388}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001389
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001390/**
1391 * Pulls Bluetooth Activity Energy Info
1392 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
1393 */
1394message BluetoothActivityInfo {
1395 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001396 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001397 // bluetooth stack state
1398 optional int32 bluetooth_stack_state = 2;
1399 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001400 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001401 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001402 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001403 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001404 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001405 // product of current(mA), voltage(V) and time(ms)
1406 optional uint64 energy_used = 6;
1407}
1408
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001409/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001410 * Logs the memory stats for a process.
1411 */
1412message ProcessMemoryState {
1413 // The uid if available. -1 means not available.
1414 optional int32 uid = 1;
1415
1416 // The process name.
1417 optional string process_name = 2;
1418
1419 // oom adj score.
1420 optional int32 oom_score = 3;
1421
1422 // # of page-faults
1423 optional int64 pgfault = 4;
1424
1425 // # of major page-faults
1426 optional int64 pgmajfault = 5;
1427
Rajeev Kumar90235992018-01-29 11:06:48 -08001428 // RSS
1429 optional int64 rss_in_bytes = 6;
1430
1431 // CACHE
1432 optional int64 cache_in_bytes = 7;
1433
1434 // SWAP
1435 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001436}
1437
1438/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001439 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001440 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001441message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08001442 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001443}
1444
1445/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001446 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001447 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001448message SystemUptime {
1449 // Milliseconds since the system was booted.
1450 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
1451 // for external input).
1452 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08001453 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001454}
1455
1456/*
1457 * Reads from /proc/uid_concurrent_active_time which has the format:
1458 * active: X (X is # cores)
1459 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
1460 * [uid1]: [time-0] [time-1] [time-2] ... ...
1461 * ...
1462 * Time-N means the CPU time a UID spent running concurrently with N other processes.
1463 * The file contains a monotonically increasing count of time for a single boot.
1464 */
1465message CpuActiveTime {
1466 optional uint64 uid = 1;
David Chenb639d142018-02-14 17:29:54 -08001467 optional uint32 cluster_number = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001468 optional uint64 idx = 3;
1469 optional uint64 time_millis = 4;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001470}
1471
1472/**
1473 * Reads from /proc/uid_concurrent_policy_time which has the format:
1474 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
1475 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1476 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1477 * ...
1478 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
1479 * The file contains a monotonically increasing count of time for a single boot.
1480 */
1481message CpuClusterTime {
1482 optional uint64 uid = 1;
1483 optional uint64 idx = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001484 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08001485}
1486
1487/*
1488 * Pulls free disk space, for data, system partition and temporary directory.
1489 */
1490message DiskSpace {
1491 // available bytes in data partition
1492 optional uint64 data_available_bytes = 1;
1493 // available bytes in system partition
1494 optional uint64 system_available_bytes = 2;
1495 // available bytes in download cache or temp directories
1496 optional uint64 temp_available_bytes = 3;
1497}
Tej Singhbf972d92018-01-10 20:51:13 -08001498
1499/**
1500 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08001501 * Pulled from:
1502 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08001503 */
1504message RemainingBatteryCapacity {
1505 optional int32 charge_uAh = 1;
1506}
1507
1508/**
1509 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08001510 * Pulled from:
1511 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08001512 */
1513message FullBatteryCapacity {
1514 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08001515}
1516
1517/**
1518 * Pulls the temperature of various parts of the device, in Celsius.
1519 *
1520 * Pulled from:
1521 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
1522 */
1523message Temperature {
1524 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
1525 optional android.os.TemperatureTypeEnum sensor_location = 1;
1526
1527 // The name of the temperature source. Eg. CPU0
1528 optional string sensor_name = 2;
1529
1530 // Temperature in degrees C.
1531 optional float temperature_C = 3;
Yao Chen9c1debe2018-02-19 14:39:19 -08001532}