blob: ca3786a9de687e4b4fe6739d49b1a185e920abe4 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080026import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080027import "frameworks/base/core/proto/android/os/enums.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080028import "frameworks/base/core/proto/android/server/enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080029import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080030import "frameworks/base/core/proto/android/telephony/enums.proto";
31import "frameworks/base/core/proto/android/view/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080032
Yao Chend54f9dd2017-10-17 17:37:48 +000033/**
Stefan Lafonae2df012017-11-14 09:17:21 -080034 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000035 * raw stats log events from the Android system, also known as "atoms."
36 *
37 * This field contains a single oneof with all of the available messages.
38 * The stats-log-api-gen tool runs as part of the Android build and
39 * generates the android.util.StatsLog class, which contains the constants
40 * and methods that Android uses to log.
41 *
Stefan Lafonae2df012017-11-14 09:17:21 -080042 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000043 * Instead, statsd on Android constructs these messages synthetically,
44 * in the format defined here and in stats_log.proto.
45 */
Stefan Lafonae2df012017-11-14 09:17:21 -080046message Atom {
47 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070048 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070049 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
50 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080051 // 3 is available for use
Bookatzc1a050a2017-10-10 15:49:28 -070052 BleScanResultReceived ble_scan_result_received = 4;
53 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080054 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070055 SyncStateChanged sync_state_changed = 7;
56 ScheduledJobStateChanged scheduled_job_state_changed = 8;
57 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070058 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080059 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
60 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
61 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080062 // 14 - 19 are available
Bookatzddccf0a2017-11-28 16:48:14 -080063 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
64 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
65 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070066 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080067 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070068 CameraStateChanged camera_state_changed = 25;
69 FlashlightStateChanged flashlight_state_changed = 26;
70 UidProcessStateChanged uid_process_state_changed = 27;
71 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
72 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070073 BatteryLevelChanged battery_level_changed = 30;
74 ChargingStateChanged charging_state_changed = 31;
75 PluggedStateChanged plugged_state_changed = 32;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080076 // 33 - 34 are available
Bookatz8c6571b2017-10-24 15:04:41 -070077 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;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080087 // 45 is available
Bookatz8fcd09a2017-12-18 13:01:10 -080088 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080089 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080090 AppStartOccurred app_start_occurred = 48;
91 AppStartCanceled app_start_canceled = 49;
92 AppStartFullyDrawn app_start_fully_drawn = 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;
Tej Singhdd7bd352018-02-09 19:33:15 -0800104 KeyguardStateChanged keyguard_state_changed = 62;
105 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
106 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800107 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800108 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800109 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
110 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Tej Singh02200f92018-04-02 19:37:59 -0700111 // 69 is blank but need not be.
Andrew Chantb56388b2018-03-22 21:07:33 -0700112 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800113 SpeakerImpedanceReported speaker_impedance_reported = 71;
114 HardwareFailed hardware_failed = 72;
115 PhysicalDropDetected physical_drop_detected = 73;
116 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800117 MobileConnectionStateChanged mobile_connection_state_changed = 75;
118 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700119 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800120 AppCrashOccurred app_crash_occurred = 78;
121 ANROccurred anr_occurred = 79;
122 WTFOccurred wtf_occurred = 80;
123 LowMemReported low_mem_reported = 81;
124
125
Yao Chend54f9dd2017-10-17 17:37:48 +0000126 }
David Chenc8a43242017-10-17 16:23:28 -0700127
David Chen6e3e6cb2018-01-03 16:14:06 -0800128 // Pulled events will start at field 10000.
Tej Singh40298312018-02-16 00:15:09 -0800129 // Next: 10022
David Chenc8a43242017-10-17 16:23:28 -0700130 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800131 WifiBytesTransfer wifi_bytes_transfer = 10000;
132 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
133 MobileBytesTransfer mobile_bytes_transfer = 10002;
134 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800135 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800136 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800137 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800138 CpuTimePerFreq cpu_time_per_freq = 10008;
139 CpuTimePerUid cpu_time_per_uid = 10009;
140 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800141 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800142 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800143 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800144 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800145 SystemElapsedRealtime system_elapsed_realtime = 10014;
146 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800147 CpuActiveTime cpu_active_time = 10016;
148 CpuClusterTime cpu_cluster_time = 10017;
Chenjie Yu937d7422018-01-10 16:37:53 -0800149 DiskSpace disk_space = 10018;
Tej Singhbf972d92018-01-10 20:51:13 -0800150 RemainingBatteryCapacity remaining_battery_capacity = 10019;
151 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800152 Temperature temperature = 10021;
David Chenc8a43242017-10-17 16:23:28 -0700153 }
yroa1fe77c2018-02-26 14:22:54 -0800154
155 // DO NOT USE field numbers above 100,000 in AOSP. Field numbers above
156 // 100,000 are reserved for non-AOSP (e.g. OEMs) to use.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700157}
158
Yao Chend54f9dd2017-10-17 17:37:48 +0000159/**
Yangster-mac20877162017-12-22 17:19:39 -0800160 * This proto represents a node of an attribution chain.
161 * Note: All attribution chains are represented as a repeated field of type
162 * AttributionNode. It is understood that in such arrays, the order is that
163 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000164 */
Yangster-mac20877162017-12-22 17:19:39 -0800165message AttributionNode {
166 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800167 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800168
Yangster-mac20877162017-12-22 17:19:39 -0800169 // The (optional) string tag for an element in the attribution chain. If the
170 // element has no tag, it is encoded as an empty string.
171 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700172}
173
Yao Chend54f9dd2017-10-17 17:37:48 +0000174/*
175 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800176 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000177 *
178 * RULES:
179 * - The field ids for each atom must start at 1, and count upwards by 1.
180 * Skipping field ids is not allowed.
181 * - These form an API, so renaming, renumbering or removing fields is
182 * not allowed between android releases. (This is not currently enforced,
183 * but there will be a tool to enforce this restriction).
184 * - The types must be built-in protocol buffer types, namely, no sub-messages
185 * are allowed (yet). The bytes type is also not allowed.
186 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800187 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000188 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800189 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000190 * - A field that is a uid should be a string field, tagged with the [xxx]
191 * annotation. The generated code on android will be represented by UIDs,
192 * and those UIDs will be translated in xxx to those strings.
193 *
194 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700195 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000196 * - If there is a UID, it goes first. Think in an object-oriented fashion.
197 * *****************************************************************************
198 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700199
Yao Chend54f9dd2017-10-17 17:37:48 +0000200/**
201 * Logs when the screen state changes.
202 *
203 * Logged from:
204 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
205 */
206message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800207 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800208 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700209}
Yao Chend54f9dd2017-10-17 17:37:48 +0000210
211/**
Bookatzc1a050a2017-10-10 15:49:28 -0700212 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000213 *
214 * Logged from:
215 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
216 */
Bookatzc1a050a2017-10-10 15:49:28 -0700217message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700218 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000219
Bookatzdb026a22018-01-10 19:01:56 -0800220 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800221 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000222}
223
224/**
Bookatzc1a050a2017-10-10 15:49:28 -0700225 * Logs that a process started, finished, crashed, or ANRed.
226 *
227 * Logged from:
228 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
229 */
230message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700231 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700232
David Chen0b5c90c2018-01-25 16:51:49 -0800233 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800234 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700235
Bookatzddccf0a2017-11-28 16:48:14 -0800236 // What lifecycle state the process changed to.
237 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800238 enum State {
239 FINISHED = 0;
240 STARTED = 1;
241 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800242 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800243 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700244}
245
Bookatzc1a050a2017-10-10 15:49:28 -0700246/**
247 * Logs when the ble scan state changes.
248 *
249 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700250 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700251 */
252message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800253 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700254
255 enum State {
256 OFF = 0;
257 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700258 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
259 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700260 }
261 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700262
Bookatze5ec0b42018-03-26 13:34:56 -0700263 // Does the scan have a filter.
264 optional bool is_filtered = 3;
265 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
266 optional bool is_first_match = 4;
267 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
268 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700269}
270
271/**
272 * Logs reporting of a ble scan finding results.
273 *
274 * Logged from:
275 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
276 */
277// TODO: Consider changing to tracking per-scanner-id (log from AppScanStats).
278message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800279 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700280
281 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800282 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700283}
284
285/**
286 * Logs when a sensor state changes.
287 *
288 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700289 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700290 */
291message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800292 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700293
Bookatzc1a050a2017-10-10 15:49:28 -0700294 // The id (int) of the sensor.
295 optional int32 sensor_id = 2;
296
297 enum State {
298 OFF = 0;
299 ON = 1;
300 }
301 optional State state = 3;
302}
303
304
305/**
306 * Logs when GPS state changes.
307 *
308 * Logged from:
309 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
310 */
311message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800312 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700313
314 enum State {
315 OFF = 0;
316 ON = 1;
317 }
318 optional State state = 2;
319}
320
321
322/**
323 * Logs when a sync manager sync state changes.
324 *
325 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700326 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700327 */
328message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800329 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700330
David Chen0b5c90c2018-01-25 16:51:49 -0800331 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800332 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700333
334 enum State {
335 OFF = 0;
336 ON = 1;
337 }
338 optional State state = 3;
339}
340
341/**
342 * Logs when a job scheduler job state changes.
343 *
344 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700345 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700346 */
347message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800348 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700349
350 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800351 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700352
353 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800354 FINISHED = 0;
355 STARTED = 1;
356 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700357 }
358 optional State state = 3;
359
Tej Singh33a412b2018-03-16 18:43:59 -0700360 // The reason a job has stopped.
361 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700362 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700363 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700364}
365
366/**
367 * Logs when the audio state changes.
368 *
369 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700370 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700371 */
372message AudioStateChanged {
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;
Bookatz235343d2018-03-26 13:03:50 -0700378 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
379 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700380 }
381 optional State state = 2;
382}
383
384/**
385 * Logs when the video codec state changes.
386 *
387 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700388 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700389 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800390message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800391 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700392
393 enum State {
394 OFF = 0;
395 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700396 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
397 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700398 }
399 optional State state = 2;
400}
401
402/**
403 * Logs when the flashlight state changes.
404 *
405 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700406 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700407 */
408message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800409 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700410
411 enum State {
412 OFF = 0;
413 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700414 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
415 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700416 }
417 optional State state = 2;
418}
419
420/**
421 * Logs when the camera state changes.
422 *
423 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700424 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700425 */
426message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800427 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700428
429 enum State {
430 OFF = 0;
431 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700432 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
433 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700434 }
435 optional State state = 2;
436}
437
438/**
439 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000440 *
441 * Logged from:
442 * TODO
443 */
Bookatzd6746242017-10-24 18:39:35 -0700444message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800445 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000446
Bookatz1a1b0462018-01-12 11:47:03 -0800447 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
448 // From frameworks/base/core/proto/android/os/enums.proto.
449 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700450
451 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
452 optional string tag = 3;
453
454 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800455 RELEASE = 0;
456 ACQUIRE = 1;
457 CHANGE_RELEASE = 2;
458 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700459 }
460 optional State state = 4;
461}
462
463/**
Bookatzc1a050a2017-10-10 15:49:28 -0700464 * Logs when a partial wakelock is considered 'long' (over 1 min).
465 *
466 * Logged from:
467 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
468 */
469message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800470 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700471
Yao Chend54f9dd2017-10-17 17:37:48 +0000472 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
473 optional string tag = 2;
474
Bookatzc1a050a2017-10-10 15:49:28 -0700475 // TODO: I have no idea what this is.
476 optional string history_tag = 3;
477
478 enum State {
479 OFF = 0;
480 ON = 1;
481 }
482 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000483}
484
Bookatzc1a050a2017-10-10 15:49:28 -0700485/**
486 * Logs Battery Saver state change.
487 *
488 * Logged from:
489 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
490 */
491message BatterySaverModeStateChanged {
492 enum State {
493 OFF = 0;
494 ON = 1;
495 }
496 optional State state = 1;
497}
498
499/**
500 * Logs Doze mode state change.
501 *
502 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800503 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700504 */
505message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800506 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800507}
508
509
510/**
511 * Logs state change of Doze mode including maintenance windows.
512 *
513 * Logged from:
514 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
515 */
516message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800517 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700518}
519
520/**
521 * Logs screen brightness level.
522 *
523 * Logged from:
524 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
525 */
526message ScreenBrightnessChanged {
527 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
528 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700529}
530
531/**
532 * Logs battery level (percent full, from 0 to 100).
533 *
534 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700535 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700536 */
537message BatteryLevelChanged {
538 // Battery level. Should be in [0, 100].
539 optional int32 battery_level = 1;
540}
541
542/**
543 * Logs change in charging status of the device.
544 *
545 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700546 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700547 */
548message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800549 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
550 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700551}
552
553/**
554 * Logs whether the device is plugged in, and what power source it is using.
555 *
556 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700557 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700558 */
559message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800560 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
561 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700562}
563
Bookatz8c6571b2017-10-24 15:04:41 -0700564/**
565 * Logs when an app's wakeup alarm fires.
566 *
567 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700568 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700569 */
570message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800571 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800572
573 // Name of the wakeup alarm.
574 optional string tag = 2;
575}
576
577/**
578 * Logs when an an app causes the mobile radio to change state.
579 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
580 *
581 * Logged from:
582 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
583 */
584message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800585 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800586
Bookatz1a1b0462018-01-12 11:47:03 -0800587 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
588 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800589}
590
591/**
592 * Logs when an an app causes the wifi radio to change state.
593 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
594 *
595 * Logged from:
596 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
597 */
598message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800599 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800600
Bookatz1a1b0462018-01-12 11:47:03 -0800601 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
602 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700603}
604
605/**
606 * Logs kernel wakeup reasons and aborts.
607 *
608 * Logged from:
609 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
610 */
611message KernelWakeupReported {
612 // Name of the kernel wakeup reason (or abort).
613 optional string wakeup_reason_name = 1;
614
615 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800616 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700617}
618
619/**
620 * Logs wifi locks held by an app.
621 *
622 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700623 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700624 */
625message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800626 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700627
628 enum State {
629 OFF = 0;
630 ON = 1;
631 }
632 optional State state = 2;
633}
634
635/**
636 * Logs wifi signal strength changes.
637 *
638 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700639 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700640 */
641message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800642 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
643 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700644}
645
646/**
647 * Logs wifi scans performed by an app.
648 *
649 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700650 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700651 */
652message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800653 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700654
655 enum State {
656 OFF = 0;
657 ON = 1;
658 }
659 optional State state = 2;
660}
661
662/**
Tej Singh4503e102018-01-04 14:35:01 -0800663 * Logs wifi multicast locks held by an app
664 *
665 * Logged from:
666 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
667 */
668message WifiMulticastLockStateChanged {
669 repeated AttributionNode attribution_node = 1;
670
671 enum State {
672 OFF = 0;
673 ON = 1;
674 }
675 optional State state = 2;
676}
677
678/**
Tej Singh1ea42892018-01-19 09:27:00 -0800679 * Logs shutdown reason and duration on next boot.
680 *
681 * Logged from:
682 * frameworks/base/core/java/com/android/server/BootReceiver.java
683 */
684message ShutdownSequenceReported {
685 // True if shutdown is for a reboot. Default: false if we do not know.
686 optional bool reboot = 1;
687
688 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
689 optional string reason = 2;
690
691 // Beginning of shutdown time in ms using wall clock time since unix epoch.
692 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800693 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800694
695 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800696 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800697}
698
Tej Singh6483ea42018-01-25 17:45:49 -0800699
700/**
701 * Logs boot reason and duration.
702 *
703 * Logged from:
704 * system/core/bootstat/bootstat.cpp
705 */
706message BootSequenceReported {
707 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
708 // Default: "<EMPTY>" if not available.
709 optional string bootloader_reason = 1;
710
711 // Reason for system boot. Eg. bootloader, reboot,userrequested
712 // Default: "<EMPTY>" if not available.
713 optional string system_reason = 2;
714
715 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800716 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800717
718 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800719 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800720
721 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800722 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800723
724 // Time since last boot in ms. Default: 0 if not available.
725 optional int64 time_since_last_boot = 6;
726}
727
Tej Singhc477d9c2018-02-05 18:31:39 -0800728
729/**
730 * Logs call state and disconnect cause (if applicable).
731 *
732 * Logged from:
733 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
734 */
735message CallStateChanged {
736 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
737 // From frameworks/base/core/proto/android/telecomm/enums.proto.
738 optional android.telecom.CallStateEnum call_state = 1;
739
740 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
741 // This value is only applicable when the call_state is DISCONNECTED, and
742 // should always be UNKNOWN if the call_state is not DISCONNECTED.
743 // From frameworks/base/core/proto/android/telecomm/enums.proto.
744 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
745
746 // True if the call is self-managed, which are apps that use the
747 // telecom infrastructure to make their own calls.
748 optional bool self_managed = 3;
749
750 // True if call is external. External calls are calls on connected Wear
751 // devices but show up in Telecom so the user can pull them onto the device.
752 optional bool external_call = 4;
753}
754
Tej Singh1ea42892018-01-19 09:27:00 -0800755/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800756 * Logs keyguard state. The keyguard is the lock screen.
757 *
758 * Logged from:
759 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
760 */
761message KeyguardStateChanged {
762 enum State {
763 UNKNOWN = 0;
764 // The keyguard is hidden when the phone is unlocked.
765 HIDDEN = 1;
766 // The keyguard is shown when the phone is locked (screen turns off).
767 SHOWN= 2;
768 // The keyguard is occluded when something is overlaying the keyguard.
769 // Eg. Opening the camera while on the lock screen.
770 OCCLUDED = 3;
771 }
772 optional State state = 1;
773}
774
775/**
776 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
777 * prompts the user to enter a password (pattern, pin, etc).
778 *
779 * Logged from:
780 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
781 */
782
783message KeyguardBouncerStateChanged {
784 enum State {
785 UNKNOWN = 0;
786 // Bouncer is hidden, either as a result of successfully entering the
787 // password, screen timing out, or user going back to lock screen.
788 HIDDEN = 1;
789 // This is when the user is being prompted to enter the password.
790 SHOWN = 2;
791 }
792 optional State state = 1;
793}
794
795/**
796 * Logs the result of entering a password into the keyguard bouncer.
797 *
798 * Logged from:
799 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
800 */
801message KeyguardBouncerPasswordEntered {
802 enum BouncerResult {
803 UNKNOWN = 0;
804 // The password entered was incorrect.
805 FAILURE = 1;
806 // The password entered was correct.
807 SUCCESS = 2;
808 }
809 optional BouncerResult result = 1;
810}
811
Tej Singha883b372018-02-15 11:30:01 -0800812/*
813 * Logs changes to the configuration of the device. The configuration is defined
814 * in frameworks/base/core/java/android/content/res/Configuration.java
815 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
816 * Please go there to interpret the possible values each field can be.
817 *
818 * Logged from:
819 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
820 */
821message ResourceConfigurationChanged {
822 // Bit mask of color capabilities of the screen.
823 // Contains information about the color gamut and hdr mode of the screen.
824 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
825 optional int32 colorMode = 1;
826
827 // The target screen density being rendered to.
828 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
829 optional int32 densityDpi = 2;
830
831 // Current user preference for the scaling factor for fonts,
832 // relative to the base density scaling.
833 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
834 optional float fontScale = 3;
835
836 // Flag indicating whether the hard keyboard is hidden.
837 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
838 optional int32 hardKeyboardHidden = 4;
839
840 // The type of keyboard attached to the device.
841 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
842 optional int32 keyboard = 5;
843
844 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
845 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
846 optional int32 keyboardHideen = 6;
847
848 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
849 // 0 if undefined.
850 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
851 optional int32 mcc = 7;
852
853 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
854 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
855 // MNC_ZERO symbol defined in Configuration.java.
856 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
857 optional int32 mnc = 8;
858
859 // The kind of navigation available on the device.
860 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
861 optional int32 navigation = 9;
862
863 // Flag indicating whether the navigation is available.
864 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
865 optional int32 navigationHidden = 10;
866
867 // Overall orientation of the screen.
868 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
869 optional int32 orientation = 11;
870
871 // The current height of the available screen space, in dp units.
872 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
873 optional int32 screenHeightDp = 12;
874
875 // Bit mask of overall layout of the screen.
876 // Contains information about screen size, whether the screen is wider/taller
877 // than normal, whether the screen layout is right-tl-left or left-to-right,
878 // and whether the screen has a rounded shape.
879 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
880 optional int32 screenLayout = 13;
881
882 // Current width of the available screen space, in dp units.
883 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
884 optional int32 screenWidthDp = 14;
885
886 // The smallest screen size an application will see in normal operation.
887 // This is the smallest value of both screenWidthDp and screenHeightDp
888 // in portrait and landscape.
889 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
890 optional int32 smallestScreenWidthDp = 15;
891
892 // The type of touch screen attached to the device.
893 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
894 optional int32 touchscreen = 16;
895
896 // Bit mask of the ui mode.
897 // Contains information about the overall ui mode of the device.
898 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
899 // Also contains information about whether the device is in night mode.
900 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
901 optional int32 uiMode = 17;
902}
903
Tej Singheee317b2018-03-07 19:28:05 -0800904
905/**
906 * Logs changes in the connection state of the mobile radio.
907 *
908 * Logged from:
909 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
910 */
911message MobileConnectionStateChanged {
912 // States are from the state machine DataConnection.java.
913 enum State {
914 UNKNOWN = 0;
915 // The connection is inactive, or disconnected.
916 INACTIVE = 1;
917 // The connection is being activated, or connecting.
918 ACTIVATING = 2;
919 // The connection is active, or connected.
920 ACTIVE = 3;
921 // The connection is disconnecting.
922 DISCONNECTING = 4;
923 // The connection is disconnecting after creating a connection.
924 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
925 }
926 optional State state = 1;
927 // For multi-sim phones, this distinguishes between the sim cards.
928 optional int32 sim_slot_index = 2;
929 // Used to identify the connection. Starts at 0 and increments by 1 for
930 // every new network created. Resets whenever the device reboots.
931 optional int32 data_connection_id = 3;
932 // A bitmask for the capabilities of this connection.
933 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
934 // Default value (if we have no information): 0
935 optional int64 capabilities = 4;
936 // If this connection has internet.
937 // This just checks if the DEFAULT bit of capabilities is set.
938 optional bool has_internet = 5;
939}
940
941/**
942 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
943 *
944 * Logged from:
945 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
946 */
947message MobileRadioTechnologyChanged {
948 optional android.telephony.NetworkTypeEnum state = 1;
949 // For multi-sim phones, this distinguishes between the sim cards.
950 optional int32 sim_slot_index = 2;
951}
952
Andrew Chantb56388b2018-03-22 21:07:33 -0700953/**
954 * Logs the VID and PID of any connected USB devices.
955 *
956 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
957 *
958 * Logged by Vendor.
959 */
960message UsbDeviceAttached {
961 optional int32 vid = 1;
962 optional int32 pid = 2;
963 optional bool has_audio = 3;
964 optional bool has_hid = 4;
965 optional bool has_storage = 5;
966}
967
Tej Singheee317b2018-03-07 19:28:05 -0800968
Tej Singhdd7bd352018-02-09 19:33:15 -0800969/**
Tej Singh5d991e12018-03-09 19:48:11 -0800970 * Logs when Bluetooth is enabled and disabled.
971 *
972 * Logged from:
973 * services/core/java/com/android/server/BluetoothManagerService.java
974 */
975message BluetoothEnabledStateChanged {
976 repeated AttributionNode attribution_node = 1;
977 // Whether or not bluetooth is enabled on the device.
978 enum State {
979 UNKNOWN = 0;
980 ENABLED = 1;
981 DISABLED = 2;
982 }
983 optional State state = 2;
984 // The reason for being enabled/disabled.
985 // Eg. Airplane mode, crash, application request.
986 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
987 // If the reason is an application request, this will be the package name.
988 optional string pkgName = 4;
989}
990
991/**
992 * Logs when a Bluetooth device connects and disconnects.
993 *
994 * Logged from:
995 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
996 */
997message BluetoothConnectionStateChanged {
998 // The state of the connection.
999 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1000 optional android.bluetooth.ConnectionStateEnum state = 1;
1001 // An identifier that can be used to match connect and disconnect events.
1002 // Currently is last two bytes of a hash of a device level ID and
1003 // the mac address of the bluetooth device that is connected.
1004 optional int32 obfuscated_id = 2;
1005 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1006 // From android.bluetooth.BluetoothAdapter.java
1007 optional int32 bt_profile = 3;
1008}
1009
1010/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001011 * Logs when something is plugged into or removed from the USB-C connector.
1012 *
1013 * Logged from:
1014 * Vendor USB HAL.
1015 */
1016message UsbConnectorStateChanged {
1017 enum State {
1018 DISCONNECTED = 0;
1019 CONNECTED = 1;
1020 }
1021 optional State state = 1;
1022}
1023
1024/**
1025 * Logs the reported speaker impedance.
1026 *
1027 * Logged from:
1028 * Vendor audio implementation.
1029 */
1030message SpeakerImpedanceReported {
1031 optional int32 speaker_location = 1;
1032 optional int32 impedance = 2;
1033}
1034
1035/**
1036 * Logs the report of a failed hardware.
1037 *
1038 * Logged from:
1039 * Vendor HALs.
1040 *
1041 */
1042message HardwareFailed {
1043 enum HardwareType {
1044 HARDWARE_FAILED_UNKNOWN = 0;
1045 HARDWARE_FAILED_MICROPHONE = 1;
1046 HARDWARE_FAILED_CODEC = 2;
1047 HARDWARE_FAILED_SPEAKER = 3;
1048 HARDWARE_FAILED_FINGERPRINT = 4;
1049 }
1050 optional HardwareType hardware_type = 1;
1051
1052 /* hardware_location allows vendors to differentiate between multiple instances of
1053 * the same hardware_type. The specific locations are vendor defined integers,
1054 * referring to board-specific numbering schemes.
1055 */
1056 optional int32 hardware_location = 2;
1057
1058 /* failure_code is specific to the HardwareType of the failed hardware.
1059 * It should use the enum values defined below.
1060 */
1061 enum MicrophoneFailureCode {
1062 MICROPHONE_FAILURE_COMPLETE = 0;
1063 }
1064 enum CodecFailureCode {
1065 CODEC_FAILURE_COMPLETE = 0;
1066 }
1067 enum SpeakerFailureCode {
1068 SPEAKER_FAILURE_COMPLETE = 0;
1069 SPEAKER_FAILURE_HIGH_Z = 1;
1070 SPEAKER_FAILURE_SHORT = 2;
1071 }
1072 enum FingerprintFailureCode {
1073 FINGERPRINT_FAILURE_COMPLETE = 0;
1074 FINGERPRINT_SENSOR_BROKEN = 1;
1075 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1076 }
1077 optional int32 failure_code = 3;
1078}
1079
1080/**
1081 * Log an event when the device has been physically dropped.
1082 * Reported from the /vendor partition.
1083 */
1084message PhysicalDropDetected {
1085 // Confidence that the event was actually a drop, 0 -> 100
1086 optional int32 confidence_pctg = 1;
1087 // Peak acceleration of the drop, in 1/1000s of a g.
1088 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001089 // Duration of freefall in ms
1090 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001091}
1092
1093/**
1094 * Log bucketed battery charge cycles.
1095 *
1096 * Each bucket represents cycles of the battery past
1097 * a given charge point. For example, bucket 1 is the
1098 * lowest 1/8th of the battery, and bucket 8 is 100%.
1099 *
1100 * Logged from:
1101 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1102 */
1103message ChargeCyclesReported {
1104 optional int32 cycle_bucket_1 = 1;
1105 optional int32 cycle_bucket_2 = 2;
1106 optional int32 cycle_bucket_3 = 3;
1107 optional int32 cycle_bucket_4 = 4;
1108 optional int32 cycle_bucket_5 = 5;
1109 optional int32 cycle_bucket_6 = 6;
1110 optional int32 cycle_bucket_7 = 7;
1111 optional int32 cycle_bucket_8 = 8;
1112}
1113
1114/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001115 * Logs the duration of a davey (jank of >=700ms) when it occurs
1116 *
1117 * Logged from:
1118 * frameworks/base/libs/hwui/JankTracker.cpp
1119 */
1120message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001121 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001122 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001123
Tej Singhbb8554a2018-01-26 11:59:14 -08001124 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001125 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001126}
1127
1128/**
Bookatze5885242017-10-24 20:10:31 -07001129 * Logs phone signal strength changes.
1130 *
1131 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001132 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001133 */
1134message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001135 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1136 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001137}
1138
1139/**
1140 * Logs that a setting was updated.
1141 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001142 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001143 * The tag and is_default allow resetting of settings to default values based on the specified
1144 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1145 */
1146message SettingChanged {
1147 // The name of the setting.
1148 optional string setting = 1;
1149
1150 // The change being imposed on this setting. May represent a number, eg "3".
1151 optional string value = 2;
1152
1153 // The new value of this setting. For most settings, this is same as value. For some settings,
1154 // value is +X or -X where X represents an element in a set. For example, if the previous value
1155 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1156 // The +/- feature is currently only used for location_providers_allowed.
1157 optional string new_value = 3;
1158
1159 // The previous value of this setting.
1160 optional string prev_value = 4;
1161
1162 // The tag used with the is_default for resetting sets of settings. This is generally null.
1163 optional string tag = 5;
1164
Bookatz90867622018-01-31 15:05:57 -08001165 // True if this setting with tag should be resettable.
1166 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001167
David Chenbd789912018-03-16 17:19:55 -07001168 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001169 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001170
1171 enum ChangeReason {
1172 UPDATED = 1; // Updated can be an insertion or an update.
1173 DELETED = 2;
1174 }
1175 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001176}
Chenjie Yub3dda412017-10-24 13:41:59 -07001177
Chenjie Yu05013b32017-11-21 10:21:41 -08001178/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001179 * Logs activity going to foreground or background
1180 *
1181 * Logged from:
1182 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1183 */
1184message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001185 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001186 optional string pkg_name = 2;
1187 optional string class_name = 3;
1188
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001189 enum State {
1190 BACKGROUND = 0;
1191 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001192 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001193 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001194}
David Chenc8a43242017-10-17 16:23:28 -07001195
1196/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001197 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001198 * Logged from:
1199 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1200 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001201message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001202 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001203
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001204 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001205
1206 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001207 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001208 optional string process_name = 3;
1209
1210 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001211 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001212
1213 optional string package_name = 5;
1214
1215 enum InstantApp {
1216 UNAVAILABLE = 0;
1217 FALSE = 1;
1218 TRUE = 2;
1219 }
1220 optional InstantApp is_instant_app = 6;
1221
1222 enum ForegroundState {
1223 UNKNOWN = 0;
1224 BACKGROUND = 1;
1225 FOREGROUND = 2;
1226 }
1227 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001228}
David Chen9e3808c2017-11-20 17:25:34 -08001229
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001230/**
1231 * Logs when a WTF (What a Terrible Failure) happened.
1232 * Logged from:
1233 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1234 */
1235message WTFOccurred {
1236 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001237
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001238 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001239
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001240 // The name of the process.
1241 // system_server if it is not by an app
1242 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001243
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001244 // The pid if available. -1 means not available.
1245 optional sint32 pid = 4;
1246}
1247
1248/**
1249 * Logs when system server reports low memory.
1250 * Logged from:
1251 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1252 */
1253message LowMemReported {
1254}
1255
1256/**
1257 * Logs when an app ANR (App Not Responding) occurs.
1258 * Logged from:
1259 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1260 */
1261message ANROccurred {
1262 optional int32 uid = 1 [(is_uid) = true];
1263
1264 optional string process_name = 2;
1265
1266 optional string short_component_name = 3;
1267
1268 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001269
1270 enum InstantApp {
1271 UNAVAILABLE = 0;
1272 FALSE = 1;
1273 TRUE = 2;
1274 }
1275 optional InstantApp is_instant_app = 5;
1276
1277 enum ForegroundState {
1278 UNKNOWN = 0;
1279 BACKGROUND = 1;
1280 FOREGROUND = 2;
1281 }
1282 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08001283}
1284
David Chen0a368b22017-12-06 16:28:16 -08001285/*
1286 * Allows other apps to push events into statsd.
1287 * Logged from:
1288 * frameworks/base/core/java/android/util/StatsLog.java
1289 */
David Chen0b5c90c2018-01-25 16:51:49 -08001290message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001291 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001292 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001293
1294 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1295 optional int32 label = 2;
1296
1297 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1298 // predicates for the metrics).
1299 enum State {
1300 UNKNOWN = 0;
1301 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1302 STOP = 2;
1303 START = 3;
1304 }
1305 optional State state = 3;
1306}
1307
David Chen9e3808c2017-11-20 17:25:34 -08001308/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001309 * Logs when statsd detects an anomaly.
1310 *
1311 * Logged from:
1312 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1313 */
1314message AnomalyDetected {
1315 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001316 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001317
Yangster-mac94e197c2018-01-02 16:03:03 -08001318 // Id of the config whose anomaly detection alert fired.
1319 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001320
Yangster-mac94e197c2018-01-02 16:03:03 -08001321 // Id of the alert (i.e. name of the anomaly that was detected).
1322 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001323}
1324
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001325message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001326 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001327 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001328
1329 // The app package name.
1330 optional string pkg_name = 2;
1331
1332 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001333 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001334 WARM = 1;
1335 HOT = 2;
1336 COLD = 3;
1337 }
1338 // The transition type.
1339 optional TransitionType type = 3;
1340
1341 // The activity name.
1342 optional string activity_name = 4;
1343
1344 // The name of the calling app. Empty if not set.
1345 optional string calling_pkg_name = 5;
1346
1347 // Whether the app is an instant app.
1348 optional bool is_instant_app = 6;
1349
1350 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001351 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001352
Bookatz80d11a02018-01-16 10:46:35 -08001353 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001354
David Chen0b5c90c2018-01-25 16:51:49 -08001355 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001356 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001357 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001358 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001359 optional int32 bind_application_delay_millis = 11;
1360 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001361
1362 // Empty if not set.
1363 optional string launch_token = 13;
1364
Calin Juravle759fbda2018-02-20 19:52:30 +00001365 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001366 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001367
1368 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001369 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001370}
1371
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001372message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001373 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001374 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001375
1376 // The app package name.
1377 optional string pkg_name = 2;
1378
1379 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001380 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001381 WARM = 1;
1382 HOT = 2;
1383 COLD = 3;
1384 }
1385 // The transition type.
1386 optional TransitionType type = 3;
1387
1388 // The activity name.
1389 optional string activity_name = 4;
1390}
1391
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001392message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001393 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001394 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001395
1396 // The app package name.
1397 optional string pkg_name = 2;
1398
1399 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001400 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001401 WITH_BUNDLE = 1;
1402 WITHOUT_BUNDLE = 2;
1403 }
1404 // The transition type.
1405 optional TransitionType type = 3;
1406
1407 // The activity name.
1408 optional string activity_name = 4;
1409
1410 optional bool transition_process_running = 5;
1411
1412 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001413 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001414}
1415
Bookatz8fcd09a2017-12-18 13:01:10 -08001416/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001417 * Logs a picture-in-picture action
1418 * Logged from:
1419 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1420 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1421 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1422 */
1423message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001424 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001425 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001426
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001427 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001428
Chenjie Yu52cacc62017-12-08 18:11:45 -08001429 enum State {
1430 ENTERED = 1;
1431 EXPANDED_TO_FULL_SCREEN = 2;
1432 MINIMIZED = 3;
1433 DISMISSED = 4;
1434 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001435 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001436}
1437
1438/**
Chenjie Yue8904192017-12-08 19:12:57 -08001439 * Logs overlay action
1440 * Logged from:
1441 * services/core/java/com/android/server/wm/Session.java
1442 */
1443message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001444 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001445
1446 optional string package_name = 2;
1447
1448 optional bool using_alert_window = 3;
1449
1450 enum State {
1451 ENTERED = 1;
1452 EXITED = 2;
1453 }
1454 optional State state = 4;
1455}
1456
Chenjie Yuccfe6452018-01-30 11:33:21 -08001457/*
1458 * Logs foreground service starts and stops.
1459 * Note that this is not when a service starts or stops, but when it is
1460 * considered foreground.
1461 * Logged from
1462 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1463 */
1464message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001465 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001466 // package_name + "/" + class_name
1467 optional string short_name = 2;
1468
1469 enum State {
1470 ENTER = 1;
1471 EXIT = 2;
1472 }
1473 optional State state = 3;
1474}
1475
Chenjie Yue8904192017-12-08 19:12:57 -08001476/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001477 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1478 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1479 * attributed back to the parent (host) uid. One example is Chrome.
1480 *
1481 * Logged from:
1482 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1483 */
1484message IsolatedUidChanged {
1485 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001486 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001487 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001488 optional int32 parent_uid = 1;
1489
1490 optional int32 isolated_uid = 2;
1491
1492 // We expect an isolated uid to be removed before if it's used for another parent uid.
1493 enum Event {
1494 REMOVED = 0;
1495 CREATED = 1;
1496 }
1497 optional Event event = 3;
1498}
1499
1500/*
1501 * Logs the reception of an incoming network packet causing the main system to wake up for
1502 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1503 * and processed by WakeupController.cpp.
1504 */
1505message PacketWakeupOccurred {
1506 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1507 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001508 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001509 // The interface name on which the packet was received.
1510 optional string iface = 2;
1511 // The ethertype value of the packet.
1512 optional int32 ethertype = 3;
1513 // String representation of the destination MAC address of the packet.
1514 optional string destination_hardware_address = 4;
1515 // String representation of the source address of the packet if this was an IP packet.
1516 optional string source_ip = 5;
1517 // String representation of the destination address of the packet if this was an IP packet.
1518 optional string destination_ip = 6;
1519 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1520 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1521 // families.
1522 optional int32 ip_next_header = 7;
1523 // The source port if this was a TCP or UDP packet.
1524 optional int32 source_port = 8;
1525 // The destination port if this was a TCP or UDP packet.
1526 optional int32 destination_port = 9;
1527}
1528
1529/*
1530 * Logs the memory stats for an app on startup.
1531 * Logged from:
1532 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1533 */
1534message AppStartMemoryStateCaptured {
1535 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001536 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001537
1538 // The process name.
1539 optional string process_name = 2;
1540
1541 // The activity name.
1542 optional string activity_name = 3;
1543
1544 // # of page-faults
1545 optional int64 pgfault = 4;
1546
1547 // # of major page-faults
1548 optional int64 pgmajfault = 5;
1549
1550 // RSS
1551 optional int64 rss_in_bytes = 6;
1552
1553 // CACHE
1554 optional int64 cache_in_bytes = 7;
1555
1556 // SWAP
1557 optional int64 swap_in_bytes = 8;
1558}
1559
1560/*
1561 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1562 * for LMK event.
1563 * Logged from:
1564 * system/core/lmkd/lmkd.c
1565 */
1566message LmkStateChanged {
1567 enum State {
1568 UNKNOWN = 0;
1569 START = 1;
1570 STOP = 2;
1571 }
1572 optional State state = 1;
1573}
1574
1575/*
1576 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1577 * Logged from:
1578 * system/core/lmkd/lmkd.c
1579 */
1580message LmkKillOccurred {
1581 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001582 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001583
1584 // The process name.
1585 optional string process_name = 2;
1586
1587 // oom adj score.
1588 optional int32 oom_score = 3;
1589
1590 // # of page-faults
1591 optional int64 pgfault = 4;
1592
1593 // # of major page-faults
1594 optional int64 pgmajfault = 5;
1595
1596 // RSS
1597 optional int64 rss_in_bytes = 6;
1598
1599 // CACHE
1600 optional int64 cache_in_bytes = 7;
1601
1602 // SWAP
1603 optional int64 swap_in_bytes = 8;
1604}
1605
Rajeev Kumar51b54602018-03-01 12:18:26 -08001606/*
1607 * Logs when the ActivityManagerService detects that an app died.
1608 *
1609 * Logged from:
1610 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1611 */
1612message AppDied {
1613 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07001614 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08001615}
1616
Chenjie Yubbcbc602018-02-05 16:51:52 -08001617//////////////////////////////////////////////////////////////////////
1618// Pulled atoms below this line //
1619//////////////////////////////////////////////////////////////////////
1620
1621/**
David Chenc8a43242017-10-17 16:23:28 -07001622 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
1623 *
1624 * Pulled from:
1625 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1626 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001627message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001628 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001629
1630 optional int64 rx_bytes = 2;
1631
1632 optional int64 rx_packets = 3;
1633
1634 optional int64 tx_bytes = 4;
1635
1636 optional int64 tx_packets = 5;
1637}
1638
1639/**
1640 * Pulls bytes transferred via wifi (separated by foreground and background usage).
1641 *
1642 * Pulled from:
1643 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1644 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001645message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001646 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001647
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001648 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
1649 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07001650
1651 optional int64 rx_bytes = 3;
1652
1653 optional int64 rx_packets = 4;
1654
1655 optional int64 tx_bytes = 5;
1656
1657 optional int64 tx_packets = 6;
1658}
1659
1660/**
1661 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
1662 *
1663 * Pulled from:
1664 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1665 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001666message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001667 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001668
1669 optional int64 rx_bytes = 2;
1670
1671 optional int64 rx_packets = 3;
1672
1673 optional int64 tx_bytes = 4;
1674
1675 optional int64 tx_packets = 5;
1676}
1677
1678/**
1679 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
1680 *
1681 * Pulled from:
1682 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1683 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001684message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001685 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001686
Yao Chenc40a19d2018-03-15 16:48:25 -07001687 // 1 denotes foreground and 0 denotes background. This is called Set in
1688 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001689 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07001690
1691 optional int64 rx_bytes = 3;
1692
1693 optional int64 rx_packets = 4;
1694
1695 optional int64 tx_bytes = 5;
1696
1697 optional int64 tx_packets = 6;
1698}
1699
1700/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001701 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
1702 *
1703 * Pulled from:
1704 * StatsCompanionService
1705 */
1706message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001707 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001708
1709 optional int64 rx_bytes = 2;
1710
1711 optional int64 tx_bytes = 3;
1712}
1713
1714/**
David Chenc8a43242017-10-17 16:23:28 -07001715 * Pulls the kernel wakelock durations. This atom is adapted from
1716 * android/internal/os/KernelWakelockStats.java
1717 *
1718 * Pulled from:
1719 * StatsCompanionService using KernelWakelockReader.
1720 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001721message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07001722 optional string name = 1;
1723
1724 optional int32 count = 2;
1725
1726 optional int32 version = 3;
1727
1728 optional int64 time = 4;
1729}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001730
Chenjie Yu05013b32017-11-21 10:21:41 -08001731/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001732 * Pulls low power state information. This includes platform and subsystem sleep state information,
1733 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001734 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001735 * hardware/interfaces/power/1.1/types.hal
1736 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001737message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08001738 // Subsystem name
1739 optional string subsystem_name = 1;
1740 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
1741 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
1742 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001743 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08001744 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001745 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08001746 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07001747}
Chenjie Yu7f8def92017-11-03 09:33:15 -07001748
Chenjie Yu05013b32017-11-21 10:21:41 -08001749/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07001750 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08001751 * Pulls the time the cpu spend on the frequency index. Frequency index
1752 * starts from highest to lowest. The value should be monotonically
1753 * increasing since boot. However, if there is a cpu
1754 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07001755 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001756message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07001757 optional uint32 cluster = 1;
1758 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001759 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07001760}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001761
Chenjie Yu05013b32017-11-21 10:21:41 -08001762/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001763 * Pulls Cpu Time Per Uid.
1764 * Note that isolated process uid time should be attributed to host uids.
1765 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001766message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07001767 optional int32 uid = 1 [(is_uid) = true];
David Chen0b5c90c2018-01-25 16:51:49 -08001768 optional uint64 user_time_millis = 2;
1769 optional uint64 sys_time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001770}
1771
1772/**
1773 * Pulls Cpu Time Per Uid per frequency.
1774 * Note that isolated process uid time should be attributed to host uids.
1775 * For each uid, we order the time by descending frequencies.
1776 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001777message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07001778 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001779 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001780 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001781}
Hugo Benichi884970e2017-11-14 22:42:46 +09001782
Chenjie Yu05013b32017-11-21 10:21:41 -08001783/**
1784 * Pulls Wifi Controller Activity Energy Info
1785 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001786message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001787 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001788 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001789 // stack reported state
1790 // TODO: replace this with proto enum
1791 optional int32 stack_state = 2;
1792 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001793 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001794 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001795 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001796 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001797 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001798 // product of current(mA), voltage(V) and time(ms)
1799 optional uint64 controller_energy_used = 6;
1800}
1801
1802/**
1803 * Pulls Modem Activity Energy Info
1804 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001805message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001806 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001807 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001808 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001809 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08001810 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001811 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001812 /**
1813 * Tx power index
1814 * index 0 = tx_power < 0dBm
1815 * index 1 = 0dBm < tx_power < 5dBm
1816 * index 2 = 5dBm < tx_power < 15dBm
1817 * index 3 = 15dBm < tx_power < 20dBm
1818 * index 4 = tx_power > 20dBm
1819 */
1820 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08001821 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001822 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08001823 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001824 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08001825 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08001826 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08001827 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08001828 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08001829 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08001830 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08001831 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08001832 // product of current(mA), voltage(V) and time(ms)
1833 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08001834}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001835
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001836/**
1837 * Pulls Bluetooth Activity Energy Info
1838 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
1839 */
1840message BluetoothActivityInfo {
1841 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001842 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001843 // bluetooth stack state
1844 optional int32 bluetooth_stack_state = 2;
1845 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001846 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001847 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001848 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001849 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001850 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001851 // product of current(mA), voltage(V) and time(ms)
1852 optional uint64 energy_used = 6;
1853}
1854
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001855/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001856 * Logs the memory stats for a process.
1857 */
1858message ProcessMemoryState {
1859 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001860 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001861
1862 // The process name.
1863 optional string process_name = 2;
1864
1865 // oom adj score.
1866 optional int32 oom_score = 3;
1867
1868 // # of page-faults
1869 optional int64 pgfault = 4;
1870
1871 // # of major page-faults
1872 optional int64 pgmajfault = 5;
1873
Rajeev Kumar90235992018-01-29 11:06:48 -08001874 // RSS
1875 optional int64 rss_in_bytes = 6;
1876
1877 // CACHE
1878 optional int64 cache_in_bytes = 7;
1879
1880 // SWAP
1881 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001882}
1883
1884/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001885 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001886 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001887message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08001888 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001889}
1890
1891/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001892 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001893 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001894message SystemUptime {
1895 // Milliseconds since the system was booted.
1896 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
1897 // for external input).
1898 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08001899 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001900}
1901
1902/*
1903 * Reads from /proc/uid_concurrent_active_time which has the format:
1904 * active: X (X is # cores)
1905 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
1906 * [uid1]: [time-0] [time-1] [time-2] ... ...
1907 * ...
1908 * Time-N means the CPU time a UID spent running concurrently with N other processes.
1909 * The file contains a monotonically increasing count of time for a single boot.
1910 */
1911message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07001912 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001913 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001914}
1915
1916/**
1917 * Reads from /proc/uid_concurrent_policy_time which has the format:
1918 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
1919 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1920 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1921 * ...
1922 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
1923 * The file contains a monotonically increasing count of time for a single boot.
1924 */
1925message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07001926 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001927 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001928 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08001929}
1930
1931/*
1932 * Pulls free disk space, for data, system partition and temporary directory.
1933 */
1934message DiskSpace {
1935 // available bytes in data partition
1936 optional uint64 data_available_bytes = 1;
1937 // available bytes in system partition
1938 optional uint64 system_available_bytes = 2;
1939 // available bytes in download cache or temp directories
1940 optional uint64 temp_available_bytes = 3;
1941}
Tej Singhbf972d92018-01-10 20:51:13 -08001942
1943/**
1944 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08001945 * Pulled from:
1946 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08001947 */
1948message RemainingBatteryCapacity {
1949 optional int32 charge_uAh = 1;
1950}
1951
1952/**
1953 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08001954 * Pulled from:
1955 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08001956 */
1957message FullBatteryCapacity {
1958 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08001959}
1960
1961/**
Tej Singhd89137e2018-03-26 14:51:40 -07001962 * Pulls the temperature of various parts of the device.
1963 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08001964 *
1965 * Pulled from:
1966 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
1967 */
1968message Temperature {
1969 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
1970 optional android.os.TemperatureTypeEnum sensor_location = 1;
1971
1972 // The name of the temperature source. Eg. CPU0
1973 optional string sensor_name = 2;
1974
Tej Singhd89137e2018-03-26 14:51:40 -07001975 // Temperature in tenths of a degree C.
1976 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08001977}