blob: 209564910a78c565108d4ea513d858735d495d92 [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";
Tej Singh33a412b2018-03-16 18:43:59 -070026import "frameworks/base/core/proto/android/app/job/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080027import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080028import "frameworks/base/core/proto/android/os/enums.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080029import "frameworks/base/core/proto/android/server/enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080030import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080031import "frameworks/base/core/proto/android/telephony/enums.proto";
32import "frameworks/base/core/proto/android/view/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080033
Yao Chend54f9dd2017-10-17 17:37:48 +000034/**
Stefan Lafonae2df012017-11-14 09:17:21 -080035 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000036 * raw stats log events from the Android system, also known as "atoms."
37 *
38 * This field contains a single oneof with all of the available messages.
39 * The stats-log-api-gen tool runs as part of the Android build and
40 * generates the android.util.StatsLog class, which contains the constants
41 * and methods that Android uses to log.
42 *
Stefan Lafonae2df012017-11-14 09:17:21 -080043 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000044 * Instead, statsd on Android constructs these messages synthetically,
45 * in the format defined here and in stats_log.proto.
46 */
Stefan Lafonae2df012017-11-14 09:17:21 -080047message Atom {
48 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070049 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070050 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
51 BleScanStateChanged ble_scan_state_changed = 2;
52 BleUnoptimizedScanStateChanged ble_unoptimized_scan_state_changed = 3;
53 BleScanResultReceived ble_scan_result_received = 4;
54 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080055 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070056 SyncStateChanged sync_state_changed = 7;
57 ScheduledJobStateChanged scheduled_job_state_changed = 8;
58 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070059 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080060 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
61 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
62 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
63 // TODO: 14-19 are blank, but need not be
64 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
65 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
66 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070067 AudioStateChanged audio_state_changed = 23;
68 MediaCodecActivityChanged media_codec_activity_changed = 24;
69 CameraStateChanged camera_state_changed = 25;
70 FlashlightStateChanged flashlight_state_changed = 26;
71 UidProcessStateChanged uid_process_state_changed = 27;
72 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
73 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070074 BatteryLevelChanged battery_level_changed = 30;
75 ChargingStateChanged charging_state_changed = 31;
76 PluggedStateChanged plugged_state_changed = 32;
Tej Singh40298312018-02-16 00:15:09 -080077 // TODO: 33 is blank, but is available for use.
Bookatz8c6571b2017-10-24 15:04:41 -070078 DeviceOnStatusChanged device_on_status_changed = 34;
79 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
80 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070081 WifiLockStateChanged wifi_lock_state_changed = 37;
82 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
83 WifiScanStateChanged wifi_scan_state_changed = 39;
84 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070085 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070086 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070087 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090088 PacketWakeupOccurred packet_wakeup_occurred = 44;
David Chen9e3808c2017-11-20 17:25:34 -080089 DropboxErrorChanged dropbox_error_changed = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -080090 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080091 AppBreadcrumbReported app_breadcrumb_reported = 47;
Olivier Gaillardaed7f122017-12-12 14:26:22 +000092 AppStartChanged app_start_changed = 48;
93 AppStartCancelChanged app_start_cancel_changed = 49;
94 AppStartFullyDrawnChanged app_start_fully_drawn_changed = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -080095 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -080096 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -080097 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -080098 LmkStateChanged lmk_state_changed = 54;
99 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800100 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800101 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800102 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800103 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800104 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800105 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800106 KeyguardStateChanged keyguard_state_changed = 62;
107 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
108 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Rajeev Kumar51b54602018-03-01 12:18:26 -0800109 AppDied app_died=65;
Tej Singha883b372018-02-15 11:30:01 -0800110 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800111 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
112 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
113 BluetoothA2dpAudioStateChanged bluetooth_a2dp_audio_state_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700114 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800115 SpeakerImpedanceReported speaker_impedance_reported = 71;
116 HardwareFailed hardware_failed = 72;
117 PhysicalDropDetected physical_drop_detected = 73;
118 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800119 MobileConnectionStateChanged mobile_connection_state_changed = 75;
120 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700121 UsbDeviceAttached usb_device_attached = 77;
Yao Chend54f9dd2017-10-17 17:37:48 +0000122 }
David Chenc8a43242017-10-17 16:23:28 -0700123
David Chen6e3e6cb2018-01-03 16:14:06 -0800124 // Pulled events will start at field 10000.
Tej Singh40298312018-02-16 00:15:09 -0800125 // Next: 10022
David Chenc8a43242017-10-17 16:23:28 -0700126 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800127 WifiBytesTransfer wifi_bytes_transfer = 10000;
128 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
129 MobileBytesTransfer mobile_bytes_transfer = 10002;
130 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800131 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800132 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800133 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800134 CpuTimePerFreq cpu_time_per_freq = 10008;
135 CpuTimePerUid cpu_time_per_uid = 10009;
136 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
137 WifiActivityEnergyInfo wifi_activity_energy_info = 10011;
138 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800139 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800140 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800141 SystemElapsedRealtime system_elapsed_realtime = 10014;
142 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800143 CpuActiveTime cpu_active_time = 10016;
144 CpuClusterTime cpu_cluster_time = 10017;
Chenjie Yu937d7422018-01-10 16:37:53 -0800145 DiskSpace disk_space = 10018;
Tej Singhbf972d92018-01-10 20:51:13 -0800146 RemainingBatteryCapacity remaining_battery_capacity = 10019;
147 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800148 Temperature temperature = 10021;
David Chenc8a43242017-10-17 16:23:28 -0700149 }
yroa1fe77c2018-02-26 14:22:54 -0800150
151 // DO NOT USE field numbers above 100,000 in AOSP. Field numbers above
152 // 100,000 are reserved for non-AOSP (e.g. OEMs) to use.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700153}
154
Yao Chend54f9dd2017-10-17 17:37:48 +0000155/**
Yangster-mac20877162017-12-22 17:19:39 -0800156 * This proto represents a node of an attribution chain.
157 * Note: All attribution chains are represented as a repeated field of type
158 * AttributionNode. It is understood that in such arrays, the order is that
159 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000160 */
Yangster-mac20877162017-12-22 17:19:39 -0800161message AttributionNode {
162 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800163 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800164
Yangster-mac20877162017-12-22 17:19:39 -0800165 // The (optional) string tag for an element in the attribution chain. If the
166 // element has no tag, it is encoded as an empty string.
167 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700168}
169
Yao Chend54f9dd2017-10-17 17:37:48 +0000170/*
171 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800172 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000173 *
174 * RULES:
175 * - The field ids for each atom must start at 1, and count upwards by 1.
176 * Skipping field ids is not allowed.
177 * - These form an API, so renaming, renumbering or removing fields is
178 * not allowed between android releases. (This is not currently enforced,
179 * but there will be a tool to enforce this restriction).
180 * - The types must be built-in protocol buffer types, namely, no sub-messages
181 * are allowed (yet). The bytes type is also not allowed.
182 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800183 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000184 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800185 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000186 * - A field that is a uid should be a string field, tagged with the [xxx]
187 * annotation. The generated code on android will be represented by UIDs,
188 * and those UIDs will be translated in xxx to those strings.
189 *
190 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700191 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000192 * - If there is a UID, it goes first. Think in an object-oriented fashion.
193 * *****************************************************************************
194 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700195
Yao Chend54f9dd2017-10-17 17:37:48 +0000196/**
197 * Logs when the screen state changes.
198 *
199 * Logged from:
200 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
201 */
202message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800203 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800204 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700205}
Yao Chend54f9dd2017-10-17 17:37:48 +0000206
207/**
Bookatzc1a050a2017-10-10 15:49:28 -0700208 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000209 *
210 * Logged from:
211 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
212 */
Bookatzc1a050a2017-10-10 15:49:28 -0700213message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700214 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000215
Bookatzdb026a22018-01-10 19:01:56 -0800216 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800217 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000218}
219
220/**
Bookatzc1a050a2017-10-10 15:49:28 -0700221 * Logs that a process started, finished, crashed, or ANRed.
222 *
223 * Logged from:
224 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
225 */
226message ProcessLifeCycleStateChanged {
David Chen0b5c90c2018-01-25 16:51:49 -0800227 // TODO: should be a string tagged w/ uid annotation
Yao Chenc40a19d2018-03-15 16:48:25 -0700228 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700229
David Chen0b5c90c2018-01-25 16:51:49 -0800230 // The process name (usually same as the app name).
Bookatzc1a050a2017-10-10 15:49:28 -0700231 optional string name = 2;
232
Bookatzddccf0a2017-11-28 16:48:14 -0800233 // What lifecycle state the process changed to.
234 // This enum is specific to atoms.proto.
235 enum Event {
236 PROCESS_FINISHED = 0;
237 PROCESS_STARTED = 1;
238 PROCESS_CRASHED = 2;
239 PROCESS_ANRED = 3;
240 }
241 optional Event event = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700242}
243
Bookatzc1a050a2017-10-10 15:49:28 -0700244/**
245 * Logs when the ble scan state changes.
246 *
247 * Logged from:
248 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
249 */
250message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800251 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700252
253 enum State {
254 OFF = 0;
255 ON = 1;
256 }
257 optional State state = 2;
258}
259
260/**
261 * Logs when an unoptimized ble scan state changes.
262 *
263 * Logged from:
264 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
265 */
266// TODO: Consider changing to tracking per-scanner-id (log from AppScanStats).
267message BleUnoptimizedScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800268 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700269
270 enum State {
271 OFF = 0;
272 ON = 1;
273 }
274 optional State state = 2;
275}
276
277/**
278 * Logs reporting of a ble scan finding results.
279 *
280 * Logged from:
281 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
282 */
283// TODO: Consider changing to tracking per-scanner-id (log from AppScanStats).
284message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800285 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700286
287 // Number of ble scan results returned.
288 optional int32 num_of_results = 2;
289}
290
291/**
292 * Logs when a sensor state changes.
293 *
294 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700295 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700296 */
297message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800298 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700299
300 // TODO: Is there a way to get the actual name of the sensor?
301 // The id (int) of the sensor.
302 optional int32 sensor_id = 2;
303
304 enum State {
305 OFF = 0;
306 ON = 1;
307 }
308 optional State state = 3;
309}
310
311
312/**
313 * Logs when GPS state changes.
314 *
315 * Logged from:
316 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
317 */
318message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800319 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700320
321 enum State {
322 OFF = 0;
323 ON = 1;
324 }
325 optional State state = 2;
326}
327
328
329/**
330 * Logs when a sync manager sync state changes.
331 *
332 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700333 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700334 */
335message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800336 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700337
David Chen0b5c90c2018-01-25 16:51:49 -0800338 // Name of the sync (as named in the app). Can be chosen at run-time.
Bookatzc1a050a2017-10-10 15:49:28 -0700339 optional string name = 2;
340
341 enum State {
342 OFF = 0;
343 ON = 1;
344 }
345 optional State state = 3;
346}
347
348/**
349 * Logs when a job scheduler job state changes.
350 *
351 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700352 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700353 */
354message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800355 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700356
357 // Name of the job (as named in the app)
358 optional string name = 2;
359
360 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800361 FINISHED = 0;
362 STARTED = 1;
363 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700364 }
365 optional State state = 3;
366
Tej Singh33a412b2018-03-16 18:43:59 -0700367 // The reason a job has stopped.
368 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700369 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700370 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700371}
372
373/**
374 * Logs when the audio state changes.
375 *
376 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700377 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700378 */
379message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800380 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700381
382 enum State {
383 OFF = 0;
384 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700385 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
386 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700387 }
388 optional State state = 2;
389}
390
391/**
392 * Logs when the video codec state changes.
393 *
394 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700395 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700396 */
397message MediaCodecActivityChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800398 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700399
400 enum State {
401 OFF = 0;
402 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700403 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
404 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700405 }
406 optional State state = 2;
407}
408
409/**
410 * Logs when the flashlight state changes.
411 *
412 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700413 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700414 */
415message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800416 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700417
418 enum State {
419 OFF = 0;
420 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700421 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
422 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700423 }
424 optional State state = 2;
425}
426
427/**
428 * Logs when the camera state changes.
429 *
430 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700431 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700432 */
433message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800434 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700435
436 enum State {
437 OFF = 0;
438 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700439 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
440 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700441 }
442 optional State state = 2;
443}
444
445/**
446 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000447 *
448 * Logged from:
449 * TODO
450 */
Bookatzd6746242017-10-24 18:39:35 -0700451message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800452 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000453
Bookatz1a1b0462018-01-12 11:47:03 -0800454 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
455 // From frameworks/base/core/proto/android/os/enums.proto.
456 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700457
458 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
459 optional string tag = 3;
460
461 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800462 RELEASE = 0;
463 ACQUIRE = 1;
464 CHANGE_RELEASE = 2;
465 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700466 }
467 optional State state = 4;
468}
469
470/**
Bookatzc1a050a2017-10-10 15:49:28 -0700471 * Logs when a partial wakelock is considered 'long' (over 1 min).
472 *
473 * Logged from:
474 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
475 */
476message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800477 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700478
Yao Chend54f9dd2017-10-17 17:37:48 +0000479 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
480 optional string tag = 2;
481
Bookatzc1a050a2017-10-10 15:49:28 -0700482 // TODO: I have no idea what this is.
483 optional string history_tag = 3;
484
485 enum State {
486 OFF = 0;
487 ON = 1;
488 }
489 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000490}
491
Bookatzc1a050a2017-10-10 15:49:28 -0700492/**
493 * Logs Battery Saver state change.
494 *
495 * Logged from:
496 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
497 */
498message BatterySaverModeStateChanged {
499 enum State {
500 OFF = 0;
501 ON = 1;
502 }
503 optional State state = 1;
504}
505
506/**
507 * Logs Doze mode state change.
508 *
509 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800510 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700511 */
512message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800513 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800514}
515
516
517/**
518 * Logs state change of Doze mode including maintenance windows.
519 *
520 * Logged from:
521 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
522 */
523message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800524 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700525}
526
527/**
528 * Logs screen brightness level.
529 *
530 * Logged from:
531 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
532 */
533message ScreenBrightnessChanged {
534 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
535 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700536}
537
538/**
539 * Logs battery level (percent full, from 0 to 100).
540 *
541 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700542 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700543 */
544message BatteryLevelChanged {
545 // Battery level. Should be in [0, 100].
546 optional int32 battery_level = 1;
547}
548
549/**
550 * Logs change in charging status of the device.
551 *
552 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700553 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700554 */
555message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800556 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
557 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700558}
559
560/**
561 * Logs whether the device is plugged in, and what power source it is using.
562 *
563 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700564 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700565 */
566message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800567 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
568 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700569}
570
Bookatz8c6571b2017-10-24 15:04:41 -0700571// TODO: Define this more precisely.
572// TODO: Log the ON state somewhere. It isn't currently logged anywhere.
573/**
574 * Logs when the device turns off or on.
575 *
576 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700577 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700578 */
579message DeviceOnStatusChanged {
580 enum State {
581 OFF = 0;
582 ON = 1;
583 }
584 optional State state = 1;
585}
586
587/**
588 * Logs when an app's wakeup alarm fires.
589 *
590 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700591 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700592 */
593message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800594 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800595
596 // Name of the wakeup alarm.
597 optional string tag = 2;
598}
599
600/**
601 * Logs when an an app causes the mobile radio to change state.
602 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
603 *
604 * Logged from:
605 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
606 */
607message MobileRadioPowerStateChanged {
608 // TODO: Add attribution instead of uid?
Yao Chenc40a19d2018-03-15 16:48:25 -0700609 optional int32 uid = 1 [(is_uid) = true];
Bookatzddccf0a2017-11-28 16:48:14 -0800610
Bookatz1a1b0462018-01-12 11:47:03 -0800611 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
612 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800613}
614
615/**
616 * Logs when an an app causes the wifi radio to change state.
617 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
618 *
619 * Logged from:
620 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
621 */
622message WifiRadioPowerStateChanged {
623 // TODO: Add attribution instead of uid?
Yao Chenc40a19d2018-03-15 16:48:25 -0700624 optional int32 uid = 1 [(is_uid) = true];
Bookatzddccf0a2017-11-28 16:48:14 -0800625
Bookatz1a1b0462018-01-12 11:47:03 -0800626 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
627 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700628}
629
630/**
631 * Logs kernel wakeup reasons and aborts.
632 *
633 * Logged from:
634 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
635 */
636message KernelWakeupReported {
637 // Name of the kernel wakeup reason (or abort).
638 optional string wakeup_reason_name = 1;
639
640 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800641 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700642}
643
644/**
645 * Logs wifi locks held by an app.
646 *
647 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700648 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700649 */
650message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800651 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700652
653 enum State {
654 OFF = 0;
655 ON = 1;
656 }
657 optional State state = 2;
658}
659
660/**
661 * Logs wifi signal strength changes.
662 *
663 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700664 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700665 */
666message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800667 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
668 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700669}
670
671/**
672 * Logs wifi scans performed by an app.
673 *
674 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700675 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700676 */
677message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800678 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700679
680 enum State {
681 OFF = 0;
682 ON = 1;
683 }
684 optional State state = 2;
685}
686
687/**
Tej Singh4503e102018-01-04 14:35:01 -0800688 * Logs wifi multicast locks held by an app
689 *
690 * Logged from:
691 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
692 */
693message WifiMulticastLockStateChanged {
694 repeated AttributionNode attribution_node = 1;
695
696 enum State {
697 OFF = 0;
698 ON = 1;
699 }
700 optional State state = 2;
701}
702
703/**
Tej Singh1ea42892018-01-19 09:27:00 -0800704 * Logs shutdown reason and duration on next boot.
705 *
706 * Logged from:
707 * frameworks/base/core/java/com/android/server/BootReceiver.java
708 */
709message ShutdownSequenceReported {
710 // True if shutdown is for a reboot. Default: false if we do not know.
711 optional bool reboot = 1;
712
713 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
714 optional string reason = 2;
715
716 // Beginning of shutdown time in ms using wall clock time since unix epoch.
717 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800718 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800719
720 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800721 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800722}
723
Tej Singh6483ea42018-01-25 17:45:49 -0800724
725/**
726 * Logs boot reason and duration.
727 *
728 * Logged from:
729 * system/core/bootstat/bootstat.cpp
730 */
731message BootSequenceReported {
732 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
733 // Default: "<EMPTY>" if not available.
734 optional string bootloader_reason = 1;
735
736 // Reason for system boot. Eg. bootloader, reboot,userrequested
737 // Default: "<EMPTY>" if not available.
738 optional string system_reason = 2;
739
740 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800741 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800742
743 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800744 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800745
746 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800747 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800748
749 // Time since last boot in ms. Default: 0 if not available.
750 optional int64 time_since_last_boot = 6;
751}
752
Tej Singhc477d9c2018-02-05 18:31:39 -0800753
754/**
755 * Logs call state and disconnect cause (if applicable).
756 *
757 * Logged from:
758 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
759 */
760message CallStateChanged {
761 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
762 // From frameworks/base/core/proto/android/telecomm/enums.proto.
763 optional android.telecom.CallStateEnum call_state = 1;
764
765 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
766 // This value is only applicable when the call_state is DISCONNECTED, and
767 // should always be UNKNOWN if the call_state is not DISCONNECTED.
768 // From frameworks/base/core/proto/android/telecomm/enums.proto.
769 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
770
771 // True if the call is self-managed, which are apps that use the
772 // telecom infrastructure to make their own calls.
773 optional bool self_managed = 3;
774
775 // True if call is external. External calls are calls on connected Wear
776 // devices but show up in Telecom so the user can pull them onto the device.
777 optional bool external_call = 4;
778}
779
Tej Singh1ea42892018-01-19 09:27:00 -0800780/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800781 * Logs keyguard state. The keyguard is the lock screen.
782 *
783 * Logged from:
784 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
785 */
786message KeyguardStateChanged {
787 enum State {
788 UNKNOWN = 0;
789 // The keyguard is hidden when the phone is unlocked.
790 HIDDEN = 1;
791 // The keyguard is shown when the phone is locked (screen turns off).
792 SHOWN= 2;
793 // The keyguard is occluded when something is overlaying the keyguard.
794 // Eg. Opening the camera while on the lock screen.
795 OCCLUDED = 3;
796 }
797 optional State state = 1;
798}
799
800/**
801 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
802 * prompts the user to enter a password (pattern, pin, etc).
803 *
804 * Logged from:
805 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
806 */
807
808message KeyguardBouncerStateChanged {
809 enum State {
810 UNKNOWN = 0;
811 // Bouncer is hidden, either as a result of successfully entering the
812 // password, screen timing out, or user going back to lock screen.
813 HIDDEN = 1;
814 // This is when the user is being prompted to enter the password.
815 SHOWN = 2;
816 }
817 optional State state = 1;
818}
819
820/**
821 * Logs the result of entering a password into the keyguard bouncer.
822 *
823 * Logged from:
824 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
825 */
826message KeyguardBouncerPasswordEntered {
827 enum BouncerResult {
828 UNKNOWN = 0;
829 // The password entered was incorrect.
830 FAILURE = 1;
831 // The password entered was correct.
832 SUCCESS = 2;
833 }
834 optional BouncerResult result = 1;
835}
836
Tej Singha883b372018-02-15 11:30:01 -0800837/*
838 * Logs changes to the configuration of the device. The configuration is defined
839 * in frameworks/base/core/java/android/content/res/Configuration.java
840 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
841 * Please go there to interpret the possible values each field can be.
842 *
843 * Logged from:
844 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
845 */
846message ResourceConfigurationChanged {
847 // Bit mask of color capabilities of the screen.
848 // Contains information about the color gamut and hdr mode of the screen.
849 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
850 optional int32 colorMode = 1;
851
852 // The target screen density being rendered to.
853 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
854 optional int32 densityDpi = 2;
855
856 // Current user preference for the scaling factor for fonts,
857 // relative to the base density scaling.
858 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
859 optional float fontScale = 3;
860
861 // Flag indicating whether the hard keyboard is hidden.
862 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
863 optional int32 hardKeyboardHidden = 4;
864
865 // The type of keyboard attached to the device.
866 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
867 optional int32 keyboard = 5;
868
869 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
870 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
871 optional int32 keyboardHideen = 6;
872
873 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
874 // 0 if undefined.
875 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
876 optional int32 mcc = 7;
877
878 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
879 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
880 // MNC_ZERO symbol defined in Configuration.java.
881 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
882 optional int32 mnc = 8;
883
884 // The kind of navigation available on the device.
885 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
886 optional int32 navigation = 9;
887
888 // Flag indicating whether the navigation is available.
889 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
890 optional int32 navigationHidden = 10;
891
892 // Overall orientation of the screen.
893 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
894 optional int32 orientation = 11;
895
896 // The current height of the available screen space, in dp units.
897 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
898 optional int32 screenHeightDp = 12;
899
900 // Bit mask of overall layout of the screen.
901 // Contains information about screen size, whether the screen is wider/taller
902 // than normal, whether the screen layout is right-tl-left or left-to-right,
903 // and whether the screen has a rounded shape.
904 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
905 optional int32 screenLayout = 13;
906
907 // Current width of the available screen space, in dp units.
908 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
909 optional int32 screenWidthDp = 14;
910
911 // The smallest screen size an application will see in normal operation.
912 // This is the smallest value of both screenWidthDp and screenHeightDp
913 // in portrait and landscape.
914 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
915 optional int32 smallestScreenWidthDp = 15;
916
917 // The type of touch screen attached to the device.
918 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
919 optional int32 touchscreen = 16;
920
921 // Bit mask of the ui mode.
922 // Contains information about the overall ui mode of the device.
923 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
924 // Also contains information about whether the device is in night mode.
925 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
926 optional int32 uiMode = 17;
927}
928
Tej Singheee317b2018-03-07 19:28:05 -0800929
930/**
931 * Logs changes in the connection state of the mobile radio.
932 *
933 * Logged from:
934 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
935 */
936message MobileConnectionStateChanged {
937 // States are from the state machine DataConnection.java.
938 enum State {
939 UNKNOWN = 0;
940 // The connection is inactive, or disconnected.
941 INACTIVE = 1;
942 // The connection is being activated, or connecting.
943 ACTIVATING = 2;
944 // The connection is active, or connected.
945 ACTIVE = 3;
946 // The connection is disconnecting.
947 DISCONNECTING = 4;
948 // The connection is disconnecting after creating a connection.
949 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
950 }
951 optional State state = 1;
952 // For multi-sim phones, this distinguishes between the sim cards.
953 optional int32 sim_slot_index = 2;
954 // Used to identify the connection. Starts at 0 and increments by 1 for
955 // every new network created. Resets whenever the device reboots.
956 optional int32 data_connection_id = 3;
957 // A bitmask for the capabilities of this connection.
958 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
959 // Default value (if we have no information): 0
960 optional int64 capabilities = 4;
961 // If this connection has internet.
962 // This just checks if the DEFAULT bit of capabilities is set.
963 optional bool has_internet = 5;
964}
965
966/**
967 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
968 *
969 * Logged from:
970 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
971 */
972message MobileRadioTechnologyChanged {
973 optional android.telephony.NetworkTypeEnum state = 1;
974 // For multi-sim phones, this distinguishes between the sim cards.
975 optional int32 sim_slot_index = 2;
976}
977
Andrew Chantb56388b2018-03-22 21:07:33 -0700978/**
979 * Logs the VID and PID of any connected USB devices.
980 *
981 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
982 *
983 * Logged by Vendor.
984 */
985message UsbDeviceAttached {
986 optional int32 vid = 1;
987 optional int32 pid = 2;
988 optional bool has_audio = 3;
989 optional bool has_hid = 4;
990 optional bool has_storage = 5;
991}
992
Tej Singheee317b2018-03-07 19:28:05 -0800993
Tej Singhdd7bd352018-02-09 19:33:15 -0800994/**
Tej Singh5d991e12018-03-09 19:48:11 -0800995 * Logs when Bluetooth is enabled and disabled.
996 *
997 * Logged from:
998 * services/core/java/com/android/server/BluetoothManagerService.java
999 */
1000message BluetoothEnabledStateChanged {
1001 repeated AttributionNode attribution_node = 1;
1002 // Whether or not bluetooth is enabled on the device.
1003 enum State {
1004 UNKNOWN = 0;
1005 ENABLED = 1;
1006 DISABLED = 2;
1007 }
1008 optional State state = 2;
1009 // The reason for being enabled/disabled.
1010 // Eg. Airplane mode, crash, application request.
1011 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1012 // If the reason is an application request, this will be the package name.
1013 optional string pkgName = 4;
1014}
1015
1016/**
1017 * Logs when a Bluetooth device connects and disconnects.
1018 *
1019 * Logged from:
1020 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1021 */
1022message BluetoothConnectionStateChanged {
1023 // The state of the connection.
1024 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1025 optional android.bluetooth.ConnectionStateEnum state = 1;
1026 // An identifier that can be used to match connect and disconnect events.
1027 // Currently is last two bytes of a hash of a device level ID and
1028 // the mac address of the bluetooth device that is connected.
1029 optional int32 obfuscated_id = 2;
1030 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1031 // From android.bluetooth.BluetoothAdapter.java
1032 optional int32 bt_profile = 3;
1033}
1034
1035/**
1036 * Logs when Bluetooth A2dp audio streaming state changes.
1037 *
1038 * Logged from:
1039 * TODO(b/73971848)
1040 */
1041message BluetoothA2dpAudioStateChanged {
1042 // Whether or not audio is being played using Bluetooth A2dp.
1043 enum State {
1044 UNKNOWN = 0;
1045 PLAY = 1;
1046 STOP = 2;
1047 }
1048 optional State state = 1;
1049}
1050
1051/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001052 * Logs when something is plugged into or removed from the USB-C connector.
1053 *
1054 * Logged from:
1055 * Vendor USB HAL.
1056 */
1057message UsbConnectorStateChanged {
1058 enum State {
1059 DISCONNECTED = 0;
1060 CONNECTED = 1;
1061 }
1062 optional State state = 1;
1063}
1064
1065/**
1066 * Logs the reported speaker impedance.
1067 *
1068 * Logged from:
1069 * Vendor audio implementation.
1070 */
1071message SpeakerImpedanceReported {
1072 optional int32 speaker_location = 1;
1073 optional int32 impedance = 2;
1074}
1075
1076/**
1077 * Logs the report of a failed hardware.
1078 *
1079 * Logged from:
1080 * Vendor HALs.
1081 *
1082 */
1083message HardwareFailed {
1084 enum HardwareType {
1085 HARDWARE_FAILED_UNKNOWN = 0;
1086 HARDWARE_FAILED_MICROPHONE = 1;
1087 HARDWARE_FAILED_CODEC = 2;
1088 HARDWARE_FAILED_SPEAKER = 3;
1089 HARDWARE_FAILED_FINGERPRINT = 4;
1090 }
1091 optional HardwareType hardware_type = 1;
1092
1093 /* hardware_location allows vendors to differentiate between multiple instances of
1094 * the same hardware_type. The specific locations are vendor defined integers,
1095 * referring to board-specific numbering schemes.
1096 */
1097 optional int32 hardware_location = 2;
1098
1099 /* failure_code is specific to the HardwareType of the failed hardware.
1100 * It should use the enum values defined below.
1101 */
1102 enum MicrophoneFailureCode {
1103 MICROPHONE_FAILURE_COMPLETE = 0;
1104 }
1105 enum CodecFailureCode {
1106 CODEC_FAILURE_COMPLETE = 0;
1107 }
1108 enum SpeakerFailureCode {
1109 SPEAKER_FAILURE_COMPLETE = 0;
1110 SPEAKER_FAILURE_HIGH_Z = 1;
1111 SPEAKER_FAILURE_SHORT = 2;
1112 }
1113 enum FingerprintFailureCode {
1114 FINGERPRINT_FAILURE_COMPLETE = 0;
1115 FINGERPRINT_SENSOR_BROKEN = 1;
1116 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1117 }
1118 optional int32 failure_code = 3;
1119}
1120
1121/**
1122 * Log an event when the device has been physically dropped.
1123 * Reported from the /vendor partition.
1124 */
1125message PhysicalDropDetected {
1126 // Confidence that the event was actually a drop, 0 -> 100
1127 optional int32 confidence_pctg = 1;
1128 // Peak acceleration of the drop, in 1/1000s of a g.
1129 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001130 // Duration of freefall in ms
1131 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001132}
1133
1134/**
1135 * Log bucketed battery charge cycles.
1136 *
1137 * Each bucket represents cycles of the battery past
1138 * a given charge point. For example, bucket 1 is the
1139 * lowest 1/8th of the battery, and bucket 8 is 100%.
1140 *
1141 * Logged from:
1142 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1143 */
1144message ChargeCyclesReported {
1145 optional int32 cycle_bucket_1 = 1;
1146 optional int32 cycle_bucket_2 = 2;
1147 optional int32 cycle_bucket_3 = 3;
1148 optional int32 cycle_bucket_4 = 4;
1149 optional int32 cycle_bucket_5 = 5;
1150 optional int32 cycle_bucket_6 = 6;
1151 optional int32 cycle_bucket_7 = 7;
1152 optional int32 cycle_bucket_8 = 8;
1153}
1154
1155/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001156 * Logs the duration of a davey (jank of >=700ms) when it occurs
1157 *
1158 * Logged from:
1159 * frameworks/base/libs/hwui/JankTracker.cpp
1160 */
1161message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001162 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001163 optional int32 uid = 1 [(is_uid) = true];
1164 ;
David Chen77ef6712018-02-23 18:23:42 -08001165
Tej Singhbb8554a2018-01-26 11:59:14 -08001166 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001167 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001168}
1169
1170/**
Bookatze5885242017-10-24 20:10:31 -07001171 * Logs phone signal strength changes.
1172 *
1173 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001174 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001175 */
1176message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001177 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1178 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001179}
1180
1181/**
1182 * Logs that a setting was updated.
1183 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001184 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001185 * The tag and is_default allow resetting of settings to default values based on the specified
1186 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1187 */
1188message SettingChanged {
1189 // The name of the setting.
1190 optional string setting = 1;
1191
1192 // The change being imposed on this setting. May represent a number, eg "3".
1193 optional string value = 2;
1194
1195 // The new value of this setting. For most settings, this is same as value. For some settings,
1196 // value is +X or -X where X represents an element in a set. For example, if the previous value
1197 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1198 // The +/- feature is currently only used for location_providers_allowed.
1199 optional string new_value = 3;
1200
1201 // The previous value of this setting.
1202 optional string prev_value = 4;
1203
1204 // The tag used with the is_default for resetting sets of settings. This is generally null.
1205 optional string tag = 5;
1206
Bookatz90867622018-01-31 15:05:57 -08001207 // True if this setting with tag should be resettable.
1208 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001209
David Chenbd789912018-03-16 17:19:55 -07001210 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001211 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001212
1213 enum ChangeReason {
1214 UPDATED = 1; // Updated can be an insertion or an update.
1215 DELETED = 2;
1216 }
1217 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001218}
Chenjie Yub3dda412017-10-24 13:41:59 -07001219
Chenjie Yu05013b32017-11-21 10:21:41 -08001220/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001221 * Logs activity going to foreground or background
1222 *
1223 * Logged from:
1224 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1225 */
1226message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001227 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001228 optional string pkg_name = 2;
1229 optional string class_name = 3;
1230
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001231 enum Activity {
1232 MOVE_TO_BACKGROUND = 0;
1233 MOVE_TO_FOREGROUND = 1;
1234 }
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001235 optional Activity activity = 4;
1236}
David Chenc8a43242017-10-17 16:23:28 -07001237
1238/**
David Chen9e3808c2017-11-20 17:25:34 -08001239 * Logs when an error is written to dropbox.
1240 * Logged from:
1241 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1242 */
1243message DropboxErrorChanged {
1244 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001245 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001246
1247 // Tag used when recording this error to dropbox. Contains data_ or system_ prefix.
1248 optional string tag = 2;
1249
1250 // The name of the process.
1251 optional string process_name = 3;
1252
1253 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001254 optional sint32 pid = 4;
David Chen9e3808c2017-11-20 17:25:34 -08001255
1256 // 1 indicates is instant app. -1 indicates Not applicable.
David Chen6e3e6cb2018-01-03 16:14:06 -08001257 optional sint32 is_instant_app = 5;
David Chen9e3808c2017-11-20 17:25:34 -08001258
1259 // The activity name if available.
1260 optional string activity_name = 6;
1261
David Chen6e3e6cb2018-01-03 16:14:06 -08001262 // The package name if available.
1263 optional string package_name = 7;
1264
David Chen9e3808c2017-11-20 17:25:34 -08001265 // 1 indicates in foreground. -1 indicates not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001266 optional sint32 is_foreground = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001267}
1268
David Chen0a368b22017-12-06 16:28:16 -08001269/*
1270 * Allows other apps to push events into statsd.
1271 * Logged from:
1272 * frameworks/base/core/java/android/util/StatsLog.java
1273 */
David Chen0b5c90c2018-01-25 16:51:49 -08001274message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001275 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001276 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001277
1278 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1279 optional int32 label = 2;
1280
1281 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1282 // predicates for the metrics).
1283 enum State {
1284 UNKNOWN = 0;
1285 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1286 STOP = 2;
1287 START = 3;
1288 }
1289 optional State state = 3;
1290}
1291
David Chen9e3808c2017-11-20 17:25:34 -08001292/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001293 * Logs when statsd detects an anomaly.
1294 *
1295 * Logged from:
1296 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1297 */
1298message AnomalyDetected {
1299 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001300 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001301
Yangster-mac94e197c2018-01-02 16:03:03 -08001302 // Id of the config whose anomaly detection alert fired.
1303 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001304
Yangster-mac94e197c2018-01-02 16:03:03 -08001305 // Id of the alert (i.e. name of the anomaly that was detected).
1306 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001307}
1308
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001309message AppStartChanged {
1310 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001311 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001312
1313 // The app package name.
1314 optional string pkg_name = 2;
1315
1316 enum TransitionType {
1317 APP_START_TRANSITION_TYPE_UNKNOWN = 0;
1318 WARM = 1;
1319 HOT = 2;
1320 COLD = 3;
1321 }
1322 // The transition type.
1323 optional TransitionType type = 3;
1324
1325 // The activity name.
1326 optional string activity_name = 4;
1327
1328 // The name of the calling app. Empty if not set.
1329 optional string calling_pkg_name = 5;
1330
1331 // Whether the app is an instant app.
1332 optional bool is_instant_app = 6;
1333
1334 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001335 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001336
Bookatz80d11a02018-01-16 10:46:35 -08001337 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001338
David Chen0b5c90c2018-01-25 16:51:49 -08001339 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001340 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001341 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001342 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001343 optional int32 bind_application_delay_millis = 11;
1344 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001345
1346 // Empty if not set.
1347 optional string launch_token = 13;
1348
Calin Juravle759fbda2018-02-20 19:52:30 +00001349 // The compiler filter used when when the package was optimized.
1350 optional string package_optimization_compilation_filter = 14;
1351
1352 // The reason why the package was optimized.
1353 optional string package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001354}
1355
1356message AppStartCancelChanged {
1357 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001358 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001359
1360 // The app package name.
1361 optional string pkg_name = 2;
1362
1363 enum TransitionType {
1364 APP_START_TRANSITION_TYPE_UNKNOWN = 0;
1365 WARM = 1;
1366 HOT = 2;
1367 COLD = 3;
1368 }
1369 // The transition type.
1370 optional TransitionType type = 3;
1371
1372 // The activity name.
1373 optional string activity_name = 4;
1374}
1375
1376message AppStartFullyDrawnChanged {
1377 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001378 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001379
1380 // The app package name.
1381 optional string pkg_name = 2;
1382
1383 enum TransitionType {
1384 APP_START_TRANSITION_TYPE_UNKNOWN = 0;
1385 WITH_BUNDLE = 1;
1386 WITHOUT_BUNDLE = 2;
1387 }
1388 // The transition type.
1389 optional TransitionType type = 3;
1390
1391 // The activity name.
1392 optional string activity_name = 4;
1393
1394 optional bool transition_process_running = 5;
1395
1396 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001397 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001398}
1399
Bookatz8fcd09a2017-12-18 13:01:10 -08001400/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001401 * Logs a picture-in-picture action
1402 * Logged from:
1403 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1404 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1405 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1406 */
1407message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001408 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001409 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001410
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001411 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001412
Chenjie Yu52cacc62017-12-08 18:11:45 -08001413 enum State {
1414 ENTERED = 1;
1415 EXPANDED_TO_FULL_SCREEN = 2;
1416 MINIMIZED = 3;
1417 DISMISSED = 4;
1418 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001419 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001420}
1421
1422/**
Chenjie Yue8904192017-12-08 19:12:57 -08001423 * Logs overlay action
1424 * Logged from:
1425 * services/core/java/com/android/server/wm/Session.java
1426 */
1427message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001428 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001429
1430 optional string package_name = 2;
1431
1432 optional bool using_alert_window = 3;
1433
1434 enum State {
1435 ENTERED = 1;
1436 EXITED = 2;
1437 }
1438 optional State state = 4;
1439}
1440
Chenjie Yuccfe6452018-01-30 11:33:21 -08001441/*
1442 * Logs foreground service starts and stops.
1443 * Note that this is not when a service starts or stops, but when it is
1444 * considered foreground.
1445 * Logged from
1446 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1447 */
1448message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001449 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001450 // package_name + "/" + class_name
1451 optional string short_name = 2;
1452
1453 enum State {
1454 ENTER = 1;
1455 EXIT = 2;
1456 }
1457 optional State state = 3;
1458}
1459
Chenjie Yue8904192017-12-08 19:12:57 -08001460/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001461 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1462 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1463 * attributed back to the parent (host) uid. One example is Chrome.
1464 *
1465 * Logged from:
1466 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1467 */
1468message IsolatedUidChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001469 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001470 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
1471 optional int32 parent_uid = 1;
1472
1473 optional int32 isolated_uid = 2;
1474
1475 // We expect an isolated uid to be removed before if it's used for another parent uid.
1476 enum Event {
1477 REMOVED = 0;
1478 CREATED = 1;
1479 }
1480 optional Event event = 3;
1481}
1482
1483/*
1484 * Logs the reception of an incoming network packet causing the main system to wake up for
1485 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1486 * and processed by WakeupController.cpp.
1487 */
1488message PacketWakeupOccurred {
1489 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1490 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001491 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001492 // The interface name on which the packet was received.
1493 optional string iface = 2;
1494 // The ethertype value of the packet.
1495 optional int32 ethertype = 3;
1496 // String representation of the destination MAC address of the packet.
1497 optional string destination_hardware_address = 4;
1498 // String representation of the source address of the packet if this was an IP packet.
1499 optional string source_ip = 5;
1500 // String representation of the destination address of the packet if this was an IP packet.
1501 optional string destination_ip = 6;
1502 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1503 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1504 // families.
1505 optional int32 ip_next_header = 7;
1506 // The source port if this was a TCP or UDP packet.
1507 optional int32 source_port = 8;
1508 // The destination port if this was a TCP or UDP packet.
1509 optional int32 destination_port = 9;
1510}
1511
1512/*
1513 * Logs the memory stats for an app on startup.
1514 * Logged from:
1515 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1516 */
1517message AppStartMemoryStateCaptured {
1518 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001519 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001520
1521 // The process name.
1522 optional string process_name = 2;
1523
1524 // The activity name.
1525 optional string activity_name = 3;
1526
1527 // # of page-faults
1528 optional int64 pgfault = 4;
1529
1530 // # of major page-faults
1531 optional int64 pgmajfault = 5;
1532
1533 // RSS
1534 optional int64 rss_in_bytes = 6;
1535
1536 // CACHE
1537 optional int64 cache_in_bytes = 7;
1538
1539 // SWAP
1540 optional int64 swap_in_bytes = 8;
1541}
1542
1543/*
1544 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1545 * for LMK event.
1546 * Logged from:
1547 * system/core/lmkd/lmkd.c
1548 */
1549message LmkStateChanged {
1550 enum State {
1551 UNKNOWN = 0;
1552 START = 1;
1553 STOP = 2;
1554 }
1555 optional State state = 1;
1556}
1557
1558/*
1559 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1560 * Logged from:
1561 * system/core/lmkd/lmkd.c
1562 */
1563message LmkKillOccurred {
1564 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001565 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001566
1567 // The process name.
1568 optional string process_name = 2;
1569
1570 // oom adj score.
1571 optional int32 oom_score = 3;
1572
1573 // # of page-faults
1574 optional int64 pgfault = 4;
1575
1576 // # of major page-faults
1577 optional int64 pgmajfault = 5;
1578
1579 // RSS
1580 optional int64 rss_in_bytes = 6;
1581
1582 // CACHE
1583 optional int64 cache_in_bytes = 7;
1584
1585 // SWAP
1586 optional int64 swap_in_bytes = 8;
1587}
1588
Rajeev Kumar51b54602018-03-01 12:18:26 -08001589/*
1590 * Logs when the ActivityManagerService detects that an app died.
1591 *
1592 * Logged from:
1593 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1594 */
1595message AppDied {
1596 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07001597 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08001598}
1599
Chenjie Yubbcbc602018-02-05 16:51:52 -08001600//////////////////////////////////////////////////////////////////////
1601// Pulled atoms below this line //
1602//////////////////////////////////////////////////////////////////////
1603
1604/**
David Chenc8a43242017-10-17 16:23:28 -07001605 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
1606 *
1607 * Pulled from:
1608 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1609 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001610message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001611 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001612
1613 optional int64 rx_bytes = 2;
1614
1615 optional int64 rx_packets = 3;
1616
1617 optional int64 tx_bytes = 4;
1618
1619 optional int64 tx_packets = 5;
1620}
1621
1622/**
1623 * Pulls bytes transferred via wifi (separated by foreground and background usage).
1624 *
1625 * Pulled from:
1626 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1627 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001628message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001629 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001630
Yao Chenc40a19d2018-03-15 16:48:25 -07001631 // 1 denotes foreground and 0 denotes background. This is called Set in
1632 // NetworkStats.
David Chenc8a43242017-10-17 16:23:28 -07001633 optional int32 is_foreground = 2;
1634
1635 optional int64 rx_bytes = 3;
1636
1637 optional int64 rx_packets = 4;
1638
1639 optional int64 tx_bytes = 5;
1640
1641 optional int64 tx_packets = 6;
1642}
1643
1644/**
1645 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
1646 *
1647 * Pulled from:
1648 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1649 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001650message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001651 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001652
1653 optional int64 rx_bytes = 2;
1654
1655 optional int64 rx_packets = 3;
1656
1657 optional int64 tx_bytes = 4;
1658
1659 optional int64 tx_packets = 5;
1660}
1661
1662/**
1663 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
1664 *
1665 * Pulled from:
1666 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1667 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001668message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001669 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001670
Yao Chenc40a19d2018-03-15 16:48:25 -07001671 // 1 denotes foreground and 0 denotes background. This is called Set in
1672 // NetworkStats.
David Chenc8a43242017-10-17 16:23:28 -07001673 optional int32 is_foreground = 2;
1674
1675 optional int64 rx_bytes = 3;
1676
1677 optional int64 rx_packets = 4;
1678
1679 optional int64 tx_bytes = 5;
1680
1681 optional int64 tx_packets = 6;
1682}
1683
1684/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001685 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
1686 *
1687 * Pulled from:
1688 * StatsCompanionService
1689 */
1690message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001691 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001692
1693 optional int64 rx_bytes = 2;
1694
1695 optional int64 tx_bytes = 3;
1696}
1697
1698/**
David Chenc8a43242017-10-17 16:23:28 -07001699 * Pulls the kernel wakelock durations. This atom is adapted from
1700 * android/internal/os/KernelWakelockStats.java
1701 *
1702 * Pulled from:
1703 * StatsCompanionService using KernelWakelockReader.
1704 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001705message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07001706 optional string name = 1;
1707
1708 optional int32 count = 2;
1709
1710 optional int32 version = 3;
1711
1712 optional int64 time = 4;
1713}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001714
Chenjie Yu05013b32017-11-21 10:21:41 -08001715/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001716 * Pulls low power state information. This includes platform and subsystem sleep state information,
1717 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001718 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001719 * hardware/interfaces/power/1.1/types.hal
1720 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001721message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08001722 // Subsystem name
1723 optional string subsystem_name = 1;
1724 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
1725 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
1726 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001727 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08001728 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001729 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08001730 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07001731}
Chenjie Yu7f8def92017-11-03 09:33:15 -07001732
Chenjie Yu05013b32017-11-21 10:21:41 -08001733/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07001734 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08001735 * Pulls the time the cpu spend on the frequency index. Frequency index
1736 * starts from highest to lowest. The value should be monotonically
1737 * increasing since boot. However, if there is a cpu
1738 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07001739 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001740message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07001741 optional uint32 cluster = 1;
1742 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001743 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07001744}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001745
Chenjie Yu05013b32017-11-21 10:21:41 -08001746/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001747 * Pulls Cpu Time Per Uid.
1748 * Note that isolated process uid time should be attributed to host uids.
1749 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001750message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07001751 optional int32 uid = 1 [(is_uid) = true];
David Chen0b5c90c2018-01-25 16:51:49 -08001752 optional uint64 user_time_millis = 2;
1753 optional uint64 sys_time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001754}
1755
1756/**
1757 * Pulls Cpu Time Per Uid per frequency.
1758 * Note that isolated process uid time should be attributed to host uids.
1759 * For each uid, we order the time by descending frequencies.
1760 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001761message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07001762 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001763 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001764 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001765}
Hugo Benichi884970e2017-11-14 22:42:46 +09001766
Chenjie Yu05013b32017-11-21 10:21:41 -08001767/**
1768 * Pulls Wifi Controller Activity Energy Info
1769 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001770message WifiActivityEnergyInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001771 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001772 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001773 // stack reported state
1774 // TODO: replace this with proto enum
1775 optional int32 stack_state = 2;
1776 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001777 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001778 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001779 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001780 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001781 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001782 // product of current(mA), voltage(V) and time(ms)
1783 optional uint64 controller_energy_used = 6;
1784}
1785
1786/**
1787 * Pulls Modem Activity Energy Info
1788 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001789message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001790 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001791 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001792 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001793 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08001794 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001795 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001796 /**
1797 * Tx power index
1798 * index 0 = tx_power < 0dBm
1799 * index 1 = 0dBm < tx_power < 5dBm
1800 * index 2 = 5dBm < tx_power < 15dBm
1801 * index 3 = 15dBm < tx_power < 20dBm
1802 * index 4 = tx_power > 20dBm
1803 */
1804 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08001805 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001806 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08001807 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001808 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08001809 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08001810 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08001811 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08001812 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08001813 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08001814 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08001815 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08001816 // product of current(mA), voltage(V) and time(ms)
1817 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08001818}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001819
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001820/**
1821 * Pulls Bluetooth Activity Energy Info
1822 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
1823 */
1824message BluetoothActivityInfo {
1825 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001826 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001827 // bluetooth stack state
1828 optional int32 bluetooth_stack_state = 2;
1829 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001830 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001831 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001832 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001833 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001834 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001835 // product of current(mA), voltage(V) and time(ms)
1836 optional uint64 energy_used = 6;
1837}
1838
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001839/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001840 * Logs the memory stats for a process.
1841 */
1842message ProcessMemoryState {
1843 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001844 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001845
1846 // The process name.
1847 optional string process_name = 2;
1848
1849 // oom adj score.
1850 optional int32 oom_score = 3;
1851
1852 // # of page-faults
1853 optional int64 pgfault = 4;
1854
1855 // # of major page-faults
1856 optional int64 pgmajfault = 5;
1857
Rajeev Kumar90235992018-01-29 11:06:48 -08001858 // RSS
1859 optional int64 rss_in_bytes = 6;
1860
1861 // CACHE
1862 optional int64 cache_in_bytes = 7;
1863
1864 // SWAP
1865 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001866}
1867
1868/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001869 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001870 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001871message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08001872 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001873}
1874
1875/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001876 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001877 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001878message SystemUptime {
1879 // Milliseconds since the system was booted.
1880 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
1881 // for external input).
1882 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08001883 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001884}
1885
1886/*
1887 * Reads from /proc/uid_concurrent_active_time which has the format:
1888 * active: X (X is # cores)
1889 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
1890 * [uid1]: [time-0] [time-1] [time-2] ... ...
1891 * ...
1892 * Time-N means the CPU time a UID spent running concurrently with N other processes.
1893 * The file contains a monotonically increasing count of time for a single boot.
1894 */
1895message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07001896 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001897 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001898}
1899
1900/**
1901 * Reads from /proc/uid_concurrent_policy_time which has the format:
1902 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
1903 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1904 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1905 * ...
1906 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
1907 * The file contains a monotonically increasing count of time for a single boot.
1908 */
1909message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07001910 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001911 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001912 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08001913}
1914
1915/*
1916 * Pulls free disk space, for data, system partition and temporary directory.
1917 */
1918message DiskSpace {
1919 // available bytes in data partition
1920 optional uint64 data_available_bytes = 1;
1921 // available bytes in system partition
1922 optional uint64 system_available_bytes = 2;
1923 // available bytes in download cache or temp directories
1924 optional uint64 temp_available_bytes = 3;
1925}
Tej Singhbf972d92018-01-10 20:51:13 -08001926
1927/**
1928 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08001929 * Pulled from:
1930 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08001931 */
1932message RemainingBatteryCapacity {
1933 optional int32 charge_uAh = 1;
1934}
1935
1936/**
1937 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08001938 * Pulled from:
1939 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08001940 */
1941message FullBatteryCapacity {
1942 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08001943}
1944
1945/**
1946 * Pulls the temperature of various parts of the device, in Celsius.
1947 *
1948 * Pulled from:
1949 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
1950 */
1951message Temperature {
1952 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
1953 optional android.os.TemperatureTypeEnum sensor_location = 1;
1954
1955 // The name of the temperature source. Eg. CPU0
1956 optional string sensor_name = 2;
1957
1958 // Temperature in degrees C.
1959 optional float temperature_C = 3;
yroa1fe77c2018-02-26 14:22:54 -08001960}