blob: 68b6522138c7de4e44edde2066da7681167ebca7 [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";
Yao Chen046b5122018-10-24 14:09:20 -070029import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080030import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080031import "frameworks/base/core/proto/android/telephony/enums.proto";
32import "frameworks/base/core/proto/android/view/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080033
Yao Chend54f9dd2017-10-17 17:37:48 +000034/**
Stefan Lafonae2df012017-11-14 09:17:21 -080035 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000036 * raw stats log events from the Android system, also known as "atoms."
37 *
38 * This field contains a single oneof with all of the available messages.
39 * The stats-log-api-gen tool runs as part of the Android build and
40 * generates the android.util.StatsLog class, which contains the constants
41 * and methods that Android uses to log.
42 *
Stefan Lafonae2df012017-11-14 09:17:21 -080043 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000044 * Instead, statsd on Android constructs these messages synthetically,
45 * in the format defined here and in stats_log.proto.
46 */
Stefan Lafonae2df012017-11-14 09:17:21 -080047message Atom {
48 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070049 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070050 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
51 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080052 // 3 is available for use
Bookatzc1a050a2017-10-10 15:49:28 -070053 BleScanResultReceived ble_scan_result_received = 4;
54 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080055 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070056 SyncStateChanged sync_state_changed = 7;
57 ScheduledJobStateChanged scheduled_job_state_changed = 8;
58 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070059 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080060 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
61 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
62 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Hyunyoung Songcc651c12018-10-17 13:35:32 -070063 // 14 - 18 are available
64 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080065 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
66 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
67 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070068 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080069 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070070 CameraStateChanged camera_state_changed = 25;
71 FlashlightStateChanged flashlight_state_changed = 26;
72 UidProcessStateChanged uid_process_state_changed = 27;
73 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
74 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070075 BatteryLevelChanged battery_level_changed = 30;
76 ChargingStateChanged charging_state_changed = 31;
77 PluggedStateChanged plugged_state_changed = 32;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080078 // 33 - 34 are available
Bookatz8c6571b2017-10-24 15:04:41 -070079 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
80 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070081 WifiLockStateChanged wifi_lock_state_changed = 37;
82 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
83 WifiScanStateChanged wifi_scan_state_changed = 39;
84 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070085 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070086 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070087 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090088 PacketWakeupOccurred packet_wakeup_occurred = 44;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080089 // 45 is available
Bookatz8fcd09a2017-12-18 13:01:10 -080090 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080091 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080092 AppStartOccurred app_start_occurred = 48;
93 AppStartCanceled app_start_canceled = 49;
94 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -080095 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -080096 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -080097 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -080098 LmkStateChanged lmk_state_changed = 54;
99 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800100 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800101 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800102 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800103 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800104 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800105 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800106 KeyguardStateChanged keyguard_state_changed = 62;
107 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
108 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800109 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800110 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800111 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
112 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Tej Singh02200f92018-04-02 19:37:59 -0700113 // 69 is blank but need not be.
Andrew Chantb56388b2018-03-22 21:07:33 -0700114 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800115 SpeakerImpedanceReported speaker_impedance_reported = 71;
116 HardwareFailed hardware_failed = 72;
117 PhysicalDropDetected physical_drop_detected = 73;
118 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800119 MobileConnectionStateChanged mobile_connection_state_changed = 75;
120 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700121 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800122 AppCrashOccurred app_crash_occurred = 78;
123 ANROccurred anr_occurred = 79;
124 WTFOccurred wtf_occurred = 80;
Yangster4ccebea2018-10-09 17:09:02 -0700125 PhoneServiceStateChanged phone_service_state_changed = 94;
126 PhoneStateChanged phone_state_changed = 95;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800127 LowMemReported low_mem_reported = 81;
128
129
Yao Chend54f9dd2017-10-17 17:37:48 +0000130 }
David Chenc8a43242017-10-17 16:23:28 -0700131
David Chen6e3e6cb2018-01-03 16:14:06 -0800132 // Pulled events will start at field 10000.
Tej Singh40298312018-02-16 00:15:09 -0800133 // Next: 10022
David Chenc8a43242017-10-17 16:23:28 -0700134 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800135 WifiBytesTransfer wifi_bytes_transfer = 10000;
136 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
137 MobileBytesTransfer mobile_bytes_transfer = 10002;
138 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800139 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800140 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800141 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800142 CpuTimePerFreq cpu_time_per_freq = 10008;
143 CpuTimePerUid cpu_time_per_uid = 10009;
144 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800145 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800146 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800147 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800148 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800149 SystemElapsedRealtime system_elapsed_realtime = 10014;
150 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800151 CpuActiveTime cpu_active_time = 10016;
152 CpuClusterTime cpu_cluster_time = 10017;
Chenjie Yu937d7422018-01-10 16:37:53 -0800153 DiskSpace disk_space = 10018;
Tej Singhbf972d92018-01-10 20:51:13 -0800154 RemainingBatteryCapacity remaining_battery_capacity = 10019;
155 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800156 Temperature temperature = 10021;
David Chenc8a43242017-10-17 16:23:28 -0700157 }
yroa1fe77c2018-02-26 14:22:54 -0800158
Bookatz76aafcf2018-09-17 16:17:10 -0700159 // DO NOT USE field numbers above 100,000 in AOSP.
160 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
161 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700162}
163
Yao Chend54f9dd2017-10-17 17:37:48 +0000164/**
Yangster-mac20877162017-12-22 17:19:39 -0800165 * This proto represents a node of an attribution chain.
166 * Note: All attribution chains are represented as a repeated field of type
167 * AttributionNode. It is understood that in such arrays, the order is that
168 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000169 */
Yangster-mac20877162017-12-22 17:19:39 -0800170message AttributionNode {
171 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800172 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800173
Yangster-mac20877162017-12-22 17:19:39 -0800174 // The (optional) string tag for an element in the attribution chain. If the
175 // element has no tag, it is encoded as an empty string.
176 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700177}
178
Yao Chend54f9dd2017-10-17 17:37:48 +0000179/*
180 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800181 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000182 *
183 * RULES:
184 * - The field ids for each atom must start at 1, and count upwards by 1.
185 * Skipping field ids is not allowed.
186 * - These form an API, so renaming, renumbering or removing fields is
187 * not allowed between android releases. (This is not currently enforced,
188 * but there will be a tool to enforce this restriction).
189 * - The types must be built-in protocol buffer types, namely, no sub-messages
190 * are allowed (yet). The bytes type is also not allowed.
191 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800192 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000193 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800194 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000195 * - A field that is a uid should be a string field, tagged with the [xxx]
196 * annotation. The generated code on android will be represented by UIDs,
197 * and those UIDs will be translated in xxx to those strings.
198 *
199 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700200 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000201 * - If there is a UID, it goes first. Think in an object-oriented fashion.
202 * *****************************************************************************
203 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700204
Yao Chend54f9dd2017-10-17 17:37:48 +0000205/**
206 * Logs when the screen state changes.
207 *
208 * Logged from:
209 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
210 */
211message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800212 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800213 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700214}
Yao Chend54f9dd2017-10-17 17:37:48 +0000215
216/**
Bookatzc1a050a2017-10-10 15:49:28 -0700217 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000218 *
219 * Logged from:
220 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
221 */
Bookatzc1a050a2017-10-10 15:49:28 -0700222message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700223 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000224
Bookatzdb026a22018-01-10 19:01:56 -0800225 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800226 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000227}
228
229/**
Bookatzc1a050a2017-10-10 15:49:28 -0700230 * Logs that a process started, finished, crashed, or ANRed.
231 *
232 * Logged from:
233 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
234 */
235message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700236 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700237
David Chen0b5c90c2018-01-25 16:51:49 -0800238 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800239 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700240
Bookatzddccf0a2017-11-28 16:48:14 -0800241 // What lifecycle state the process changed to.
242 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800243 enum State {
244 FINISHED = 0;
245 STARTED = 1;
246 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800247 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800248 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700249}
250
Bookatzc1a050a2017-10-10 15:49:28 -0700251/**
252 * Logs when the ble scan state changes.
253 *
254 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700255 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700256 */
257message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800258 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700259
260 enum State {
261 OFF = 0;
262 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700263 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
264 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700265 }
266 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700267
Bookatze5ec0b42018-03-26 13:34:56 -0700268 // Does the scan have a filter.
269 optional bool is_filtered = 3;
270 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
271 optional bool is_first_match = 4;
272 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
273 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700274}
275
276/**
277 * Logs reporting of a ble scan finding results.
278 *
279 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700280 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700281 */
Bookatzae6738e2018-09-13 11:38:56 -0700282// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700283message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800284 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700285
286 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800287 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700288}
289
290/**
291 * Logs when a sensor state changes.
292 *
293 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700294 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700295 */
296message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800297 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700298
Bookatzc1a050a2017-10-10 15:49:28 -0700299 // The id (int) of the sensor.
300 optional int32 sensor_id = 2;
301
302 enum State {
303 OFF = 0;
304 ON = 1;
305 }
306 optional State state = 3;
307}
308
309
310/**
311 * Logs when GPS state changes.
312 *
313 * Logged from:
314 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
315 */
316message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800317 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700318
319 enum State {
320 OFF = 0;
321 ON = 1;
322 }
323 optional State state = 2;
324}
325
326
327/**
328 * Logs when a sync manager sync state changes.
329 *
330 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700331 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700332 */
333message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800334 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700335
David Chen0b5c90c2018-01-25 16:51:49 -0800336 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800337 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700338
339 enum State {
340 OFF = 0;
341 ON = 1;
342 }
343 optional State state = 3;
344}
345
346/**
347 * Logs when a job scheduler job state changes.
348 *
349 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700350 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700351 */
352message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800353 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700354
355 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800356 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700357
358 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800359 FINISHED = 0;
360 STARTED = 1;
361 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700362 }
363 optional State state = 3;
364
Tej Singh33a412b2018-03-16 18:43:59 -0700365 // The reason a job has stopped.
366 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700367 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700368 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700369}
370
371/**
372 * Logs when the audio state changes.
373 *
374 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700375 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700376 */
377message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800378 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700379
380 enum State {
381 OFF = 0;
382 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700383 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
384 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700385 }
386 optional State state = 2;
387}
388
389/**
390 * Logs when the video codec state changes.
391 *
392 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700393 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700394 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800395message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800396 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700397
398 enum State {
399 OFF = 0;
400 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700401 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
402 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700403 }
404 optional State state = 2;
405}
406
407/**
408 * Logs when the flashlight state changes.
409 *
410 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700411 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700412 */
413message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800414 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700415
416 enum State {
417 OFF = 0;
418 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700419 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
420 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700421 }
422 optional State state = 2;
423}
424
425/**
426 * Logs when the camera state changes.
427 *
428 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700429 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700430 */
431message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800432 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700433
434 enum State {
435 OFF = 0;
436 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700437 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
438 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700439 }
440 optional State state = 2;
441}
442
443/**
444 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000445 *
446 * Logged from:
447 * TODO
448 */
Bookatzd6746242017-10-24 18:39:35 -0700449message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800450 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000451
Bookatz1a1b0462018-01-12 11:47:03 -0800452 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
453 // From frameworks/base/core/proto/android/os/enums.proto.
454 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700455
456 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
457 optional string tag = 3;
458
459 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800460 RELEASE = 0;
461 ACQUIRE = 1;
462 CHANGE_RELEASE = 2;
463 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700464 }
465 optional State state = 4;
466}
467
468/**
Bookatzc1a050a2017-10-10 15:49:28 -0700469 * Logs when a partial wakelock is considered 'long' (over 1 min).
470 *
471 * Logged from:
472 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
473 */
474message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800475 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700476
Yao Chend54f9dd2017-10-17 17:37:48 +0000477 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
478 optional string tag = 2;
479
Bookatzc1a050a2017-10-10 15:49:28 -0700480 // TODO: I have no idea what this is.
481 optional string history_tag = 3;
482
483 enum State {
484 OFF = 0;
485 ON = 1;
486 }
487 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000488}
489
Bookatzc1a050a2017-10-10 15:49:28 -0700490/**
491 * Logs Battery Saver state change.
492 *
493 * Logged from:
494 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
495 */
496message BatterySaverModeStateChanged {
497 enum State {
498 OFF = 0;
499 ON = 1;
500 }
501 optional State state = 1;
502}
503
504/**
505 * Logs Doze mode state change.
506 *
507 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800508 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700509 */
510message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800511 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800512}
513
514
515/**
516 * Logs state change of Doze mode including maintenance windows.
517 *
518 * Logged from:
519 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
520 */
521message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800522 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700523}
524
525/**
526 * Logs screen brightness level.
527 *
528 * Logged from:
529 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
530 */
531message ScreenBrightnessChanged {
532 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
533 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700534}
535
536/**
537 * Logs battery level (percent full, from 0 to 100).
538 *
539 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700540 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700541 */
542message BatteryLevelChanged {
543 // Battery level. Should be in [0, 100].
544 optional int32 battery_level = 1;
545}
546
547/**
548 * Logs change in charging status of the device.
549 *
550 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700551 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700552 */
553message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800554 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
555 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700556}
557
558/**
559 * Logs whether the device is plugged in, and what power source it is using.
560 *
561 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700562 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700563 */
564message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800565 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
566 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700567}
568
Bookatz8c6571b2017-10-24 15:04:41 -0700569/**
570 * Logs when an app's wakeup alarm fires.
571 *
572 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700573 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700574 */
575message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800576 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800577
578 // Name of the wakeup alarm.
579 optional string tag = 2;
580}
581
582/**
583 * Logs when an an app causes the mobile radio to change state.
584 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
585 *
586 * Logged from:
587 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
588 */
589message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800590 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800591
Bookatz1a1b0462018-01-12 11:47:03 -0800592 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
593 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800594}
595
596/**
597 * Logs when an an app causes the wifi radio to change state.
598 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
599 *
600 * Logged from:
601 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
602 */
603message WifiRadioPowerStateChanged {
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;
Bookatz8c6571b2017-10-24 15:04:41 -0700608}
609
610/**
611 * Logs kernel wakeup reasons and aborts.
612 *
613 * Logged from:
614 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
615 */
616message KernelWakeupReported {
617 // Name of the kernel wakeup reason (or abort).
618 optional string wakeup_reason_name = 1;
619
620 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800621 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700622}
623
624/**
625 * Logs wifi locks held by an app.
626 *
627 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700628 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700629 */
630message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800631 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700632
633 enum State {
634 OFF = 0;
635 ON = 1;
636 }
637 optional State state = 2;
638}
639
640/**
641 * Logs wifi signal strength changes.
642 *
643 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700644 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700645 */
646message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800647 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
648 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700649}
650
651/**
652 * Logs wifi scans performed by an app.
653 *
654 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700655 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700656 */
657message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800658 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700659
660 enum State {
661 OFF = 0;
662 ON = 1;
663 }
664 optional State state = 2;
665}
666
667/**
Tej Singh4503e102018-01-04 14:35:01 -0800668 * Logs wifi multicast locks held by an app
669 *
670 * Logged from:
671 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
672 */
673message WifiMulticastLockStateChanged {
674 repeated AttributionNode attribution_node = 1;
675
676 enum State {
677 OFF = 0;
678 ON = 1;
679 }
680 optional State state = 2;
681}
682
683/**
Tej Singh1ea42892018-01-19 09:27:00 -0800684 * Logs shutdown reason and duration on next boot.
685 *
686 * Logged from:
687 * frameworks/base/core/java/com/android/server/BootReceiver.java
688 */
689message ShutdownSequenceReported {
690 // True if shutdown is for a reboot. Default: false if we do not know.
691 optional bool reboot = 1;
692
693 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
694 optional string reason = 2;
695
696 // Beginning of shutdown time in ms using wall clock time since unix epoch.
697 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800698 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800699
700 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800701 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800702}
703
Tej Singh6483ea42018-01-25 17:45:49 -0800704
705/**
706 * Logs boot reason and duration.
707 *
708 * Logged from:
709 * system/core/bootstat/bootstat.cpp
710 */
711message BootSequenceReported {
712 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
713 // Default: "<EMPTY>" if not available.
714 optional string bootloader_reason = 1;
715
716 // Reason for system boot. Eg. bootloader, reboot,userrequested
717 // Default: "<EMPTY>" if not available.
718 optional string system_reason = 2;
719
720 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800721 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800722
723 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800724 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800725
726 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800727 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800728
729 // Time since last boot in ms. Default: 0 if not available.
730 optional int64 time_since_last_boot = 6;
731}
732
Tej Singhc477d9c2018-02-05 18:31:39 -0800733
734/**
735 * Logs call state and disconnect cause (if applicable).
736 *
737 * Logged from:
738 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
739 */
740message CallStateChanged {
741 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
742 // From frameworks/base/core/proto/android/telecomm/enums.proto.
743 optional android.telecom.CallStateEnum call_state = 1;
744
745 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
746 // This value is only applicable when the call_state is DISCONNECTED, and
747 // should always be UNKNOWN if the call_state is not DISCONNECTED.
748 // From frameworks/base/core/proto/android/telecomm/enums.proto.
749 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
750
751 // True if the call is self-managed, which are apps that use the
752 // telecom infrastructure to make their own calls.
753 optional bool self_managed = 3;
754
755 // True if call is external. External calls are calls on connected Wear
756 // devices but show up in Telecom so the user can pull them onto the device.
757 optional bool external_call = 4;
758}
759
Tej Singh1ea42892018-01-19 09:27:00 -0800760/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800761 * Logs keyguard state. The keyguard is the lock screen.
762 *
763 * Logged from:
764 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
765 */
766message KeyguardStateChanged {
767 enum State {
768 UNKNOWN = 0;
769 // The keyguard is hidden when the phone is unlocked.
770 HIDDEN = 1;
771 // The keyguard is shown when the phone is locked (screen turns off).
772 SHOWN= 2;
773 // The keyguard is occluded when something is overlaying the keyguard.
774 // Eg. Opening the camera while on the lock screen.
775 OCCLUDED = 3;
776 }
777 optional State state = 1;
778}
779
780/**
781 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
782 * prompts the user to enter a password (pattern, pin, etc).
783 *
784 * Logged from:
785 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
786 */
787
788message KeyguardBouncerStateChanged {
789 enum State {
790 UNKNOWN = 0;
791 // Bouncer is hidden, either as a result of successfully entering the
792 // password, screen timing out, or user going back to lock screen.
793 HIDDEN = 1;
794 // This is when the user is being prompted to enter the password.
795 SHOWN = 2;
796 }
797 optional State state = 1;
798}
799
800/**
801 * Logs the result of entering a password into the keyguard bouncer.
802 *
803 * Logged from:
804 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
805 */
806message KeyguardBouncerPasswordEntered {
807 enum BouncerResult {
808 UNKNOWN = 0;
809 // The password entered was incorrect.
810 FAILURE = 1;
811 // The password entered was correct.
812 SUCCESS = 2;
813 }
814 optional BouncerResult result = 1;
815}
816
Tej Singha883b372018-02-15 11:30:01 -0800817/*
818 * Logs changes to the configuration of the device. The configuration is defined
819 * in frameworks/base/core/java/android/content/res/Configuration.java
820 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
821 * Please go there to interpret the possible values each field can be.
822 *
823 * Logged from:
824 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
825 */
826message ResourceConfigurationChanged {
827 // Bit mask of color capabilities of the screen.
828 // Contains information about the color gamut and hdr mode of the screen.
829 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
830 optional int32 colorMode = 1;
831
832 // The target screen density being rendered to.
833 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
834 optional int32 densityDpi = 2;
835
836 // Current user preference for the scaling factor for fonts,
837 // relative to the base density scaling.
838 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
839 optional float fontScale = 3;
840
841 // Flag indicating whether the hard keyboard is hidden.
842 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
843 optional int32 hardKeyboardHidden = 4;
844
845 // The type of keyboard attached to the device.
846 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
847 optional int32 keyboard = 5;
848
849 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
850 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
851 optional int32 keyboardHideen = 6;
852
853 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
854 // 0 if undefined.
855 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
856 optional int32 mcc = 7;
857
858 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
859 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
860 // MNC_ZERO symbol defined in Configuration.java.
861 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
862 optional int32 mnc = 8;
863
864 // The kind of navigation available on the device.
865 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
866 optional int32 navigation = 9;
867
868 // Flag indicating whether the navigation is available.
869 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
870 optional int32 navigationHidden = 10;
871
872 // Overall orientation of the screen.
873 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
874 optional int32 orientation = 11;
875
876 // The current height of the available screen space, in dp units.
877 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
878 optional int32 screenHeightDp = 12;
879
880 // Bit mask of overall layout of the screen.
881 // Contains information about screen size, whether the screen is wider/taller
882 // than normal, whether the screen layout is right-tl-left or left-to-right,
883 // and whether the screen has a rounded shape.
884 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
885 optional int32 screenLayout = 13;
886
887 // Current width of the available screen space, in dp units.
888 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
889 optional int32 screenWidthDp = 14;
890
891 // The smallest screen size an application will see in normal operation.
892 // This is the smallest value of both screenWidthDp and screenHeightDp
893 // in portrait and landscape.
894 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
895 optional int32 smallestScreenWidthDp = 15;
896
897 // The type of touch screen attached to the device.
898 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
899 optional int32 touchscreen = 16;
900
901 // Bit mask of the ui mode.
902 // Contains information about the overall ui mode of the device.
903 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
904 // Also contains information about whether the device is in night mode.
905 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
906 optional int32 uiMode = 17;
907}
908
Tej Singheee317b2018-03-07 19:28:05 -0800909
910/**
911 * Logs changes in the connection state of the mobile radio.
912 *
913 * Logged from:
914 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
915 */
916message MobileConnectionStateChanged {
917 // States are from the state machine DataConnection.java.
918 enum State {
919 UNKNOWN = 0;
920 // The connection is inactive, or disconnected.
921 INACTIVE = 1;
922 // The connection is being activated, or connecting.
923 ACTIVATING = 2;
924 // The connection is active, or connected.
925 ACTIVE = 3;
926 // The connection is disconnecting.
927 DISCONNECTING = 4;
928 // The connection is disconnecting after creating a connection.
929 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
930 }
931 optional State state = 1;
932 // For multi-sim phones, this distinguishes between the sim cards.
933 optional int32 sim_slot_index = 2;
934 // Used to identify the connection. Starts at 0 and increments by 1 for
935 // every new network created. Resets whenever the device reboots.
936 optional int32 data_connection_id = 3;
937 // A bitmask for the capabilities of this connection.
938 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
939 // Default value (if we have no information): 0
940 optional int64 capabilities = 4;
941 // If this connection has internet.
942 // This just checks if the DEFAULT bit of capabilities is set.
943 optional bool has_internet = 5;
944}
945
946/**
947 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
948 *
949 * Logged from:
950 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
951 */
952message MobileRadioTechnologyChanged {
953 optional android.telephony.NetworkTypeEnum state = 1;
954 // For multi-sim phones, this distinguishes between the sim cards.
955 optional int32 sim_slot_index = 2;
956}
957
Andrew Chantb56388b2018-03-22 21:07:33 -0700958/**
959 * Logs the VID and PID of any connected USB devices.
960 *
961 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
962 *
963 * Logged by Vendor.
964 */
965message UsbDeviceAttached {
966 optional int32 vid = 1;
967 optional int32 pid = 2;
968 optional bool has_audio = 3;
969 optional bool has_hid = 4;
970 optional bool has_storage = 5;
971}
972
Tej Singheee317b2018-03-07 19:28:05 -0800973
Tej Singhdd7bd352018-02-09 19:33:15 -0800974/**
Tej Singh5d991e12018-03-09 19:48:11 -0800975 * Logs when Bluetooth is enabled and disabled.
976 *
977 * Logged from:
978 * services/core/java/com/android/server/BluetoothManagerService.java
979 */
980message BluetoothEnabledStateChanged {
981 repeated AttributionNode attribution_node = 1;
982 // Whether or not bluetooth is enabled on the device.
983 enum State {
984 UNKNOWN = 0;
985 ENABLED = 1;
986 DISABLED = 2;
987 }
988 optional State state = 2;
989 // The reason for being enabled/disabled.
990 // Eg. Airplane mode, crash, application request.
991 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
992 // If the reason is an application request, this will be the package name.
993 optional string pkgName = 4;
994}
995
996/**
997 * Logs when a Bluetooth device connects and disconnects.
998 *
999 * Logged from:
1000 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1001 */
1002message BluetoothConnectionStateChanged {
1003 // The state of the connection.
1004 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1005 optional android.bluetooth.ConnectionStateEnum state = 1;
1006 // An identifier that can be used to match connect and disconnect events.
1007 // Currently is last two bytes of a hash of a device level ID and
1008 // the mac address of the bluetooth device that is connected.
1009 optional int32 obfuscated_id = 2;
1010 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1011 // From android.bluetooth.BluetoothAdapter.java
1012 optional int32 bt_profile = 3;
1013}
1014
1015/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001016 * Logs when something is plugged into or removed from the USB-C connector.
1017 *
1018 * Logged from:
1019 * Vendor USB HAL.
1020 */
1021message UsbConnectorStateChanged {
1022 enum State {
1023 DISCONNECTED = 0;
1024 CONNECTED = 1;
1025 }
1026 optional State state = 1;
1027}
1028
1029/**
1030 * Logs the reported speaker impedance.
1031 *
1032 * Logged from:
1033 * Vendor audio implementation.
1034 */
1035message SpeakerImpedanceReported {
1036 optional int32 speaker_location = 1;
1037 optional int32 impedance = 2;
1038}
1039
1040/**
1041 * Logs the report of a failed hardware.
1042 *
1043 * Logged from:
1044 * Vendor HALs.
1045 *
1046 */
1047message HardwareFailed {
1048 enum HardwareType {
1049 HARDWARE_FAILED_UNKNOWN = 0;
1050 HARDWARE_FAILED_MICROPHONE = 1;
1051 HARDWARE_FAILED_CODEC = 2;
1052 HARDWARE_FAILED_SPEAKER = 3;
1053 HARDWARE_FAILED_FINGERPRINT = 4;
1054 }
1055 optional HardwareType hardware_type = 1;
1056
1057 /* hardware_location allows vendors to differentiate between multiple instances of
1058 * the same hardware_type. The specific locations are vendor defined integers,
1059 * referring to board-specific numbering schemes.
1060 */
1061 optional int32 hardware_location = 2;
1062
1063 /* failure_code is specific to the HardwareType of the failed hardware.
1064 * It should use the enum values defined below.
1065 */
1066 enum MicrophoneFailureCode {
1067 MICROPHONE_FAILURE_COMPLETE = 0;
1068 }
1069 enum CodecFailureCode {
1070 CODEC_FAILURE_COMPLETE = 0;
1071 }
1072 enum SpeakerFailureCode {
1073 SPEAKER_FAILURE_COMPLETE = 0;
1074 SPEAKER_FAILURE_HIGH_Z = 1;
1075 SPEAKER_FAILURE_SHORT = 2;
1076 }
1077 enum FingerprintFailureCode {
1078 FINGERPRINT_FAILURE_COMPLETE = 0;
1079 FINGERPRINT_SENSOR_BROKEN = 1;
1080 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1081 }
1082 optional int32 failure_code = 3;
1083}
1084
1085/**
1086 * Log an event when the device has been physically dropped.
1087 * Reported from the /vendor partition.
1088 */
1089message PhysicalDropDetected {
1090 // Confidence that the event was actually a drop, 0 -> 100
1091 optional int32 confidence_pctg = 1;
1092 // Peak acceleration of the drop, in 1/1000s of a g.
1093 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001094 // Duration of freefall in ms
1095 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001096}
1097
1098/**
1099 * Log bucketed battery charge cycles.
1100 *
1101 * Each bucket represents cycles of the battery past
1102 * a given charge point. For example, bucket 1 is the
1103 * lowest 1/8th of the battery, and bucket 8 is 100%.
1104 *
1105 * Logged from:
1106 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1107 */
1108message ChargeCyclesReported {
1109 optional int32 cycle_bucket_1 = 1;
1110 optional int32 cycle_bucket_2 = 2;
1111 optional int32 cycle_bucket_3 = 3;
1112 optional int32 cycle_bucket_4 = 4;
1113 optional int32 cycle_bucket_5 = 5;
1114 optional int32 cycle_bucket_6 = 6;
1115 optional int32 cycle_bucket_7 = 7;
1116 optional int32 cycle_bucket_8 = 8;
1117}
1118
1119/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001120 * Logs the duration of a davey (jank of >=700ms) when it occurs
1121 *
1122 * Logged from:
1123 * frameworks/base/libs/hwui/JankTracker.cpp
1124 */
1125message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001126 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001127 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001128
Tej Singhbb8554a2018-01-26 11:59:14 -08001129 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001130 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001131}
1132
1133/**
Bookatze5885242017-10-24 20:10:31 -07001134 * Logs phone signal strength changes.
1135 *
1136 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001137 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001138 */
1139message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001140 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1141 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001142}
1143
Yangster4ccebea2018-10-09 17:09:02 -07001144
1145/**
1146 * Logs when the phone state, sim state or signal strength changes
1147 *
1148 * Logged from:
1149 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1150 */
1151message PhoneServiceStateChanged {
1152 optional android.telephony.ServiceStateEnum state = 1;
1153 optional android.telephony.SimStateEnum sim_state = 2;
1154 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1155}
1156
1157/**
1158 * Logs when the phone becomes on or off.
1159 *
1160 * Logged from:
1161 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1162 */
1163message PhoneStateChanged {
1164 enum State {
1165 OFF = 0;
1166 ON = 1;
1167 }
1168 optional State state = 1;
1169}
1170
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001171message LauncherUIChanged {
Yao Chen046b5122018-10-24 14:09:20 -07001172 optional android.stats.launcher.LauncherAction action = 1;
1173 optional android.stats.launcher.LauncherState src_state = 2;
1174 optional android.stats.launcher.LauncherState dst_state = 3;
1175 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001176 optional bool is_swipe_up_enabled = 5;
1177}
1178
David Chenc28b2bb2017-10-24 12:52:52 -07001179/**
1180 * Logs that a setting was updated.
1181 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001182 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001183 * The tag and is_default allow resetting of settings to default values based on the specified
1184 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1185 */
1186message SettingChanged {
1187 // The name of the setting.
1188 optional string setting = 1;
1189
1190 // The change being imposed on this setting. May represent a number, eg "3".
1191 optional string value = 2;
1192
1193 // The new value of this setting. For most settings, this is same as value. For some settings,
1194 // value is +X or -X where X represents an element in a set. For example, if the previous value
1195 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1196 // The +/- feature is currently only used for location_providers_allowed.
1197 optional string new_value = 3;
1198
1199 // The previous value of this setting.
1200 optional string prev_value = 4;
1201
1202 // The tag used with the is_default for resetting sets of settings. This is generally null.
1203 optional string tag = 5;
1204
Bookatz90867622018-01-31 15:05:57 -08001205 // True if this setting with tag should be resettable.
1206 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001207
David Chenbd789912018-03-16 17:19:55 -07001208 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001209 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001210
1211 enum ChangeReason {
1212 UPDATED = 1; // Updated can be an insertion or an update.
1213 DELETED = 2;
1214 }
1215 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001216}
Chenjie Yub3dda412017-10-24 13:41:59 -07001217
Chenjie Yu05013b32017-11-21 10:21:41 -08001218/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001219 * Logs activity going to foreground or background
1220 *
1221 * Logged from:
1222 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1223 */
1224message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001225 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001226 optional string pkg_name = 2;
1227 optional string class_name = 3;
1228
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001229 enum State {
1230 BACKGROUND = 0;
1231 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001232 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001233 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001234}
David Chenc8a43242017-10-17 16:23:28 -07001235
1236/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001237 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001238 * Logged from:
1239 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1240 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001241message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001242 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001243
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001244 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001245
1246 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001247 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001248 optional string process_name = 3;
1249
1250 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001251 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001252
1253 optional string package_name = 5;
1254
1255 enum InstantApp {
1256 UNAVAILABLE = 0;
1257 FALSE = 1;
1258 TRUE = 2;
1259 }
1260 optional InstantApp is_instant_app = 6;
1261
1262 enum ForegroundState {
1263 UNKNOWN = 0;
1264 BACKGROUND = 1;
1265 FOREGROUND = 2;
1266 }
1267 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001268}
David Chen9e3808c2017-11-20 17:25:34 -08001269
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001270/**
1271 * Logs when a WTF (What a Terrible Failure) happened.
1272 * Logged from:
1273 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1274 */
1275message WTFOccurred {
1276 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001277
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001278 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001279
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001280 // The name of the process.
1281 // system_server if it is not by an app
1282 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001283
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001284 // The pid if available. -1 means not available.
1285 optional sint32 pid = 4;
1286}
1287
1288/**
1289 * Logs when system server reports low memory.
1290 * Logged from:
1291 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1292 */
1293message LowMemReported {
1294}
1295
1296/**
1297 * Logs when an app ANR (App Not Responding) occurs.
1298 * Logged from:
1299 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1300 */
1301message ANROccurred {
1302 optional int32 uid = 1 [(is_uid) = true];
1303
1304 optional string process_name = 2;
1305
1306 optional string short_component_name = 3;
1307
1308 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001309
1310 enum InstantApp {
1311 UNAVAILABLE = 0;
1312 FALSE = 1;
1313 TRUE = 2;
1314 }
1315 optional InstantApp is_instant_app = 5;
1316
1317 enum ForegroundState {
1318 UNKNOWN = 0;
1319 BACKGROUND = 1;
1320 FOREGROUND = 2;
1321 }
1322 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08001323}
1324
David Chen0a368b22017-12-06 16:28:16 -08001325/*
1326 * Allows other apps to push events into statsd.
1327 * Logged from:
1328 * frameworks/base/core/java/android/util/StatsLog.java
1329 */
David Chen0b5c90c2018-01-25 16:51:49 -08001330message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001331 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001332 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001333
1334 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1335 optional int32 label = 2;
1336
1337 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1338 // predicates for the metrics).
1339 enum State {
1340 UNKNOWN = 0;
1341 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1342 STOP = 2;
1343 START = 3;
1344 }
1345 optional State state = 3;
1346}
1347
David Chen9e3808c2017-11-20 17:25:34 -08001348/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001349 * Logs when statsd detects an anomaly.
1350 *
1351 * Logged from:
1352 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1353 */
1354message AnomalyDetected {
1355 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001356 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001357
Yangster-mac94e197c2018-01-02 16:03:03 -08001358 // Id of the config whose anomaly detection alert fired.
1359 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001360
Yangster-mac94e197c2018-01-02 16:03:03 -08001361 // Id of the alert (i.e. name of the anomaly that was detected).
1362 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001363}
1364
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001365message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001366 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001367 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001368
1369 // The app package name.
1370 optional string pkg_name = 2;
1371
1372 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001373 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001374 WARM = 1;
1375 HOT = 2;
1376 COLD = 3;
1377 }
1378 // The transition type.
1379 optional TransitionType type = 3;
1380
1381 // The activity name.
1382 optional string activity_name = 4;
1383
1384 // The name of the calling app. Empty if not set.
1385 optional string calling_pkg_name = 5;
1386
1387 // Whether the app is an instant app.
1388 optional bool is_instant_app = 6;
1389
1390 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001391 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001392
Bookatz80d11a02018-01-16 10:46:35 -08001393 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001394
David Chen0b5c90c2018-01-25 16:51:49 -08001395 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001396 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001397 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001398 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001399 optional int32 bind_application_delay_millis = 11;
1400 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001401
1402 // Empty if not set.
1403 optional string launch_token = 13;
1404
Calin Juravle759fbda2018-02-20 19:52:30 +00001405 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001406 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001407
1408 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001409 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001410}
1411
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001412message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001413 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001414 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001415
1416 // The app package name.
1417 optional string pkg_name = 2;
1418
1419 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001420 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001421 WARM = 1;
1422 HOT = 2;
1423 COLD = 3;
1424 }
1425 // The transition type.
1426 optional TransitionType type = 3;
1427
1428 // The activity name.
1429 optional string activity_name = 4;
1430}
1431
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001432message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001433 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001434 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001435
1436 // The app package name.
1437 optional string pkg_name = 2;
1438
1439 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001440 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001441 WITH_BUNDLE = 1;
1442 WITHOUT_BUNDLE = 2;
1443 }
1444 // The transition type.
1445 optional TransitionType type = 3;
1446
1447 // The activity name.
1448 optional string activity_name = 4;
1449
1450 optional bool transition_process_running = 5;
1451
1452 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001453 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001454}
1455
Bookatz8fcd09a2017-12-18 13:01:10 -08001456/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001457 * Logs a picture-in-picture action
1458 * Logged from:
1459 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1460 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1461 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1462 */
1463message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001464 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001465 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001466
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001467 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001468
Chenjie Yu52cacc62017-12-08 18:11:45 -08001469 enum State {
1470 ENTERED = 1;
1471 EXPANDED_TO_FULL_SCREEN = 2;
1472 MINIMIZED = 3;
1473 DISMISSED = 4;
1474 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001475 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001476}
1477
1478/**
Chenjie Yue8904192017-12-08 19:12:57 -08001479 * Logs overlay action
1480 * Logged from:
1481 * services/core/java/com/android/server/wm/Session.java
1482 */
1483message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001484 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001485
1486 optional string package_name = 2;
1487
1488 optional bool using_alert_window = 3;
1489
1490 enum State {
1491 ENTERED = 1;
1492 EXITED = 2;
1493 }
1494 optional State state = 4;
1495}
1496
Chenjie Yuccfe6452018-01-30 11:33:21 -08001497/*
1498 * Logs foreground service starts and stops.
1499 * Note that this is not when a service starts or stops, but when it is
1500 * considered foreground.
1501 * Logged from
1502 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1503 */
1504message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001505 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001506 // package_name + "/" + class_name
1507 optional string short_name = 2;
1508
1509 enum State {
1510 ENTER = 1;
1511 EXIT = 2;
1512 }
1513 optional State state = 3;
1514}
1515
Chenjie Yue8904192017-12-08 19:12:57 -08001516/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001517 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1518 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1519 * attributed back to the parent (host) uid. One example is Chrome.
1520 *
1521 * Logged from:
1522 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1523 */
1524message IsolatedUidChanged {
1525 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001526 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001527 optional int32 parent_uid = 1;
1528
1529 optional int32 isolated_uid = 2;
1530
1531 // We expect an isolated uid to be removed before if it's used for another parent uid.
1532 enum Event {
1533 REMOVED = 0;
1534 CREATED = 1;
1535 }
1536 optional Event event = 3;
1537}
1538
1539/*
1540 * Logs the reception of an incoming network packet causing the main system to wake up for
1541 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1542 * and processed by WakeupController.cpp.
1543 */
1544message PacketWakeupOccurred {
1545 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1546 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001547 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001548 // The interface name on which the packet was received.
1549 optional string iface = 2;
1550 // The ethertype value of the packet.
1551 optional int32 ethertype = 3;
1552 // String representation of the destination MAC address of the packet.
1553 optional string destination_hardware_address = 4;
1554 // String representation of the source address of the packet if this was an IP packet.
1555 optional string source_ip = 5;
1556 // String representation of the destination address of the packet if this was an IP packet.
1557 optional string destination_ip = 6;
1558 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1559 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1560 // families.
1561 optional int32 ip_next_header = 7;
1562 // The source port if this was a TCP or UDP packet.
1563 optional int32 source_port = 8;
1564 // The destination port if this was a TCP or UDP packet.
1565 optional int32 destination_port = 9;
1566}
1567
1568/*
1569 * Logs the memory stats for an app on startup.
1570 * Logged from:
1571 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1572 */
1573message AppStartMemoryStateCaptured {
1574 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001575 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001576
1577 // The process name.
1578 optional string process_name = 2;
1579
1580 // The activity name.
1581 optional string activity_name = 3;
1582
1583 // # of page-faults
1584 optional int64 pgfault = 4;
1585
1586 // # of major page-faults
1587 optional int64 pgmajfault = 5;
1588
1589 // RSS
1590 optional int64 rss_in_bytes = 6;
1591
1592 // CACHE
1593 optional int64 cache_in_bytes = 7;
1594
1595 // SWAP
1596 optional int64 swap_in_bytes = 8;
1597}
1598
1599/*
1600 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1601 * for LMK event.
1602 * Logged from:
1603 * system/core/lmkd/lmkd.c
1604 */
1605message LmkStateChanged {
1606 enum State {
1607 UNKNOWN = 0;
1608 START = 1;
1609 STOP = 2;
1610 }
1611 optional State state = 1;
1612}
1613
1614/*
1615 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1616 * Logged from:
1617 * system/core/lmkd/lmkd.c
1618 */
1619message LmkKillOccurred {
1620 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001621 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001622
1623 // The process name.
1624 optional string process_name = 2;
1625
1626 // oom adj score.
1627 optional int32 oom_score = 3;
1628
1629 // # of page-faults
1630 optional int64 pgfault = 4;
1631
1632 // # of major page-faults
1633 optional int64 pgmajfault = 5;
1634
1635 // RSS
1636 optional int64 rss_in_bytes = 6;
1637
1638 // CACHE
1639 optional int64 cache_in_bytes = 7;
1640
1641 // SWAP
1642 optional int64 swap_in_bytes = 8;
Jim Blackler972a5c52018-11-21 15:24:48 +00001643
1644 // The elapsed real time of start of the process.
1645 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001646}
1647
Rajeev Kumar51b54602018-03-01 12:18:26 -08001648/*
1649 * Logs when the ActivityManagerService detects that an app died.
1650 *
1651 * Logged from:
1652 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1653 */
1654message AppDied {
1655 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07001656 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08001657}
1658
Chenjie Yubbcbc602018-02-05 16:51:52 -08001659//////////////////////////////////////////////////////////////////////
1660// Pulled atoms below this line //
1661//////////////////////////////////////////////////////////////////////
1662
1663/**
David Chenc8a43242017-10-17 16:23:28 -07001664 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
1665 *
1666 * Pulled from:
1667 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1668 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001669message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001670 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001671
1672 optional int64 rx_bytes = 2;
1673
1674 optional int64 rx_packets = 3;
1675
1676 optional int64 tx_bytes = 4;
1677
1678 optional int64 tx_packets = 5;
1679}
1680
1681/**
1682 * Pulls bytes transferred via wifi (separated by foreground and background usage).
1683 *
1684 * Pulled from:
1685 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1686 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001687message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001688 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001689
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001690 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
1691 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07001692
1693 optional int64 rx_bytes = 3;
1694
1695 optional int64 rx_packets = 4;
1696
1697 optional int64 tx_bytes = 5;
1698
1699 optional int64 tx_packets = 6;
1700}
1701
1702/**
1703 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
1704 *
1705 * Pulled from:
1706 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1707 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001708message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001709 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001710
1711 optional int64 rx_bytes = 2;
1712
1713 optional int64 rx_packets = 3;
1714
1715 optional int64 tx_bytes = 4;
1716
1717 optional int64 tx_packets = 5;
1718}
1719
1720/**
1721 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
1722 *
1723 * Pulled from:
1724 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1725 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001726message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001727 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001728
Yao Chenc40a19d2018-03-15 16:48:25 -07001729 // 1 denotes foreground and 0 denotes background. This is called Set in
1730 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001731 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07001732
1733 optional int64 rx_bytes = 3;
1734
1735 optional int64 rx_packets = 4;
1736
1737 optional int64 tx_bytes = 5;
1738
1739 optional int64 tx_packets = 6;
1740}
1741
1742/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001743 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
1744 *
1745 * Pulled from:
1746 * StatsCompanionService
1747 */
1748message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001749 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001750
1751 optional int64 rx_bytes = 2;
1752
1753 optional int64 tx_bytes = 3;
1754}
1755
1756/**
David Chenc8a43242017-10-17 16:23:28 -07001757 * Pulls the kernel wakelock durations. This atom is adapted from
1758 * android/internal/os/KernelWakelockStats.java
1759 *
1760 * Pulled from:
1761 * StatsCompanionService using KernelWakelockReader.
1762 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001763message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07001764 optional string name = 1;
1765
1766 optional int32 count = 2;
1767
1768 optional int32 version = 3;
1769
1770 optional int64 time = 4;
1771}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001772
Chenjie Yu05013b32017-11-21 10:21:41 -08001773/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001774 * Pulls low power state information. This includes platform and subsystem sleep state information,
1775 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001776 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001777 * hardware/interfaces/power/1.1/types.hal
1778 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001779message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08001780 // Subsystem name
1781 optional string subsystem_name = 1;
1782 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
1783 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
1784 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001785 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08001786 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001787 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08001788 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07001789}
Chenjie Yu7f8def92017-11-03 09:33:15 -07001790
Chenjie Yu05013b32017-11-21 10:21:41 -08001791/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07001792 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08001793 * Pulls the time the cpu spend on the frequency index. Frequency index
1794 * starts from highest to lowest. The value should be monotonically
1795 * increasing since boot. However, if there is a cpu
1796 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07001797 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001798message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07001799 optional uint32 cluster = 1;
1800 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001801 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07001802}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001803
Chenjie Yu05013b32017-11-21 10:21:41 -08001804/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001805 * Pulls Cpu Time Per Uid.
1806 * Note that isolated process uid time should be attributed to host uids.
1807 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001808message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07001809 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00001810 optional uint64 user_time_micros = 2;
1811 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001812}
1813
1814/**
1815 * Pulls Cpu Time Per Uid per frequency.
1816 * Note that isolated process uid time should be attributed to host uids.
1817 * For each uid, we order the time by descending frequencies.
1818 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001819message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07001820 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001821 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001822 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001823}
Hugo Benichi884970e2017-11-14 22:42:46 +09001824
Chenjie Yu05013b32017-11-21 10:21:41 -08001825/**
1826 * Pulls Wifi Controller Activity Energy Info
1827 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001828message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001829 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001830 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001831 // stack reported state
1832 // TODO: replace this with proto enum
1833 optional int32 stack_state = 2;
1834 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001835 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001836 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001837 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001838 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001839 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001840 // product of current(mA), voltage(V) and time(ms)
1841 optional uint64 controller_energy_used = 6;
1842}
1843
1844/**
1845 * Pulls Modem Activity Energy Info
1846 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001847message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001848 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001849 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001850 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001851 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08001852 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001853 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001854 /**
1855 * Tx power index
1856 * index 0 = tx_power < 0dBm
1857 * index 1 = 0dBm < tx_power < 5dBm
1858 * index 2 = 5dBm < tx_power < 15dBm
1859 * index 3 = 15dBm < tx_power < 20dBm
1860 * index 4 = tx_power > 20dBm
1861 */
1862 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08001863 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001864 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08001865 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001866 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08001867 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08001868 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08001869 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08001870 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08001871 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08001872 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08001873 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08001874 // product of current(mA), voltage(V) and time(ms)
1875 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08001876}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001877
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001878/**
1879 * Pulls Bluetooth Activity Energy Info
1880 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
1881 */
1882message BluetoothActivityInfo {
1883 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001884 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001885 // bluetooth stack state
1886 optional int32 bluetooth_stack_state = 2;
1887 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001888 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001889 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001890 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001891 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001892 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001893 // product of current(mA), voltage(V) and time(ms)
1894 optional uint64 energy_used = 6;
1895}
1896
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001897/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001898 * Logs the memory stats for a process.
1899 */
1900message ProcessMemoryState {
1901 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001902 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001903
1904 // The process name.
1905 optional string process_name = 2;
1906
1907 // oom adj score.
1908 optional int32 oom_score = 3;
1909
1910 // # of page-faults
1911 optional int64 pgfault = 4;
1912
1913 // # of major page-faults
1914 optional int64 pgmajfault = 5;
1915
Rajeev Kumar90235992018-01-29 11:06:48 -08001916 // RSS
1917 optional int64 rss_in_bytes = 6;
1918
1919 // CACHE
1920 optional int64 cache_in_bytes = 7;
1921
1922 // SWAP
1923 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001924}
1925
1926/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001927 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001928 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001929message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08001930 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001931}
1932
1933/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001934 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001935 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001936message SystemUptime {
1937 // Milliseconds since the system was booted.
1938 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
1939 // for external input).
1940 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08001941 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001942}
1943
1944/*
1945 * Reads from /proc/uid_concurrent_active_time which has the format:
1946 * active: X (X is # cores)
1947 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
1948 * [uid1]: [time-0] [time-1] [time-2] ... ...
1949 * ...
1950 * Time-N means the CPU time a UID spent running concurrently with N other processes.
1951 * The file contains a monotonically increasing count of time for a single boot.
1952 */
1953message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07001954 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001955 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001956}
1957
1958/**
1959 * Reads from /proc/uid_concurrent_policy_time which has the format:
1960 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
1961 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1962 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1963 * ...
1964 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
1965 * The file contains a monotonically increasing count of time for a single boot.
1966 */
1967message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07001968 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001969 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001970 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08001971}
1972
1973/*
1974 * Pulls free disk space, for data, system partition and temporary directory.
1975 */
1976message DiskSpace {
1977 // available bytes in data partition
1978 optional uint64 data_available_bytes = 1;
1979 // available bytes in system partition
1980 optional uint64 system_available_bytes = 2;
1981 // available bytes in download cache or temp directories
1982 optional uint64 temp_available_bytes = 3;
1983}
Tej Singhbf972d92018-01-10 20:51:13 -08001984
1985/**
1986 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08001987 * Pulled from:
1988 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08001989 */
1990message RemainingBatteryCapacity {
1991 optional int32 charge_uAh = 1;
1992}
1993
1994/**
1995 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08001996 * Pulled from:
1997 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08001998 */
1999message FullBatteryCapacity {
2000 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08002001}
2002
2003/**
Tej Singhd89137e2018-03-26 14:51:40 -07002004 * Pulls the temperature of various parts of the device.
2005 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002006 *
2007 * Pulled from:
2008 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2009 */
2010message Temperature {
2011 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2012 optional android.os.TemperatureTypeEnum sensor_location = 1;
2013
2014 // The name of the temperature source. Eg. CPU0
2015 optional string sensor_name = 2;
2016
Tej Singhd89137e2018-03-26 14:51:40 -07002017 // Temperature in tenths of a degree C.
2018 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08002019}