blob: 18aa0d06d6dcdda9ff115e3f495255655703f265 [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;
Yangster-mac80c44742018-08-26 12:20:16 -0700124 ThermalThrottlingStateChanged thermal_throttling = 86;
Yao Chend54f9dd2017-10-17 17:37:48 +0000125 }
David Chenc8a43242017-10-17 16:23:28 -0700126
David Chen6e3e6cb2018-01-03 16:14:06 -0800127 // Pulled events will start at field 10000.
Tej Singh40298312018-02-16 00:15:09 -0800128 // Next: 10022
David Chenc8a43242017-10-17 16:23:28 -0700129 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800130 WifiBytesTransfer wifi_bytes_transfer = 10000;
131 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
132 MobileBytesTransfer mobile_bytes_transfer = 10002;
133 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800134 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800135 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800136 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800137 CpuTimePerFreq cpu_time_per_freq = 10008;
138 CpuTimePerUid cpu_time_per_uid = 10009;
139 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800140 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800141 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800142 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800143 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800144 SystemElapsedRealtime system_elapsed_realtime = 10014;
145 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800146 CpuActiveTime cpu_active_time = 10016;
147 CpuClusterTime cpu_cluster_time = 10017;
Chenjie Yu937d7422018-01-10 16:37:53 -0800148 DiskSpace disk_space = 10018;
Tej Singhbf972d92018-01-10 20:51:13 -0800149 RemainingBatteryCapacity remaining_battery_capacity = 10019;
150 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800151 Temperature temperature = 10021;
David Chenc8a43242017-10-17 16:23:28 -0700152 }
yroa1fe77c2018-02-26 14:22:54 -0800153
154 // DO NOT USE field numbers above 100,000 in AOSP. Field numbers above
155 // 100,000 are reserved for non-AOSP (e.g. OEMs) to use.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700156}
157
Yao Chend54f9dd2017-10-17 17:37:48 +0000158/**
Yangster-mac20877162017-12-22 17:19:39 -0800159 * This proto represents a node of an attribution chain.
160 * Note: All attribution chains are represented as a repeated field of type
161 * AttributionNode. It is understood that in such arrays, the order is that
162 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000163 */
Yangster-mac20877162017-12-22 17:19:39 -0800164message AttributionNode {
165 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800166 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800167
Yangster-mac20877162017-12-22 17:19:39 -0800168 // The (optional) string tag for an element in the attribution chain. If the
169 // element has no tag, it is encoded as an empty string.
170 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700171}
172
Yao Chend54f9dd2017-10-17 17:37:48 +0000173/*
174 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800175 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000176 *
177 * RULES:
178 * - The field ids for each atom must start at 1, and count upwards by 1.
179 * Skipping field ids is not allowed.
180 * - These form an API, so renaming, renumbering or removing fields is
181 * not allowed between android releases. (This is not currently enforced,
182 * but there will be a tool to enforce this restriction).
183 * - The types must be built-in protocol buffer types, namely, no sub-messages
184 * are allowed (yet). The bytes type is also not allowed.
185 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800186 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000187 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800188 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000189 * - A field that is a uid should be a string field, tagged with the [xxx]
190 * annotation. The generated code on android will be represented by UIDs,
191 * and those UIDs will be translated in xxx to those strings.
192 *
193 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700194 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000195 * - If there is a UID, it goes first. Think in an object-oriented fashion.
196 * *****************************************************************************
197 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700198
Yao Chend54f9dd2017-10-17 17:37:48 +0000199/**
Yangster-mac80c44742018-08-26 12:20:16 -0700200 * Logs when the Thermal service HAL notifies the throttling start/stop events.
201 *
202 * Logged from:
203 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
204 */
205message ThermalThrottlingStateChanged {
206 optional android.os.TemperatureTypeEnum sensor_type = 1;
207
208 enum State {
209 UNKNOWN = 0;
210 START = 1;
211 STOP = 2;
212 }
213
214 optional State state = 2;
215
216 optional float temperature = 3;
217}
218
219/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000220 * Logs when the screen state changes.
221 *
222 * Logged from:
223 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
224 */
225message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800226 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800227 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700228}
Yao Chend54f9dd2017-10-17 17:37:48 +0000229
230/**
Bookatzc1a050a2017-10-10 15:49:28 -0700231 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000232 *
233 * Logged from:
234 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
235 */
Bookatzc1a050a2017-10-10 15:49:28 -0700236message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700237 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000238
Bookatzdb026a22018-01-10 19:01:56 -0800239 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800240 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000241}
242
243/**
Bookatzc1a050a2017-10-10 15:49:28 -0700244 * Logs that a process started, finished, crashed, or ANRed.
245 *
246 * Logged from:
247 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
248 */
249message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700250 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700251
David Chen0b5c90c2018-01-25 16:51:49 -0800252 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800253 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700254
Bookatzddccf0a2017-11-28 16:48:14 -0800255 // What lifecycle state the process changed to.
256 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800257 enum State {
258 FINISHED = 0;
259 STARTED = 1;
260 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800261 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800262 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700263}
264
Bookatzc1a050a2017-10-10 15:49:28 -0700265/**
266 * Logs when the ble scan state changes.
267 *
268 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700269 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700270 */
271message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800272 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700273
274 enum State {
275 OFF = 0;
276 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700277 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
278 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700279 }
280 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700281
Bookatze5ec0b42018-03-26 13:34:56 -0700282 // Does the scan have a filter.
283 optional bool is_filtered = 3;
284 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
285 optional bool is_first_match = 4;
286 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
287 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700288}
289
290/**
291 * Logs reporting of a ble scan finding results.
292 *
293 * Logged from:
294 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
295 */
296// TODO: Consider changing to tracking per-scanner-id (log from AppScanStats).
297message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800298 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700299
300 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800301 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700302}
303
304/**
305 * Logs when a sensor state changes.
306 *
307 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700308 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700309 */
310message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800311 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700312
Bookatzc1a050a2017-10-10 15:49:28 -0700313 // The id (int) of the sensor.
314 optional int32 sensor_id = 2;
315
316 enum State {
317 OFF = 0;
318 ON = 1;
319 }
320 optional State state = 3;
321}
322
323
324/**
325 * Logs when GPS state changes.
326 *
327 * Logged from:
328 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
329 */
330message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800331 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700332
333 enum State {
334 OFF = 0;
335 ON = 1;
336 }
337 optional State state = 2;
338}
339
340
341/**
342 * Logs when a sync manager sync 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 SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800348 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700349
David Chen0b5c90c2018-01-25 16:51:49 -0800350 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800351 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700352
353 enum State {
354 OFF = 0;
355 ON = 1;
356 }
357 optional State state = 3;
358}
359
360/**
361 * Logs when a job scheduler job state changes.
362 *
363 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700364 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700365 */
366message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800367 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700368
369 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800370 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700371
372 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800373 FINISHED = 0;
374 STARTED = 1;
375 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700376 }
377 optional State state = 3;
378
Tej Singh33a412b2018-03-16 18:43:59 -0700379 // The reason a job has stopped.
380 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700381 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700382 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700383}
384
385/**
386 * Logs when the audio state changes.
387 *
388 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700389 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700390 */
391message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800392 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700393
394 enum State {
395 OFF = 0;
396 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700397 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
398 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700399 }
400 optional State state = 2;
401}
402
403/**
404 * Logs when the video codec state changes.
405 *
406 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700407 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700408 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800409message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800410 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700411
412 enum State {
413 OFF = 0;
414 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700415 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
416 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700417 }
418 optional State state = 2;
419}
420
421/**
422 * Logs when the flashlight state changes.
423 *
424 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700425 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700426 */
427message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800428 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700429
430 enum State {
431 OFF = 0;
432 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700433 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
434 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700435 }
436 optional State state = 2;
437}
438
439/**
440 * Logs when the camera state changes.
441 *
442 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700443 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700444 */
445message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800446 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700447
448 enum State {
449 OFF = 0;
450 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700451 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
452 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700453 }
454 optional State state = 2;
455}
456
457/**
458 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000459 *
460 * Logged from:
461 * TODO
462 */
Bookatzd6746242017-10-24 18:39:35 -0700463message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800464 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000465
Bookatz1a1b0462018-01-12 11:47:03 -0800466 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
467 // From frameworks/base/core/proto/android/os/enums.proto.
468 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700469
470 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
471 optional string tag = 3;
472
473 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800474 RELEASE = 0;
475 ACQUIRE = 1;
476 CHANGE_RELEASE = 2;
477 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700478 }
479 optional State state = 4;
480}
481
482/**
Bookatzc1a050a2017-10-10 15:49:28 -0700483 * Logs when a partial wakelock is considered 'long' (over 1 min).
484 *
485 * Logged from:
486 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
487 */
488message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800489 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700490
Yao Chend54f9dd2017-10-17 17:37:48 +0000491 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
492 optional string tag = 2;
493
Bookatzc1a050a2017-10-10 15:49:28 -0700494 // TODO: I have no idea what this is.
495 optional string history_tag = 3;
496
497 enum State {
498 OFF = 0;
499 ON = 1;
500 }
501 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000502}
503
Bookatzc1a050a2017-10-10 15:49:28 -0700504/**
505 * Logs Battery Saver state change.
506 *
507 * Logged from:
508 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
509 */
510message BatterySaverModeStateChanged {
511 enum State {
512 OFF = 0;
513 ON = 1;
514 }
515 optional State state = 1;
516}
517
518/**
519 * Logs Doze mode state change.
520 *
521 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800522 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700523 */
524message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800525 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800526}
527
528
529/**
530 * Logs state change of Doze mode including maintenance windows.
531 *
532 * Logged from:
533 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
534 */
535message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800536 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700537}
538
539/**
540 * Logs screen brightness level.
541 *
542 * Logged from:
543 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
544 */
545message ScreenBrightnessChanged {
546 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
547 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700548}
549
550/**
551 * Logs battery level (percent full, from 0 to 100).
552 *
553 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700554 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700555 */
556message BatteryLevelChanged {
557 // Battery level. Should be in [0, 100].
558 optional int32 battery_level = 1;
559}
560
561/**
562 * Logs change in charging status of the device.
563 *
564 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700565 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700566 */
567message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800568 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
569 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700570}
571
572/**
573 * Logs whether the device is plugged in, and what power source it is using.
574 *
575 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700576 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700577 */
578message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800579 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
580 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700581}
582
Bookatz8c6571b2017-10-24 15:04:41 -0700583/**
584 * Logs when an app's wakeup alarm fires.
585 *
586 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700587 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700588 */
589message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800590 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800591
592 // Name of the wakeup alarm.
593 optional string tag = 2;
594}
595
596/**
597 * Logs when an an app causes the mobile radio to change state.
598 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
599 *
600 * Logged from:
601 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
602 */
603message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800604 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800605
Bookatz1a1b0462018-01-12 11:47:03 -0800606 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
607 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800608}
609
610/**
611 * Logs when an an app causes the wifi radio to change state.
612 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
613 *
614 * Logged from:
615 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
616 */
617message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800618 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800619
Bookatz1a1b0462018-01-12 11:47:03 -0800620 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
621 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700622}
623
624/**
625 * Logs kernel wakeup reasons and aborts.
626 *
627 * Logged from:
628 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
629 */
630message KernelWakeupReported {
631 // Name of the kernel wakeup reason (or abort).
632 optional string wakeup_reason_name = 1;
633
634 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800635 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700636}
637
638/**
639 * Logs wifi locks held by an app.
640 *
641 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700642 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700643 */
644message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800645 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700646
647 enum State {
648 OFF = 0;
649 ON = 1;
650 }
651 optional State state = 2;
652}
653
654/**
655 * Logs wifi signal strength changes.
656 *
657 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700658 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700659 */
660message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800661 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
662 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700663}
664
665/**
666 * Logs wifi scans performed by an app.
667 *
668 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700669 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700670 */
671message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800672 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700673
674 enum State {
675 OFF = 0;
676 ON = 1;
677 }
678 optional State state = 2;
679}
680
681/**
Tej Singh4503e102018-01-04 14:35:01 -0800682 * Logs wifi multicast locks held by an app
683 *
684 * Logged from:
685 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
686 */
687message WifiMulticastLockStateChanged {
688 repeated AttributionNode attribution_node = 1;
689
690 enum State {
691 OFF = 0;
692 ON = 1;
693 }
694 optional State state = 2;
695}
696
697/**
Tej Singh1ea42892018-01-19 09:27:00 -0800698 * Logs shutdown reason and duration on next boot.
699 *
700 * Logged from:
701 * frameworks/base/core/java/com/android/server/BootReceiver.java
702 */
703message ShutdownSequenceReported {
704 // True if shutdown is for a reboot. Default: false if we do not know.
705 optional bool reboot = 1;
706
707 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
708 optional string reason = 2;
709
710 // Beginning of shutdown time in ms using wall clock time since unix epoch.
711 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800712 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800713
714 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800715 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800716}
717
Tej Singh6483ea42018-01-25 17:45:49 -0800718
719/**
720 * Logs boot reason and duration.
721 *
722 * Logged from:
723 * system/core/bootstat/bootstat.cpp
724 */
725message BootSequenceReported {
726 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
727 // Default: "<EMPTY>" if not available.
728 optional string bootloader_reason = 1;
729
730 // Reason for system boot. Eg. bootloader, reboot,userrequested
731 // Default: "<EMPTY>" if not available.
732 optional string system_reason = 2;
733
734 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800735 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800736
737 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800738 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800739
740 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800741 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800742
743 // Time since last boot in ms. Default: 0 if not available.
744 optional int64 time_since_last_boot = 6;
745}
746
Tej Singhc477d9c2018-02-05 18:31:39 -0800747
748/**
749 * Logs call state and disconnect cause (if applicable).
750 *
751 * Logged from:
752 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
753 */
754message CallStateChanged {
755 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
756 // From frameworks/base/core/proto/android/telecomm/enums.proto.
757 optional android.telecom.CallStateEnum call_state = 1;
758
759 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
760 // This value is only applicable when the call_state is DISCONNECTED, and
761 // should always be UNKNOWN if the call_state is not DISCONNECTED.
762 // From frameworks/base/core/proto/android/telecomm/enums.proto.
763 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
764
765 // True if the call is self-managed, which are apps that use the
766 // telecom infrastructure to make their own calls.
767 optional bool self_managed = 3;
768
769 // True if call is external. External calls are calls on connected Wear
770 // devices but show up in Telecom so the user can pull them onto the device.
771 optional bool external_call = 4;
772}
773
Tej Singh1ea42892018-01-19 09:27:00 -0800774/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800775 * Logs keyguard state. The keyguard is the lock screen.
776 *
777 * Logged from:
778 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
779 */
780message KeyguardStateChanged {
781 enum State {
782 UNKNOWN = 0;
783 // The keyguard is hidden when the phone is unlocked.
784 HIDDEN = 1;
785 // The keyguard is shown when the phone is locked (screen turns off).
786 SHOWN= 2;
787 // The keyguard is occluded when something is overlaying the keyguard.
788 // Eg. Opening the camera while on the lock screen.
789 OCCLUDED = 3;
790 }
791 optional State state = 1;
792}
793
794/**
795 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
796 * prompts the user to enter a password (pattern, pin, etc).
797 *
798 * Logged from:
799 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
800 */
801
802message KeyguardBouncerStateChanged {
803 enum State {
804 UNKNOWN = 0;
805 // Bouncer is hidden, either as a result of successfully entering the
806 // password, screen timing out, or user going back to lock screen.
807 HIDDEN = 1;
808 // This is when the user is being prompted to enter the password.
809 SHOWN = 2;
810 }
811 optional State state = 1;
812}
813
814/**
815 * Logs the result of entering a password into the keyguard bouncer.
816 *
817 * Logged from:
818 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
819 */
820message KeyguardBouncerPasswordEntered {
821 enum BouncerResult {
822 UNKNOWN = 0;
823 // The password entered was incorrect.
824 FAILURE = 1;
825 // The password entered was correct.
826 SUCCESS = 2;
827 }
828 optional BouncerResult result = 1;
829}
830
Tej Singha883b372018-02-15 11:30:01 -0800831/*
832 * Logs changes to the configuration of the device. The configuration is defined
833 * in frameworks/base/core/java/android/content/res/Configuration.java
834 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
835 * Please go there to interpret the possible values each field can be.
836 *
837 * Logged from:
838 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
839 */
840message ResourceConfigurationChanged {
841 // Bit mask of color capabilities of the screen.
842 // Contains information about the color gamut and hdr mode of the screen.
843 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
844 optional int32 colorMode = 1;
845
846 // The target screen density being rendered to.
847 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
848 optional int32 densityDpi = 2;
849
850 // Current user preference for the scaling factor for fonts,
851 // relative to the base density scaling.
852 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
853 optional float fontScale = 3;
854
855 // Flag indicating whether the hard keyboard is hidden.
856 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
857 optional int32 hardKeyboardHidden = 4;
858
859 // The type of keyboard attached to the device.
860 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
861 optional int32 keyboard = 5;
862
863 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
864 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
865 optional int32 keyboardHideen = 6;
866
867 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
868 // 0 if undefined.
869 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
870 optional int32 mcc = 7;
871
872 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
873 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
874 // MNC_ZERO symbol defined in Configuration.java.
875 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
876 optional int32 mnc = 8;
877
878 // The kind of navigation available on the device.
879 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
880 optional int32 navigation = 9;
881
882 // Flag indicating whether the navigation is available.
883 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
884 optional int32 navigationHidden = 10;
885
886 // Overall orientation of the screen.
887 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
888 optional int32 orientation = 11;
889
890 // The current height of the available screen space, in dp units.
891 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
892 optional int32 screenHeightDp = 12;
893
894 // Bit mask of overall layout of the screen.
895 // Contains information about screen size, whether the screen is wider/taller
896 // than normal, whether the screen layout is right-tl-left or left-to-right,
897 // and whether the screen has a rounded shape.
898 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
899 optional int32 screenLayout = 13;
900
901 // Current width of the available screen space, in dp units.
902 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
903 optional int32 screenWidthDp = 14;
904
905 // The smallest screen size an application will see in normal operation.
906 // This is the smallest value of both screenWidthDp and screenHeightDp
907 // in portrait and landscape.
908 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
909 optional int32 smallestScreenWidthDp = 15;
910
911 // The type of touch screen attached to the device.
912 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
913 optional int32 touchscreen = 16;
914
915 // Bit mask of the ui mode.
916 // Contains information about the overall ui mode of the device.
917 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
918 // Also contains information about whether the device is in night mode.
919 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
920 optional int32 uiMode = 17;
921}
922
Tej Singheee317b2018-03-07 19:28:05 -0800923
924/**
925 * Logs changes in the connection state of the mobile radio.
926 *
927 * Logged from:
928 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
929 */
930message MobileConnectionStateChanged {
931 // States are from the state machine DataConnection.java.
932 enum State {
933 UNKNOWN = 0;
934 // The connection is inactive, or disconnected.
935 INACTIVE = 1;
936 // The connection is being activated, or connecting.
937 ACTIVATING = 2;
938 // The connection is active, or connected.
939 ACTIVE = 3;
940 // The connection is disconnecting.
941 DISCONNECTING = 4;
942 // The connection is disconnecting after creating a connection.
943 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
944 }
945 optional State state = 1;
946 // For multi-sim phones, this distinguishes between the sim cards.
947 optional int32 sim_slot_index = 2;
948 // Used to identify the connection. Starts at 0 and increments by 1 for
949 // every new network created. Resets whenever the device reboots.
950 optional int32 data_connection_id = 3;
951 // A bitmask for the capabilities of this connection.
952 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
953 // Default value (if we have no information): 0
954 optional int64 capabilities = 4;
955 // If this connection has internet.
956 // This just checks if the DEFAULT bit of capabilities is set.
957 optional bool has_internet = 5;
958}
959
960/**
961 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
962 *
963 * Logged from:
964 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
965 */
966message MobileRadioTechnologyChanged {
967 optional android.telephony.NetworkTypeEnum state = 1;
968 // For multi-sim phones, this distinguishes between the sim cards.
969 optional int32 sim_slot_index = 2;
970}
971
Andrew Chantb56388b2018-03-22 21:07:33 -0700972/**
973 * Logs the VID and PID of any connected USB devices.
974 *
975 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
976 *
977 * Logged by Vendor.
978 */
979message UsbDeviceAttached {
980 optional int32 vid = 1;
981 optional int32 pid = 2;
982 optional bool has_audio = 3;
983 optional bool has_hid = 4;
984 optional bool has_storage = 5;
985}
986
Tej Singheee317b2018-03-07 19:28:05 -0800987
Tej Singhdd7bd352018-02-09 19:33:15 -0800988/**
Tej Singh5d991e12018-03-09 19:48:11 -0800989 * Logs when Bluetooth is enabled and disabled.
990 *
991 * Logged from:
992 * services/core/java/com/android/server/BluetoothManagerService.java
993 */
994message BluetoothEnabledStateChanged {
995 repeated AttributionNode attribution_node = 1;
996 // Whether or not bluetooth is enabled on the device.
997 enum State {
998 UNKNOWN = 0;
999 ENABLED = 1;
1000 DISABLED = 2;
1001 }
1002 optional State state = 2;
1003 // The reason for being enabled/disabled.
1004 // Eg. Airplane mode, crash, application request.
1005 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1006 // If the reason is an application request, this will be the package name.
1007 optional string pkgName = 4;
1008}
1009
1010/**
1011 * Logs when a Bluetooth device connects and disconnects.
1012 *
1013 * Logged from:
1014 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1015 */
1016message BluetoothConnectionStateChanged {
1017 // The state of the connection.
1018 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1019 optional android.bluetooth.ConnectionStateEnum state = 1;
1020 // An identifier that can be used to match connect and disconnect events.
1021 // Currently is last two bytes of a hash of a device level ID and
1022 // the mac address of the bluetooth device that is connected.
1023 optional int32 obfuscated_id = 2;
1024 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1025 // From android.bluetooth.BluetoothAdapter.java
1026 optional int32 bt_profile = 3;
1027}
1028
1029/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001030 * Logs when something is plugged into or removed from the USB-C connector.
1031 *
1032 * Logged from:
1033 * Vendor USB HAL.
1034 */
1035message UsbConnectorStateChanged {
1036 enum State {
1037 DISCONNECTED = 0;
1038 CONNECTED = 1;
1039 }
1040 optional State state = 1;
1041}
1042
1043/**
1044 * Logs the reported speaker impedance.
1045 *
1046 * Logged from:
1047 * Vendor audio implementation.
1048 */
1049message SpeakerImpedanceReported {
1050 optional int32 speaker_location = 1;
1051 optional int32 impedance = 2;
1052}
1053
1054/**
1055 * Logs the report of a failed hardware.
1056 *
1057 * Logged from:
1058 * Vendor HALs.
1059 *
1060 */
1061message HardwareFailed {
1062 enum HardwareType {
1063 HARDWARE_FAILED_UNKNOWN = 0;
1064 HARDWARE_FAILED_MICROPHONE = 1;
1065 HARDWARE_FAILED_CODEC = 2;
1066 HARDWARE_FAILED_SPEAKER = 3;
1067 HARDWARE_FAILED_FINGERPRINT = 4;
1068 }
1069 optional HardwareType hardware_type = 1;
1070
1071 /* hardware_location allows vendors to differentiate between multiple instances of
1072 * the same hardware_type. The specific locations are vendor defined integers,
1073 * referring to board-specific numbering schemes.
1074 */
1075 optional int32 hardware_location = 2;
1076
1077 /* failure_code is specific to the HardwareType of the failed hardware.
1078 * It should use the enum values defined below.
1079 */
1080 enum MicrophoneFailureCode {
1081 MICROPHONE_FAILURE_COMPLETE = 0;
1082 }
1083 enum CodecFailureCode {
1084 CODEC_FAILURE_COMPLETE = 0;
1085 }
1086 enum SpeakerFailureCode {
1087 SPEAKER_FAILURE_COMPLETE = 0;
1088 SPEAKER_FAILURE_HIGH_Z = 1;
1089 SPEAKER_FAILURE_SHORT = 2;
1090 }
1091 enum FingerprintFailureCode {
1092 FINGERPRINT_FAILURE_COMPLETE = 0;
1093 FINGERPRINT_SENSOR_BROKEN = 1;
1094 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1095 }
1096 optional int32 failure_code = 3;
1097}
1098
1099/**
1100 * Log an event when the device has been physically dropped.
1101 * Reported from the /vendor partition.
1102 */
1103message PhysicalDropDetected {
1104 // Confidence that the event was actually a drop, 0 -> 100
1105 optional int32 confidence_pctg = 1;
1106 // Peak acceleration of the drop, in 1/1000s of a g.
1107 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001108 // Duration of freefall in ms
1109 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001110}
1111
1112/**
1113 * Log bucketed battery charge cycles.
1114 *
1115 * Each bucket represents cycles of the battery past
1116 * a given charge point. For example, bucket 1 is the
1117 * lowest 1/8th of the battery, and bucket 8 is 100%.
1118 *
1119 * Logged from:
1120 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1121 */
1122message ChargeCyclesReported {
1123 optional int32 cycle_bucket_1 = 1;
1124 optional int32 cycle_bucket_2 = 2;
1125 optional int32 cycle_bucket_3 = 3;
1126 optional int32 cycle_bucket_4 = 4;
1127 optional int32 cycle_bucket_5 = 5;
1128 optional int32 cycle_bucket_6 = 6;
1129 optional int32 cycle_bucket_7 = 7;
1130 optional int32 cycle_bucket_8 = 8;
1131}
1132
1133/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001134 * Logs the duration of a davey (jank of >=700ms) when it occurs
1135 *
1136 * Logged from:
1137 * frameworks/base/libs/hwui/JankTracker.cpp
1138 */
1139message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001140 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001141 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001142
Tej Singhbb8554a2018-01-26 11:59:14 -08001143 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001144 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001145}
1146
1147/**
Bookatze5885242017-10-24 20:10:31 -07001148 * Logs phone signal strength changes.
1149 *
1150 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001151 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001152 */
1153message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001154 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1155 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001156}
1157
1158/**
1159 * Logs that a setting was updated.
1160 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001161 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001162 * The tag and is_default allow resetting of settings to default values based on the specified
1163 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1164 */
1165message SettingChanged {
1166 // The name of the setting.
1167 optional string setting = 1;
1168
1169 // The change being imposed on this setting. May represent a number, eg "3".
1170 optional string value = 2;
1171
1172 // The new value of this setting. For most settings, this is same as value. For some settings,
1173 // value is +X or -X where X represents an element in a set. For example, if the previous value
1174 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1175 // The +/- feature is currently only used for location_providers_allowed.
1176 optional string new_value = 3;
1177
1178 // The previous value of this setting.
1179 optional string prev_value = 4;
1180
1181 // The tag used with the is_default for resetting sets of settings. This is generally null.
1182 optional string tag = 5;
1183
Bookatz90867622018-01-31 15:05:57 -08001184 // True if this setting with tag should be resettable.
1185 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001186
David Chenbd789912018-03-16 17:19:55 -07001187 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001188 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001189
1190 enum ChangeReason {
1191 UPDATED = 1; // Updated can be an insertion or an update.
1192 DELETED = 2;
1193 }
1194 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001195}
Chenjie Yub3dda412017-10-24 13:41:59 -07001196
Chenjie Yu05013b32017-11-21 10:21:41 -08001197/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001198 * Logs activity going to foreground or background
1199 *
1200 * Logged from:
1201 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1202 */
1203message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001204 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001205 optional string pkg_name = 2;
1206 optional string class_name = 3;
1207
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001208 enum State {
1209 BACKGROUND = 0;
1210 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001211 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001212 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001213}
David Chenc8a43242017-10-17 16:23:28 -07001214
1215/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001216 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001217 * Logged from:
1218 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1219 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001220message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001221 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001222
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001223 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001224
1225 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001226 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001227 optional string process_name = 3;
1228
1229 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001230 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001231
1232 optional string package_name = 5;
1233
1234 enum InstantApp {
1235 UNAVAILABLE = 0;
1236 FALSE = 1;
1237 TRUE = 2;
1238 }
1239 optional InstantApp is_instant_app = 6;
1240
1241 enum ForegroundState {
1242 UNKNOWN = 0;
1243 BACKGROUND = 1;
1244 FOREGROUND = 2;
1245 }
1246 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001247}
David Chen9e3808c2017-11-20 17:25:34 -08001248
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001249/**
1250 * Logs when a WTF (What a Terrible Failure) happened.
1251 * Logged from:
1252 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1253 */
1254message WTFOccurred {
1255 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001256
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001257 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001258
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001259 // The name of the process.
1260 // system_server if it is not by an app
1261 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001262
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001263 // The pid if available. -1 means not available.
1264 optional sint32 pid = 4;
1265}
1266
1267/**
1268 * Logs when system server reports low memory.
1269 * Logged from:
1270 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1271 */
1272message LowMemReported {
1273}
1274
1275/**
1276 * Logs when an app ANR (App Not Responding) occurs.
1277 * Logged from:
1278 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1279 */
1280message ANROccurred {
1281 optional int32 uid = 1 [(is_uid) = true];
1282
1283 optional string process_name = 2;
1284
1285 optional string short_component_name = 3;
1286
1287 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001288
1289 enum InstantApp {
1290 UNAVAILABLE = 0;
1291 FALSE = 1;
1292 TRUE = 2;
1293 }
1294 optional InstantApp is_instant_app = 5;
1295
1296 enum ForegroundState {
1297 UNKNOWN = 0;
1298 BACKGROUND = 1;
1299 FOREGROUND = 2;
1300 }
1301 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08001302}
1303
David Chen0a368b22017-12-06 16:28:16 -08001304/*
1305 * Allows other apps to push events into statsd.
1306 * Logged from:
1307 * frameworks/base/core/java/android/util/StatsLog.java
1308 */
David Chen0b5c90c2018-01-25 16:51:49 -08001309message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001310 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001311 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001312
1313 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1314 optional int32 label = 2;
1315
1316 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1317 // predicates for the metrics).
1318 enum State {
1319 UNKNOWN = 0;
1320 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1321 STOP = 2;
1322 START = 3;
1323 }
1324 optional State state = 3;
1325}
1326
David Chen9e3808c2017-11-20 17:25:34 -08001327/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001328 * Logs when statsd detects an anomaly.
1329 *
1330 * Logged from:
1331 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1332 */
1333message AnomalyDetected {
1334 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001335 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001336
Yangster-mac94e197c2018-01-02 16:03:03 -08001337 // Id of the config whose anomaly detection alert fired.
1338 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001339
Yangster-mac94e197c2018-01-02 16:03:03 -08001340 // Id of the alert (i.e. name of the anomaly that was detected).
1341 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001342}
1343
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001344message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001345 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001346 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001347
1348 // The app package name.
1349 optional string pkg_name = 2;
1350
1351 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001352 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001353 WARM = 1;
1354 HOT = 2;
1355 COLD = 3;
1356 }
1357 // The transition type.
1358 optional TransitionType type = 3;
1359
1360 // The activity name.
1361 optional string activity_name = 4;
1362
1363 // The name of the calling app. Empty if not set.
1364 optional string calling_pkg_name = 5;
1365
1366 // Whether the app is an instant app.
1367 optional bool is_instant_app = 6;
1368
1369 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001370 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001371
Bookatz80d11a02018-01-16 10:46:35 -08001372 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001373
David Chen0b5c90c2018-01-25 16:51:49 -08001374 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001375 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001376 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001377 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001378 optional int32 bind_application_delay_millis = 11;
1379 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001380
1381 // Empty if not set.
1382 optional string launch_token = 13;
1383
Calin Juravle759fbda2018-02-20 19:52:30 +00001384 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001385 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001386
1387 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001388 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001389}
1390
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001391message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001392 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001393 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001394
1395 // The app package name.
1396 optional string pkg_name = 2;
1397
1398 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001399 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001400 WARM = 1;
1401 HOT = 2;
1402 COLD = 3;
1403 }
1404 // The transition type.
1405 optional TransitionType type = 3;
1406
1407 // The activity name.
1408 optional string activity_name = 4;
1409}
1410
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001411message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001412 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001413 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001414
1415 // The app package name.
1416 optional string pkg_name = 2;
1417
1418 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001419 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001420 WITH_BUNDLE = 1;
1421 WITHOUT_BUNDLE = 2;
1422 }
1423 // The transition type.
1424 optional TransitionType type = 3;
1425
1426 // The activity name.
1427 optional string activity_name = 4;
1428
1429 optional bool transition_process_running = 5;
1430
1431 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001432 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001433}
1434
Bookatz8fcd09a2017-12-18 13:01:10 -08001435/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001436 * Logs a picture-in-picture action
1437 * Logged from:
1438 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1439 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1440 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1441 */
1442message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001443 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001444 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001445
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001446 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001447
Chenjie Yu52cacc62017-12-08 18:11:45 -08001448 enum State {
1449 ENTERED = 1;
1450 EXPANDED_TO_FULL_SCREEN = 2;
1451 MINIMIZED = 3;
1452 DISMISSED = 4;
1453 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001454 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001455}
1456
1457/**
Chenjie Yue8904192017-12-08 19:12:57 -08001458 * Logs overlay action
1459 * Logged from:
1460 * services/core/java/com/android/server/wm/Session.java
1461 */
1462message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001463 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001464
1465 optional string package_name = 2;
1466
1467 optional bool using_alert_window = 3;
1468
1469 enum State {
1470 ENTERED = 1;
1471 EXITED = 2;
1472 }
1473 optional State state = 4;
1474}
1475
Chenjie Yuccfe6452018-01-30 11:33:21 -08001476/*
1477 * Logs foreground service starts and stops.
1478 * Note that this is not when a service starts or stops, but when it is
1479 * considered foreground.
1480 * Logged from
1481 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1482 */
1483message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001484 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001485 // package_name + "/" + class_name
1486 optional string short_name = 2;
1487
1488 enum State {
1489 ENTER = 1;
1490 EXIT = 2;
1491 }
1492 optional State state = 3;
1493}
1494
Chenjie Yue8904192017-12-08 19:12:57 -08001495/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001496 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1497 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1498 * attributed back to the parent (host) uid. One example is Chrome.
1499 *
1500 * Logged from:
1501 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1502 */
1503message IsolatedUidChanged {
1504 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001505 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001506 optional int32 parent_uid = 1;
1507
1508 optional int32 isolated_uid = 2;
1509
1510 // We expect an isolated uid to be removed before if it's used for another parent uid.
1511 enum Event {
1512 REMOVED = 0;
1513 CREATED = 1;
1514 }
1515 optional Event event = 3;
1516}
1517
1518/*
1519 * Logs the reception of an incoming network packet causing the main system to wake up for
1520 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1521 * and processed by WakeupController.cpp.
1522 */
1523message PacketWakeupOccurred {
1524 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1525 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001526 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001527 // The interface name on which the packet was received.
1528 optional string iface = 2;
1529 // The ethertype value of the packet.
1530 optional int32 ethertype = 3;
1531 // String representation of the destination MAC address of the packet.
1532 optional string destination_hardware_address = 4;
1533 // String representation of the source address of the packet if this was an IP packet.
1534 optional string source_ip = 5;
1535 // String representation of the destination address of the packet if this was an IP packet.
1536 optional string destination_ip = 6;
1537 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1538 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1539 // families.
1540 optional int32 ip_next_header = 7;
1541 // The source port if this was a TCP or UDP packet.
1542 optional int32 source_port = 8;
1543 // The destination port if this was a TCP or UDP packet.
1544 optional int32 destination_port = 9;
1545}
1546
1547/*
1548 * Logs the memory stats for an app on startup.
1549 * Logged from:
1550 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1551 */
1552message AppStartMemoryStateCaptured {
1553 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001554 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001555
1556 // The process name.
1557 optional string process_name = 2;
1558
1559 // The activity name.
1560 optional string activity_name = 3;
1561
1562 // # of page-faults
1563 optional int64 pgfault = 4;
1564
1565 // # of major page-faults
1566 optional int64 pgmajfault = 5;
1567
1568 // RSS
1569 optional int64 rss_in_bytes = 6;
1570
1571 // CACHE
1572 optional int64 cache_in_bytes = 7;
1573
1574 // SWAP
1575 optional int64 swap_in_bytes = 8;
1576}
1577
1578/*
1579 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1580 * for LMK event.
1581 * Logged from:
1582 * system/core/lmkd/lmkd.c
1583 */
1584message LmkStateChanged {
1585 enum State {
1586 UNKNOWN = 0;
1587 START = 1;
1588 STOP = 2;
1589 }
1590 optional State state = 1;
1591}
1592
1593/*
1594 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1595 * Logged from:
1596 * system/core/lmkd/lmkd.c
1597 */
1598message LmkKillOccurred {
1599 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001600 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001601
1602 // The process name.
1603 optional string process_name = 2;
1604
1605 // oom adj score.
1606 optional int32 oom_score = 3;
1607
1608 // # of page-faults
1609 optional int64 pgfault = 4;
1610
1611 // # of major page-faults
1612 optional int64 pgmajfault = 5;
1613
1614 // RSS
1615 optional int64 rss_in_bytes = 6;
1616
1617 // CACHE
1618 optional int64 cache_in_bytes = 7;
1619
1620 // SWAP
1621 optional int64 swap_in_bytes = 8;
1622}
1623
Rajeev Kumar51b54602018-03-01 12:18:26 -08001624/*
1625 * Logs when the ActivityManagerService detects that an app died.
1626 *
1627 * Logged from:
1628 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1629 */
1630message AppDied {
1631 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07001632 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08001633}
1634
Chenjie Yubbcbc602018-02-05 16:51:52 -08001635//////////////////////////////////////////////////////////////////////
1636// Pulled atoms below this line //
1637//////////////////////////////////////////////////////////////////////
1638
1639/**
David Chenc8a43242017-10-17 16:23:28 -07001640 * Pulls bytes transferred via wifi (Sum of 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 WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001646 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001647
1648 optional int64 rx_bytes = 2;
1649
1650 optional int64 rx_packets = 3;
1651
1652 optional int64 tx_bytes = 4;
1653
1654 optional int64 tx_packets = 5;
1655}
1656
1657/**
1658 * Pulls bytes transferred via wifi (separated by foreground and background usage).
1659 *
1660 * Pulled from:
1661 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1662 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001663message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001664 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001665
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001666 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
1667 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07001668
1669 optional int64 rx_bytes = 3;
1670
1671 optional int64 rx_packets = 4;
1672
1673 optional int64 tx_bytes = 5;
1674
1675 optional int64 tx_packets = 6;
1676}
1677
1678/**
1679 * Pulls bytes transferred via mobile networks (Sum of 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 MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001685 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001686
1687 optional int64 rx_bytes = 2;
1688
1689 optional int64 rx_packets = 3;
1690
1691 optional int64 tx_bytes = 4;
1692
1693 optional int64 tx_packets = 5;
1694}
1695
1696/**
1697 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
1698 *
1699 * Pulled from:
1700 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1701 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001702message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001703 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001704
Yao Chenc40a19d2018-03-15 16:48:25 -07001705 // 1 denotes foreground and 0 denotes background. This is called Set in
1706 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001707 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07001708
1709 optional int64 rx_bytes = 3;
1710
1711 optional int64 rx_packets = 4;
1712
1713 optional int64 tx_bytes = 5;
1714
1715 optional int64 tx_packets = 6;
1716}
1717
1718/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001719 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
1720 *
1721 * Pulled from:
1722 * StatsCompanionService
1723 */
1724message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001725 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001726
1727 optional int64 rx_bytes = 2;
1728
1729 optional int64 tx_bytes = 3;
1730}
1731
1732/**
David Chenc8a43242017-10-17 16:23:28 -07001733 * Pulls the kernel wakelock durations. This atom is adapted from
1734 * android/internal/os/KernelWakelockStats.java
1735 *
1736 * Pulled from:
1737 * StatsCompanionService using KernelWakelockReader.
1738 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001739message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07001740 optional string name = 1;
1741
1742 optional int32 count = 2;
1743
1744 optional int32 version = 3;
1745
1746 optional int64 time = 4;
1747}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001748
Chenjie Yu05013b32017-11-21 10:21:41 -08001749/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001750 * Pulls low power state information. This includes platform and subsystem sleep state information,
1751 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001752 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001753 * hardware/interfaces/power/1.1/types.hal
1754 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001755message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08001756 // Subsystem name
1757 optional string subsystem_name = 1;
1758 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
1759 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
1760 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001761 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08001762 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001763 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08001764 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07001765}
Chenjie Yu7f8def92017-11-03 09:33:15 -07001766
Chenjie Yu05013b32017-11-21 10:21:41 -08001767/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07001768 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08001769 * Pulls the time the cpu spend on the frequency index. Frequency index
1770 * starts from highest to lowest. The value should be monotonically
1771 * increasing since boot. However, if there is a cpu
1772 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07001773 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001774message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07001775 optional uint32 cluster = 1;
1776 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001777 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07001778}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001779
Chenjie Yu05013b32017-11-21 10:21:41 -08001780/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001781 * Pulls Cpu Time Per Uid.
1782 * Note that isolated process uid time should be attributed to host uids.
1783 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001784message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07001785 optional int32 uid = 1 [(is_uid) = true];
David Chen0b5c90c2018-01-25 16:51:49 -08001786 optional uint64 user_time_millis = 2;
1787 optional uint64 sys_time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001788}
1789
1790/**
1791 * Pulls Cpu Time Per Uid per frequency.
1792 * Note that isolated process uid time should be attributed to host uids.
1793 * For each uid, we order the time by descending frequencies.
1794 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001795message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07001796 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001797 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001798 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001799}
Hugo Benichi884970e2017-11-14 22:42:46 +09001800
Chenjie Yu05013b32017-11-21 10:21:41 -08001801/**
1802 * Pulls Wifi Controller Activity Energy Info
1803 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001804message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001805 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001806 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001807 // stack reported state
1808 // TODO: replace this with proto enum
1809 optional int32 stack_state = 2;
1810 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001811 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001812 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001813 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001814 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001815 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001816 // product of current(mA), voltage(V) and time(ms)
1817 optional uint64 controller_energy_used = 6;
1818}
1819
1820/**
1821 * Pulls Modem Activity Energy Info
1822 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001823message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001824 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001825 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001826 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001827 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08001828 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001829 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001830 /**
1831 * Tx power index
1832 * index 0 = tx_power < 0dBm
1833 * index 1 = 0dBm < tx_power < 5dBm
1834 * index 2 = 5dBm < tx_power < 15dBm
1835 * index 3 = 15dBm < tx_power < 20dBm
1836 * index 4 = tx_power > 20dBm
1837 */
1838 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08001839 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001840 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08001841 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001842 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08001843 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08001844 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08001845 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08001846 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08001847 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08001848 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08001849 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08001850 // product of current(mA), voltage(V) and time(ms)
1851 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08001852}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001853
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001854/**
1855 * Pulls Bluetooth Activity Energy Info
1856 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
1857 */
1858message BluetoothActivityInfo {
1859 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001860 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001861 // bluetooth stack state
1862 optional int32 bluetooth_stack_state = 2;
1863 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001864 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001865 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001866 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001867 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001868 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001869 // product of current(mA), voltage(V) and time(ms)
1870 optional uint64 energy_used = 6;
1871}
1872
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001873/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001874 * Logs the memory stats for a process.
1875 */
1876message ProcessMemoryState {
1877 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001878 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001879
1880 // The process name.
1881 optional string process_name = 2;
1882
1883 // oom adj score.
1884 optional int32 oom_score = 3;
1885
1886 // # of page-faults
1887 optional int64 pgfault = 4;
1888
1889 // # of major page-faults
1890 optional int64 pgmajfault = 5;
1891
Rajeev Kumar90235992018-01-29 11:06:48 -08001892 // RSS
1893 optional int64 rss_in_bytes = 6;
1894
1895 // CACHE
1896 optional int64 cache_in_bytes = 7;
1897
1898 // SWAP
1899 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001900}
1901
1902/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001903 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001904 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001905message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08001906 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001907}
1908
1909/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001910 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001911 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001912message SystemUptime {
1913 // Milliseconds since the system was booted.
1914 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
1915 // for external input).
1916 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08001917 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001918}
1919
1920/*
1921 * Reads from /proc/uid_concurrent_active_time which has the format:
1922 * active: X (X is # cores)
1923 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
1924 * [uid1]: [time-0] [time-1] [time-2] ... ...
1925 * ...
1926 * Time-N means the CPU time a UID spent running concurrently with N other processes.
1927 * The file contains a monotonically increasing count of time for a single boot.
1928 */
1929message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07001930 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001931 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001932}
1933
1934/**
1935 * Reads from /proc/uid_concurrent_policy_time which has the format:
1936 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
1937 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1938 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1939 * ...
1940 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
1941 * The file contains a monotonically increasing count of time for a single boot.
1942 */
1943message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07001944 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001945 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001946 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08001947}
1948
1949/*
1950 * Pulls free disk space, for data, system partition and temporary directory.
1951 */
1952message DiskSpace {
1953 // available bytes in data partition
1954 optional uint64 data_available_bytes = 1;
1955 // available bytes in system partition
1956 optional uint64 system_available_bytes = 2;
1957 // available bytes in download cache or temp directories
1958 optional uint64 temp_available_bytes = 3;
1959}
Tej Singhbf972d92018-01-10 20:51:13 -08001960
1961/**
1962 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08001963 * Pulled from:
1964 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08001965 */
1966message RemainingBatteryCapacity {
1967 optional int32 charge_uAh = 1;
1968}
1969
1970/**
1971 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08001972 * Pulled from:
1973 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08001974 */
1975message FullBatteryCapacity {
1976 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08001977}
1978
1979/**
Tej Singhd89137e2018-03-26 14:51:40 -07001980 * Pulls the temperature of various parts of the device.
1981 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08001982 *
1983 * Pulled from:
1984 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
1985 */
1986message Temperature {
1987 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
1988 optional android.os.TemperatureTypeEnum sensor_location = 1;
1989
1990 // The name of the temperature source. Eg. CPU0
1991 optional string sensor_name = 2;
1992
Tej Singhd89137e2018-03-26 14:51:40 -07001993 // Temperature in tenths of a degree C.
1994 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08001995}