blob: 7cfa58fb7bba6ae824d042e42b39ae0bb9fc54ed [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";
Chiachang Wang67f24472019-01-15 15:14:00 +080027import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080028import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wang67f24472019-01-15 15:14:00 +080029import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080030import "frameworks/base/core/proto/android/server/enums.proto";
Yao Chen046b5122018-10-24 14:09:20 -070031import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080032import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080033import "frameworks/base/core/proto/android/telephony/enums.proto";
34import "frameworks/base/core/proto/android/view/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080035
Yao Chend54f9dd2017-10-17 17:37:48 +000036/**
Stefan Lafonae2df012017-11-14 09:17:21 -080037 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000038 * raw stats log events from the Android system, also known as "atoms."
39 *
40 * This field contains a single oneof with all of the available messages.
41 * The stats-log-api-gen tool runs as part of the Android build and
42 * generates the android.util.StatsLog class, which contains the constants
43 * and methods that Android uses to log.
44 *
Stefan Lafonae2df012017-11-14 09:17:21 -080045 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000046 * Instead, statsd on Android constructs these messages synthetically,
47 * in the format defined here and in stats_log.proto.
48 */
Stefan Lafonae2df012017-11-14 09:17:21 -080049message Atom {
50 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070051 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070052 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
53 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080054 // 3 is available for use
Bookatzc1a050a2017-10-10 15:49:28 -070055 BleScanResultReceived ble_scan_result_received = 4;
56 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080057 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070058 SyncStateChanged sync_state_changed = 7;
59 ScheduledJobStateChanged scheduled_job_state_changed = 8;
60 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070061 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080062 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
63 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
64 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Hyunyoung Songcc651c12018-10-17 13:35:32 -070065 // 14 - 18 are available
66 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080067 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
68 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
69 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070070 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080071 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070072 CameraStateChanged camera_state_changed = 25;
73 FlashlightStateChanged flashlight_state_changed = 26;
74 UidProcessStateChanged uid_process_state_changed = 27;
75 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
76 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070077 BatteryLevelChanged battery_level_changed = 30;
78 ChargingStateChanged charging_state_changed = 31;
79 PluggedStateChanged plugged_state_changed = 32;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080080 // 33 - 34 are available
Bookatz8c6571b2017-10-24 15:04:41 -070081 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
82 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070083 WifiLockStateChanged wifi_lock_state_changed = 37;
84 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
85 WifiScanStateChanged wifi_scan_state_changed = 39;
86 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070087 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070088 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070089 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090090 PacketWakeupOccurred packet_wakeup_occurred = 44;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080091 // 45 is available
Bookatz8fcd09a2017-12-18 13:01:10 -080092 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080093 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080094 AppStartOccurred app_start_occurred = 48;
95 AppStartCanceled app_start_canceled = 49;
96 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -080097 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -080098 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -080099 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800100 LmkStateChanged lmk_state_changed = 54;
101 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800102 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800103 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800104 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800105 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800106 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800107 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800108 KeyguardStateChanged keyguard_state_changed = 62;
109 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
110 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800111 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800112 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800113 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
114 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Tej Singh02200f92018-04-02 19:37:59 -0700115 // 69 is blank but need not be.
Andrew Chantb56388b2018-03-22 21:07:33 -0700116 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800117 SpeakerImpedanceReported speaker_impedance_reported = 71;
118 HardwareFailed hardware_failed = 72;
119 PhysicalDropDetected physical_drop_detected = 73;
120 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800121 MobileConnectionStateChanged mobile_connection_state_changed = 75;
122 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700123 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800124 AppCrashOccurred app_crash_occurred = 78;
125 ANROccurred anr_occurred = 79;
126 WTFOccurred wtf_occurred = 80;
Yangster4ccebea2018-10-09 17:09:02 -0700127 PhoneServiceStateChanged phone_service_state_changed = 94;
128 PhoneStateChanged phone_state_changed = 95;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800129 LowMemReported low_mem_reported = 81;
lifr35a7cf02018-12-12 16:38:04 +0800130 NetworkDnsEventReported network_dns_event_reported = 116;
Chiachang Wang67f24472019-01-15 15:14:00 +0800131 DataStallEvent data_stall_event = 121;
Yao Chend54f9dd2017-10-17 17:37:48 +0000132 }
David Chenc8a43242017-10-17 16:23:28 -0700133
David Chen6e3e6cb2018-01-03 16:14:06 -0800134 // Pulled events will start at field 10000.
Tej Singh40298312018-02-16 00:15:09 -0800135 // Next: 10022
David Chenc8a43242017-10-17 16:23:28 -0700136 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800137 WifiBytesTransfer wifi_bytes_transfer = 10000;
138 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
139 MobileBytesTransfer mobile_bytes_transfer = 10002;
140 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800141 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800142 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800143 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800144 CpuTimePerFreq cpu_time_per_freq = 10008;
145 CpuTimePerUid cpu_time_per_uid = 10009;
146 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800147 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800148 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800149 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800150 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800151 SystemElapsedRealtime system_elapsed_realtime = 10014;
152 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800153 CpuActiveTime cpu_active_time = 10016;
154 CpuClusterTime cpu_cluster_time = 10017;
Chenjie Yu937d7422018-01-10 16:37:53 -0800155 DiskSpace disk_space = 10018;
Tej Singhbf972d92018-01-10 20:51:13 -0800156 RemainingBatteryCapacity remaining_battery_capacity = 10019;
157 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800158 Temperature temperature = 10021;
David Chenc8a43242017-10-17 16:23:28 -0700159 }
yroa1fe77c2018-02-26 14:22:54 -0800160
Bookatz76aafcf2018-09-17 16:17:10 -0700161 // DO NOT USE field numbers above 100,000 in AOSP.
162 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
163 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700164}
165
Yao Chend54f9dd2017-10-17 17:37:48 +0000166/**
Yangster-mac20877162017-12-22 17:19:39 -0800167 * This proto represents a node of an attribution chain.
168 * Note: All attribution chains are represented as a repeated field of type
169 * AttributionNode. It is understood that in such arrays, the order is that
170 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000171 */
Yangster-mac20877162017-12-22 17:19:39 -0800172message AttributionNode {
173 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800174 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800175
Yangster-mac20877162017-12-22 17:19:39 -0800176 // The (optional) string tag for an element in the attribution chain. If the
177 // element has no tag, it is encoded as an empty string.
178 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700179}
180
Yao Chend54f9dd2017-10-17 17:37:48 +0000181/*
182 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800183 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000184 *
185 * RULES:
186 * - The field ids for each atom must start at 1, and count upwards by 1.
187 * Skipping field ids is not allowed.
188 * - These form an API, so renaming, renumbering or removing fields is
189 * not allowed between android releases. (This is not currently enforced,
190 * but there will be a tool to enforce this restriction).
191 * - The types must be built-in protocol buffer types, namely, no sub-messages
192 * are allowed (yet). The bytes type is also not allowed.
193 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800194 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000195 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800196 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000197 * - A field that is a uid should be a string field, tagged with the [xxx]
198 * annotation. The generated code on android will be represented by UIDs,
199 * and those UIDs will be translated in xxx to those strings.
200 *
201 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700202 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000203 * - If there is a UID, it goes first. Think in an object-oriented fashion.
204 * *****************************************************************************
205 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700206
Yao Chend54f9dd2017-10-17 17:37:48 +0000207/**
208 * Logs when the screen state changes.
209 *
210 * Logged from:
211 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
212 */
213message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800214 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800215 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700216}
Yao Chend54f9dd2017-10-17 17:37:48 +0000217
218/**
Bookatzc1a050a2017-10-10 15:49:28 -0700219 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000220 *
221 * Logged from:
222 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
223 */
Bookatzc1a050a2017-10-10 15:49:28 -0700224message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700225 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000226
Bookatzdb026a22018-01-10 19:01:56 -0800227 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800228 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000229}
230
231/**
Bookatzc1a050a2017-10-10 15:49:28 -0700232 * Logs that a process started, finished, crashed, or ANRed.
233 *
234 * Logged from:
235 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
236 */
237message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700238 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700239
David Chen0b5c90c2018-01-25 16:51:49 -0800240 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800241 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700242
Bookatzddccf0a2017-11-28 16:48:14 -0800243 // What lifecycle state the process changed to.
244 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800245 enum State {
246 FINISHED = 0;
247 STARTED = 1;
248 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800249 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800250 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700251}
252
Bookatzc1a050a2017-10-10 15:49:28 -0700253/**
254 * Logs when the ble scan state changes.
255 *
256 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700257 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700258 */
259message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800260 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700261
262 enum State {
263 OFF = 0;
264 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700265 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
266 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700267 }
268 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700269
Bookatze5ec0b42018-03-26 13:34:56 -0700270 // Does the scan have a filter.
271 optional bool is_filtered = 3;
272 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
273 optional bool is_first_match = 4;
274 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
275 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700276}
277
278/**
279 * Logs reporting of a ble scan finding results.
280 *
281 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700282 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700283 */
Bookatzae6738e2018-09-13 11:38:56 -0700284// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700285message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800286 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700287
288 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800289 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700290}
291
292/**
293 * Logs when a sensor state changes.
294 *
295 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700296 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700297 */
298message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800299 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700300
Bookatzc1a050a2017-10-10 15:49:28 -0700301 // The id (int) of the sensor.
302 optional int32 sensor_id = 2;
303
304 enum State {
305 OFF = 0;
306 ON = 1;
307 }
308 optional State state = 3;
309}
310
311
312/**
313 * Logs when GPS state changes.
314 *
315 * Logged from:
316 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
317 */
318message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800319 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700320
321 enum State {
322 OFF = 0;
323 ON = 1;
324 }
325 optional State state = 2;
326}
327
328
329/**
330 * Logs when a sync manager sync state changes.
331 *
332 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700333 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700334 */
335message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800336 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700337
David Chen0b5c90c2018-01-25 16:51:49 -0800338 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800339 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700340
341 enum State {
342 OFF = 0;
343 ON = 1;
344 }
345 optional State state = 3;
346}
347
348/**
349 * Logs when a job scheduler job state changes.
350 *
351 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700352 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700353 */
354message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800355 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700356
357 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800358 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700359
360 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800361 FINISHED = 0;
362 STARTED = 1;
363 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700364 }
365 optional State state = 3;
366
Tej Singh33a412b2018-03-16 18:43:59 -0700367 // The reason a job has stopped.
368 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700369 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700370 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700371}
372
373/**
374 * Logs when the audio state changes.
375 *
376 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700377 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700378 */
379message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800380 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700381
382 enum State {
383 OFF = 0;
384 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700385 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
386 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700387 }
388 optional State state = 2;
389}
390
391/**
392 * Logs when the video codec state changes.
393 *
394 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700395 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700396 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800397message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800398 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700399
400 enum State {
401 OFF = 0;
402 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700403 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
404 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700405 }
406 optional State state = 2;
407}
408
409/**
410 * Logs when the flashlight state changes.
411 *
412 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700413 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700414 */
415message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800416 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700417
418 enum State {
419 OFF = 0;
420 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700421 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
422 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700423 }
424 optional State state = 2;
425}
426
427/**
428 * Logs when the camera state changes.
429 *
430 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700431 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700432 */
433message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800434 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700435
436 enum State {
437 OFF = 0;
438 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700439 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
440 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700441 }
442 optional State state = 2;
443}
444
445/**
446 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000447 *
448 * Logged from:
449 * TODO
450 */
Bookatzd6746242017-10-24 18:39:35 -0700451message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800452 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000453
Bookatz1a1b0462018-01-12 11:47:03 -0800454 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
455 // From frameworks/base/core/proto/android/os/enums.proto.
456 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700457
458 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
459 optional string tag = 3;
460
461 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800462 RELEASE = 0;
463 ACQUIRE = 1;
464 CHANGE_RELEASE = 2;
465 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700466 }
467 optional State state = 4;
468}
469
470/**
Bookatzc1a050a2017-10-10 15:49:28 -0700471 * Logs when a partial wakelock is considered 'long' (over 1 min).
472 *
473 * Logged from:
474 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
475 */
476message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800477 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700478
Yao Chend54f9dd2017-10-17 17:37:48 +0000479 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
480 optional string tag = 2;
481
Bookatzc1a050a2017-10-10 15:49:28 -0700482 // TODO: I have no idea what this is.
483 optional string history_tag = 3;
484
485 enum State {
486 OFF = 0;
487 ON = 1;
488 }
489 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000490}
491
Bookatzc1a050a2017-10-10 15:49:28 -0700492/**
493 * Logs Battery Saver state change.
494 *
495 * Logged from:
496 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
497 */
498message BatterySaverModeStateChanged {
499 enum State {
500 OFF = 0;
501 ON = 1;
502 }
503 optional State state = 1;
504}
505
506/**
507 * Logs Doze mode state change.
508 *
509 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800510 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700511 */
512message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800513 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800514}
515
516
517/**
518 * Logs state change of Doze mode including maintenance windows.
519 *
520 * Logged from:
521 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
522 */
523message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800524 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700525}
526
527/**
528 * Logs screen brightness level.
529 *
530 * Logged from:
531 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
532 */
533message ScreenBrightnessChanged {
534 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
535 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700536}
537
538/**
539 * Logs battery level (percent full, from 0 to 100).
540 *
541 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700542 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700543 */
544message BatteryLevelChanged {
545 // Battery level. Should be in [0, 100].
546 optional int32 battery_level = 1;
547}
548
549/**
550 * Logs change in charging status of the device.
551 *
552 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700553 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700554 */
555message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800556 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
557 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700558}
559
560/**
561 * Logs whether the device is plugged in, and what power source it is using.
562 *
563 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700564 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700565 */
566message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800567 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
568 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700569}
570
Bookatz8c6571b2017-10-24 15:04:41 -0700571/**
572 * Logs when an app's wakeup alarm fires.
573 *
574 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700575 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700576 */
577message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800578 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800579
580 // Name of the wakeup alarm.
581 optional string tag = 2;
582}
583
584/**
585 * Logs when an an app causes the mobile radio to change state.
586 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
587 *
588 * Logged from:
589 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
590 */
591message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800592 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800593
Bookatz1a1b0462018-01-12 11:47:03 -0800594 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
595 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800596}
597
598/**
599 * Logs when an an app causes the wifi radio to change state.
600 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
601 *
602 * Logged from:
603 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
604 */
605message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800606 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800607
Bookatz1a1b0462018-01-12 11:47:03 -0800608 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
609 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700610}
611
612/**
613 * Logs kernel wakeup reasons and aborts.
614 *
615 * Logged from:
616 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
617 */
618message KernelWakeupReported {
619 // Name of the kernel wakeup reason (or abort).
620 optional string wakeup_reason_name = 1;
621
622 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800623 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700624}
625
626/**
627 * Logs wifi locks held by an app.
628 *
629 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700630 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700631 */
632message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800633 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700634
635 enum State {
636 OFF = 0;
637 ON = 1;
638 }
639 optional State state = 2;
640}
641
642/**
643 * Logs wifi signal strength changes.
644 *
645 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700646 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700647 */
648message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800649 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
650 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700651}
652
653/**
654 * Logs wifi scans performed by an app.
655 *
656 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700657 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700658 */
659message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800660 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700661
662 enum State {
663 OFF = 0;
664 ON = 1;
665 }
666 optional State state = 2;
667}
668
669/**
Tej Singh4503e102018-01-04 14:35:01 -0800670 * Logs wifi multicast locks held by an app
671 *
672 * Logged from:
673 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
674 */
675message WifiMulticastLockStateChanged {
676 repeated AttributionNode attribution_node = 1;
677
678 enum State {
679 OFF = 0;
680 ON = 1;
681 }
682 optional State state = 2;
683}
684
685/**
Tej Singh1ea42892018-01-19 09:27:00 -0800686 * Logs shutdown reason and duration on next boot.
687 *
688 * Logged from:
689 * frameworks/base/core/java/com/android/server/BootReceiver.java
690 */
691message ShutdownSequenceReported {
692 // True if shutdown is for a reboot. Default: false if we do not know.
693 optional bool reboot = 1;
694
695 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
696 optional string reason = 2;
697
698 // Beginning of shutdown time in ms using wall clock time since unix epoch.
699 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800700 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800701
702 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800703 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800704}
705
Tej Singh6483ea42018-01-25 17:45:49 -0800706
707/**
708 * Logs boot reason and duration.
709 *
710 * Logged from:
711 * system/core/bootstat/bootstat.cpp
712 */
713message BootSequenceReported {
714 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
715 // Default: "<EMPTY>" if not available.
716 optional string bootloader_reason = 1;
717
718 // Reason for system boot. Eg. bootloader, reboot,userrequested
719 // Default: "<EMPTY>" if not available.
720 optional string system_reason = 2;
721
722 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800723 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800724
725 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800726 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800727
728 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800729 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800730
731 // Time since last boot in ms. Default: 0 if not available.
732 optional int64 time_since_last_boot = 6;
733}
734
Tej Singhc477d9c2018-02-05 18:31:39 -0800735
736/**
737 * Logs call state and disconnect cause (if applicable).
738 *
739 * Logged from:
740 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
741 */
742message CallStateChanged {
743 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
744 // From frameworks/base/core/proto/android/telecomm/enums.proto.
745 optional android.telecom.CallStateEnum call_state = 1;
746
747 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
748 // This value is only applicable when the call_state is DISCONNECTED, and
749 // should always be UNKNOWN if the call_state is not DISCONNECTED.
750 // From frameworks/base/core/proto/android/telecomm/enums.proto.
751 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
752
753 // True if the call is self-managed, which are apps that use the
754 // telecom infrastructure to make their own calls.
755 optional bool self_managed = 3;
756
757 // True if call is external. External calls are calls on connected Wear
758 // devices but show up in Telecom so the user can pull them onto the device.
759 optional bool external_call = 4;
760}
761
Tej Singh1ea42892018-01-19 09:27:00 -0800762/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800763 * Logs keyguard state. The keyguard is the lock screen.
764 *
765 * Logged from:
766 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
767 */
768message KeyguardStateChanged {
769 enum State {
770 UNKNOWN = 0;
771 // The keyguard is hidden when the phone is unlocked.
772 HIDDEN = 1;
773 // The keyguard is shown when the phone is locked (screen turns off).
774 SHOWN= 2;
775 // The keyguard is occluded when something is overlaying the keyguard.
776 // Eg. Opening the camera while on the lock screen.
777 OCCLUDED = 3;
778 }
779 optional State state = 1;
780}
781
782/**
783 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
784 * prompts the user to enter a password (pattern, pin, etc).
785 *
786 * Logged from:
787 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
788 */
789
790message KeyguardBouncerStateChanged {
791 enum State {
792 UNKNOWN = 0;
793 // Bouncer is hidden, either as a result of successfully entering the
794 // password, screen timing out, or user going back to lock screen.
795 HIDDEN = 1;
796 // This is when the user is being prompted to enter the password.
797 SHOWN = 2;
798 }
799 optional State state = 1;
800}
801
802/**
803 * Logs the result of entering a password into the keyguard bouncer.
804 *
805 * Logged from:
806 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
807 */
808message KeyguardBouncerPasswordEntered {
809 enum BouncerResult {
810 UNKNOWN = 0;
811 // The password entered was incorrect.
812 FAILURE = 1;
813 // The password entered was correct.
814 SUCCESS = 2;
815 }
816 optional BouncerResult result = 1;
817}
818
Tej Singha883b372018-02-15 11:30:01 -0800819/*
820 * Logs changes to the configuration of the device. The configuration is defined
821 * in frameworks/base/core/java/android/content/res/Configuration.java
822 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
823 * Please go there to interpret the possible values each field can be.
824 *
825 * Logged from:
826 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
827 */
828message ResourceConfigurationChanged {
829 // Bit mask of color capabilities of the screen.
830 // Contains information about the color gamut and hdr mode of the screen.
831 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
832 optional int32 colorMode = 1;
833
834 // The target screen density being rendered to.
835 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
836 optional int32 densityDpi = 2;
837
838 // Current user preference for the scaling factor for fonts,
839 // relative to the base density scaling.
840 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
841 optional float fontScale = 3;
842
843 // Flag indicating whether the hard keyboard is hidden.
844 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
845 optional int32 hardKeyboardHidden = 4;
846
847 // The type of keyboard attached to the device.
848 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
849 optional int32 keyboard = 5;
850
851 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
852 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
853 optional int32 keyboardHideen = 6;
854
855 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
856 // 0 if undefined.
857 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
858 optional int32 mcc = 7;
859
860 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
861 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
862 // MNC_ZERO symbol defined in Configuration.java.
863 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
864 optional int32 mnc = 8;
865
866 // The kind of navigation available on the device.
867 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
868 optional int32 navigation = 9;
869
870 // Flag indicating whether the navigation is available.
871 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
872 optional int32 navigationHidden = 10;
873
874 // Overall orientation of the screen.
875 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
876 optional int32 orientation = 11;
877
878 // The current height of the available screen space, in dp units.
879 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
880 optional int32 screenHeightDp = 12;
881
882 // Bit mask of overall layout of the screen.
883 // Contains information about screen size, whether the screen is wider/taller
884 // than normal, whether the screen layout is right-tl-left or left-to-right,
885 // and whether the screen has a rounded shape.
886 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
887 optional int32 screenLayout = 13;
888
889 // Current width of the available screen space, in dp units.
890 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
891 optional int32 screenWidthDp = 14;
892
893 // The smallest screen size an application will see in normal operation.
894 // This is the smallest value of both screenWidthDp and screenHeightDp
895 // in portrait and landscape.
896 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
897 optional int32 smallestScreenWidthDp = 15;
898
899 // The type of touch screen attached to the device.
900 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
901 optional int32 touchscreen = 16;
902
903 // Bit mask of the ui mode.
904 // Contains information about the overall ui mode of the device.
905 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
906 // Also contains information about whether the device is in night mode.
907 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
908 optional int32 uiMode = 17;
909}
910
Tej Singheee317b2018-03-07 19:28:05 -0800911
912/**
913 * Logs changes in the connection state of the mobile radio.
914 *
915 * Logged from:
916 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
917 */
918message MobileConnectionStateChanged {
919 // States are from the state machine DataConnection.java.
920 enum State {
921 UNKNOWN = 0;
922 // The connection is inactive, or disconnected.
923 INACTIVE = 1;
924 // The connection is being activated, or connecting.
925 ACTIVATING = 2;
926 // The connection is active, or connected.
927 ACTIVE = 3;
928 // The connection is disconnecting.
929 DISCONNECTING = 4;
930 // The connection is disconnecting after creating a connection.
931 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
932 }
933 optional State state = 1;
934 // For multi-sim phones, this distinguishes between the sim cards.
935 optional int32 sim_slot_index = 2;
936 // Used to identify the connection. Starts at 0 and increments by 1 for
937 // every new network created. Resets whenever the device reboots.
938 optional int32 data_connection_id = 3;
939 // A bitmask for the capabilities of this connection.
940 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
941 // Default value (if we have no information): 0
942 optional int64 capabilities = 4;
943 // If this connection has internet.
944 // This just checks if the DEFAULT bit of capabilities is set.
945 optional bool has_internet = 5;
946}
947
948/**
949 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
950 *
951 * Logged from:
952 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
953 */
954message MobileRadioTechnologyChanged {
955 optional android.telephony.NetworkTypeEnum state = 1;
956 // For multi-sim phones, this distinguishes between the sim cards.
957 optional int32 sim_slot_index = 2;
958}
959
Andrew Chantb56388b2018-03-22 21:07:33 -0700960/**
961 * Logs the VID and PID of any connected USB devices.
962 *
963 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
964 *
965 * Logged by Vendor.
966 */
967message UsbDeviceAttached {
968 optional int32 vid = 1;
969 optional int32 pid = 2;
970 optional bool has_audio = 3;
971 optional bool has_hid = 4;
972 optional bool has_storage = 5;
973}
974
Tej Singheee317b2018-03-07 19:28:05 -0800975
Tej Singhdd7bd352018-02-09 19:33:15 -0800976/**
Tej Singh5d991e12018-03-09 19:48:11 -0800977 * Logs when Bluetooth is enabled and disabled.
978 *
979 * Logged from:
980 * services/core/java/com/android/server/BluetoothManagerService.java
981 */
982message BluetoothEnabledStateChanged {
983 repeated AttributionNode attribution_node = 1;
984 // Whether or not bluetooth is enabled on the device.
985 enum State {
986 UNKNOWN = 0;
987 ENABLED = 1;
988 DISABLED = 2;
989 }
990 optional State state = 2;
991 // The reason for being enabled/disabled.
992 // Eg. Airplane mode, crash, application request.
993 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
994 // If the reason is an application request, this will be the package name.
995 optional string pkgName = 4;
996}
997
998/**
999 * Logs when a Bluetooth device connects and disconnects.
1000 *
1001 * Logged from:
1002 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1003 */
1004message BluetoothConnectionStateChanged {
1005 // The state of the connection.
1006 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1007 optional android.bluetooth.ConnectionStateEnum state = 1;
1008 // An identifier that can be used to match connect and disconnect events.
1009 // Currently is last two bytes of a hash of a device level ID and
1010 // the mac address of the bluetooth device that is connected.
1011 optional int32 obfuscated_id = 2;
1012 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1013 // From android.bluetooth.BluetoothAdapter.java
1014 optional int32 bt_profile = 3;
1015}
1016
1017/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001018 * Logs when something is plugged into or removed from the USB-C connector.
1019 *
1020 * Logged from:
1021 * Vendor USB HAL.
1022 */
1023message UsbConnectorStateChanged {
1024 enum State {
1025 DISCONNECTED = 0;
1026 CONNECTED = 1;
1027 }
1028 optional State state = 1;
1029}
1030
1031/**
1032 * Logs the reported speaker impedance.
1033 *
1034 * Logged from:
1035 * Vendor audio implementation.
1036 */
1037message SpeakerImpedanceReported {
1038 optional int32 speaker_location = 1;
1039 optional int32 impedance = 2;
1040}
1041
1042/**
1043 * Logs the report of a failed hardware.
1044 *
1045 * Logged from:
1046 * Vendor HALs.
1047 *
1048 */
1049message HardwareFailed {
1050 enum HardwareType {
1051 HARDWARE_FAILED_UNKNOWN = 0;
1052 HARDWARE_FAILED_MICROPHONE = 1;
1053 HARDWARE_FAILED_CODEC = 2;
1054 HARDWARE_FAILED_SPEAKER = 3;
1055 HARDWARE_FAILED_FINGERPRINT = 4;
1056 }
1057 optional HardwareType hardware_type = 1;
1058
1059 /* hardware_location allows vendors to differentiate between multiple instances of
1060 * the same hardware_type. The specific locations are vendor defined integers,
1061 * referring to board-specific numbering schemes.
1062 */
1063 optional int32 hardware_location = 2;
1064
1065 /* failure_code is specific to the HardwareType of the failed hardware.
1066 * It should use the enum values defined below.
1067 */
1068 enum MicrophoneFailureCode {
1069 MICROPHONE_FAILURE_COMPLETE = 0;
1070 }
1071 enum CodecFailureCode {
1072 CODEC_FAILURE_COMPLETE = 0;
1073 }
1074 enum SpeakerFailureCode {
1075 SPEAKER_FAILURE_COMPLETE = 0;
1076 SPEAKER_FAILURE_HIGH_Z = 1;
1077 SPEAKER_FAILURE_SHORT = 2;
1078 }
1079 enum FingerprintFailureCode {
1080 FINGERPRINT_FAILURE_COMPLETE = 0;
1081 FINGERPRINT_SENSOR_BROKEN = 1;
1082 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1083 }
1084 optional int32 failure_code = 3;
1085}
1086
1087/**
1088 * Log an event when the device has been physically dropped.
1089 * Reported from the /vendor partition.
1090 */
1091message PhysicalDropDetected {
1092 // Confidence that the event was actually a drop, 0 -> 100
1093 optional int32 confidence_pctg = 1;
1094 // Peak acceleration of the drop, in 1/1000s of a g.
1095 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001096 // Duration of freefall in ms
1097 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001098}
1099
1100/**
1101 * Log bucketed battery charge cycles.
1102 *
1103 * Each bucket represents cycles of the battery past
1104 * a given charge point. For example, bucket 1 is the
1105 * lowest 1/8th of the battery, and bucket 8 is 100%.
1106 *
1107 * Logged from:
1108 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1109 */
1110message ChargeCyclesReported {
1111 optional int32 cycle_bucket_1 = 1;
1112 optional int32 cycle_bucket_2 = 2;
1113 optional int32 cycle_bucket_3 = 3;
1114 optional int32 cycle_bucket_4 = 4;
1115 optional int32 cycle_bucket_5 = 5;
1116 optional int32 cycle_bucket_6 = 6;
1117 optional int32 cycle_bucket_7 = 7;
1118 optional int32 cycle_bucket_8 = 8;
1119}
1120
1121/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001122 * Logs the duration of a davey (jank of >=700ms) when it occurs
1123 *
1124 * Logged from:
1125 * frameworks/base/libs/hwui/JankTracker.cpp
1126 */
1127message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001128 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001129 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001130
Tej Singhbb8554a2018-01-26 11:59:14 -08001131 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001132 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001133}
1134
1135/**
Bookatze5885242017-10-24 20:10:31 -07001136 * Logs phone signal strength changes.
1137 *
1138 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001139 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001140 */
1141message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001142 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1143 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001144}
1145
Yangster4ccebea2018-10-09 17:09:02 -07001146
1147/**
1148 * Logs when the phone state, sim state or signal strength changes
1149 *
1150 * Logged from:
1151 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1152 */
1153message PhoneServiceStateChanged {
1154 optional android.telephony.ServiceStateEnum state = 1;
1155 optional android.telephony.SimStateEnum sim_state = 2;
1156 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1157}
1158
1159/**
1160 * Logs when the phone becomes on or off.
1161 *
1162 * Logged from:
1163 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1164 */
1165message PhoneStateChanged {
1166 enum State {
1167 OFF = 0;
1168 ON = 1;
1169 }
1170 optional State state = 1;
1171}
1172
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001173message LauncherUIChanged {
Yao Chen046b5122018-10-24 14:09:20 -07001174 optional android.stats.launcher.LauncherAction action = 1;
1175 optional android.stats.launcher.LauncherState src_state = 2;
1176 optional android.stats.launcher.LauncherState dst_state = 3;
1177 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001178 optional bool is_swipe_up_enabled = 5;
1179}
1180
David Chenc28b2bb2017-10-24 12:52:52 -07001181/**
1182 * Logs that a setting was updated.
1183 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001184 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001185 * The tag and is_default allow resetting of settings to default values based on the specified
1186 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1187 */
1188message SettingChanged {
1189 // The name of the setting.
1190 optional string setting = 1;
1191
1192 // The change being imposed on this setting. May represent a number, eg "3".
1193 optional string value = 2;
1194
1195 // The new value of this setting. For most settings, this is same as value. For some settings,
1196 // value is +X or -X where X represents an element in a set. For example, if the previous value
1197 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1198 // The +/- feature is currently only used for location_providers_allowed.
1199 optional string new_value = 3;
1200
1201 // The previous value of this setting.
1202 optional string prev_value = 4;
1203
1204 // The tag used with the is_default for resetting sets of settings. This is generally null.
1205 optional string tag = 5;
1206
Bookatz90867622018-01-31 15:05:57 -08001207 // True if this setting with tag should be resettable.
1208 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001209
David Chenbd789912018-03-16 17:19:55 -07001210 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001211 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001212
1213 enum ChangeReason {
1214 UPDATED = 1; // Updated can be an insertion or an update.
1215 DELETED = 2;
1216 }
1217 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001218}
Chenjie Yub3dda412017-10-24 13:41:59 -07001219
Chenjie Yu05013b32017-11-21 10:21:41 -08001220/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001221 * Logs activity going to foreground or background
1222 *
1223 * Logged from:
1224 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1225 */
1226message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001227 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001228 optional string pkg_name = 2;
1229 optional string class_name = 3;
1230
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001231 enum State {
1232 BACKGROUND = 0;
1233 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001234 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001235 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001236}
David Chenc8a43242017-10-17 16:23:28 -07001237
1238/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001239 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001240 * Logged from:
1241 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1242 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001243message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001244 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001245
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001246 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001247
1248 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001249 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001250 optional string process_name = 3;
1251
1252 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001253 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001254
1255 optional string package_name = 5;
1256
1257 enum InstantApp {
1258 UNAVAILABLE = 0;
1259 FALSE = 1;
1260 TRUE = 2;
1261 }
1262 optional InstantApp is_instant_app = 6;
1263
1264 enum ForegroundState {
1265 UNKNOWN = 0;
1266 BACKGROUND = 1;
1267 FOREGROUND = 2;
1268 }
1269 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001270}
David Chen9e3808c2017-11-20 17:25:34 -08001271
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001272/**
1273 * Logs when a WTF (What a Terrible Failure) happened.
1274 * Logged from:
1275 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1276 */
1277message WTFOccurred {
1278 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001279
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001280 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001281
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001282 // The name of the process.
1283 // system_server if it is not by an app
1284 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001285
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001286 // The pid if available. -1 means not available.
1287 optional sint32 pid = 4;
1288}
1289
1290/**
1291 * Logs when system server reports low memory.
1292 * Logged from:
1293 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1294 */
1295message LowMemReported {
1296}
1297
1298/**
1299 * Logs when an app ANR (App Not Responding) occurs.
1300 * Logged from:
1301 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1302 */
1303message ANROccurred {
1304 optional int32 uid = 1 [(is_uid) = true];
1305
1306 optional string process_name = 2;
1307
1308 optional string short_component_name = 3;
1309
1310 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001311
1312 enum InstantApp {
1313 UNAVAILABLE = 0;
1314 FALSE = 1;
1315 TRUE = 2;
1316 }
1317 optional InstantApp is_instant_app = 5;
1318
1319 enum ForegroundState {
1320 UNKNOWN = 0;
1321 BACKGROUND = 1;
1322 FOREGROUND = 2;
1323 }
1324 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08001325}
1326
David Chen0a368b22017-12-06 16:28:16 -08001327/*
1328 * Allows other apps to push events into statsd.
1329 * Logged from:
1330 * frameworks/base/core/java/android/util/StatsLog.java
1331 */
David Chen0b5c90c2018-01-25 16:51:49 -08001332message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001333 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001334 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001335
1336 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1337 optional int32 label = 2;
1338
1339 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1340 // predicates for the metrics).
1341 enum State {
1342 UNKNOWN = 0;
1343 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1344 STOP = 2;
1345 START = 3;
1346 }
1347 optional State state = 3;
1348}
1349
David Chen9e3808c2017-11-20 17:25:34 -08001350/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001351 * Logs when statsd detects an anomaly.
1352 *
1353 * Logged from:
1354 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1355 */
1356message AnomalyDetected {
1357 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001358 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001359
Yangster-mac94e197c2018-01-02 16:03:03 -08001360 // Id of the config whose anomaly detection alert fired.
1361 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001362
Yangster-mac94e197c2018-01-02 16:03:03 -08001363 // Id of the alert (i.e. name of the anomaly that was detected).
1364 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001365}
1366
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001367message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001368 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001369 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001370
1371 // The app package name.
1372 optional string pkg_name = 2;
1373
1374 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001375 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001376 WARM = 1;
1377 HOT = 2;
1378 COLD = 3;
1379 }
1380 // The transition type.
1381 optional TransitionType type = 3;
1382
1383 // The activity name.
1384 optional string activity_name = 4;
1385
1386 // The name of the calling app. Empty if not set.
1387 optional string calling_pkg_name = 5;
1388
1389 // Whether the app is an instant app.
1390 optional bool is_instant_app = 6;
1391
1392 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001393 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001394
Bookatz80d11a02018-01-16 10:46:35 -08001395 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001396
David Chen0b5c90c2018-01-25 16:51:49 -08001397 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001398 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001399 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001400 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001401 optional int32 bind_application_delay_millis = 11;
1402 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001403
1404 // Empty if not set.
1405 optional string launch_token = 13;
1406
Calin Juravle759fbda2018-02-20 19:52:30 +00001407 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001408 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001409
1410 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001411 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001412}
1413
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001414message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001415 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001416 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001417
1418 // The app package name.
1419 optional string pkg_name = 2;
1420
1421 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001422 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001423 WARM = 1;
1424 HOT = 2;
1425 COLD = 3;
1426 }
1427 // The transition type.
1428 optional TransitionType type = 3;
1429
1430 // The activity name.
1431 optional string activity_name = 4;
1432}
1433
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001434message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001435 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001436 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001437
1438 // The app package name.
1439 optional string pkg_name = 2;
1440
1441 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001442 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001443 WITH_BUNDLE = 1;
1444 WITHOUT_BUNDLE = 2;
1445 }
1446 // The transition type.
1447 optional TransitionType type = 3;
1448
1449 // The activity name.
1450 optional string activity_name = 4;
1451
1452 optional bool transition_process_running = 5;
1453
1454 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001455 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001456}
1457
Bookatz8fcd09a2017-12-18 13:01:10 -08001458/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001459 * Logs a picture-in-picture action
1460 * Logged from:
1461 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1462 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1463 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1464 */
1465message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001466 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001467 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001468
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001469 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001470
Chenjie Yu52cacc62017-12-08 18:11:45 -08001471 enum State {
1472 ENTERED = 1;
1473 EXPANDED_TO_FULL_SCREEN = 2;
1474 MINIMIZED = 3;
1475 DISMISSED = 4;
1476 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001477 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001478}
1479
1480/**
Chenjie Yue8904192017-12-08 19:12:57 -08001481 * Logs overlay action
1482 * Logged from:
1483 * services/core/java/com/android/server/wm/Session.java
1484 */
1485message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001486 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001487
1488 optional string package_name = 2;
1489
1490 optional bool using_alert_window = 3;
1491
1492 enum State {
1493 ENTERED = 1;
1494 EXITED = 2;
1495 }
1496 optional State state = 4;
1497}
1498
Chenjie Yuccfe6452018-01-30 11:33:21 -08001499/*
1500 * Logs foreground service starts and stops.
1501 * Note that this is not when a service starts or stops, but when it is
1502 * considered foreground.
1503 * Logged from
1504 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1505 */
1506message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001507 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001508 // package_name + "/" + class_name
1509 optional string short_name = 2;
1510
1511 enum State {
1512 ENTER = 1;
1513 EXIT = 2;
1514 }
1515 optional State state = 3;
1516}
1517
Chenjie Yue8904192017-12-08 19:12:57 -08001518/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001519 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1520 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1521 * attributed back to the parent (host) uid. One example is Chrome.
1522 *
1523 * Logged from:
1524 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1525 */
1526message IsolatedUidChanged {
1527 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001528 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001529 optional int32 parent_uid = 1;
1530
1531 optional int32 isolated_uid = 2;
1532
1533 // We expect an isolated uid to be removed before if it's used for another parent uid.
1534 enum Event {
1535 REMOVED = 0;
1536 CREATED = 1;
1537 }
1538 optional Event event = 3;
1539}
1540
1541/*
1542 * Logs the reception of an incoming network packet causing the main system to wake up for
1543 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1544 * and processed by WakeupController.cpp.
1545 */
1546message PacketWakeupOccurred {
1547 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1548 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001549 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001550 // The interface name on which the packet was received.
1551 optional string iface = 2;
1552 // The ethertype value of the packet.
1553 optional int32 ethertype = 3;
1554 // String representation of the destination MAC address of the packet.
1555 optional string destination_hardware_address = 4;
1556 // String representation of the source address of the packet if this was an IP packet.
1557 optional string source_ip = 5;
1558 // String representation of the destination address of the packet if this was an IP packet.
1559 optional string destination_ip = 6;
1560 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1561 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1562 // families.
1563 optional int32 ip_next_header = 7;
1564 // The source port if this was a TCP or UDP packet.
1565 optional int32 source_port = 8;
1566 // The destination port if this was a TCP or UDP packet.
1567 optional int32 destination_port = 9;
1568}
1569
1570/*
1571 * Logs the memory stats for an app on startup.
1572 * Logged from:
1573 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1574 */
1575message AppStartMemoryStateCaptured {
1576 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001577 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001578
1579 // The process name.
1580 optional string process_name = 2;
1581
1582 // The activity name.
1583 optional string activity_name = 3;
1584
1585 // # of page-faults
1586 optional int64 pgfault = 4;
1587
1588 // # of major page-faults
1589 optional int64 pgmajfault = 5;
1590
1591 // RSS
1592 optional int64 rss_in_bytes = 6;
1593
1594 // CACHE
1595 optional int64 cache_in_bytes = 7;
1596
1597 // SWAP
1598 optional int64 swap_in_bytes = 8;
1599}
1600
1601/*
1602 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1603 * for LMK event.
1604 * Logged from:
1605 * system/core/lmkd/lmkd.c
1606 */
1607message LmkStateChanged {
1608 enum State {
1609 UNKNOWN = 0;
1610 START = 1;
1611 STOP = 2;
1612 }
1613 optional State state = 1;
1614}
1615
1616/*
1617 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1618 * Logged from:
1619 * system/core/lmkd/lmkd.c
1620 */
1621message LmkKillOccurred {
1622 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001623 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001624
1625 // The process name.
1626 optional string process_name = 2;
1627
1628 // oom adj score.
1629 optional int32 oom_score = 3;
1630
1631 // # of page-faults
1632 optional int64 pgfault = 4;
1633
1634 // # of major page-faults
1635 optional int64 pgmajfault = 5;
1636
1637 // RSS
1638 optional int64 rss_in_bytes = 6;
1639
1640 // CACHE
1641 optional int64 cache_in_bytes = 7;
1642
1643 // SWAP
1644 optional int64 swap_in_bytes = 8;
Jim Blackler972a5c52018-11-21 15:24:48 +00001645
1646 // The elapsed real time of start of the process.
1647 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001648}
1649
Rajeev Kumar51b54602018-03-01 12:18:26 -08001650/*
1651 * Logs when the ActivityManagerService detects that an app died.
1652 *
1653 * Logged from:
1654 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1655 */
1656message AppDied {
1657 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07001658 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08001659}
1660
Chenjie Yubbcbc602018-02-05 16:51:52 -08001661//////////////////////////////////////////////////////////////////////
1662// Pulled atoms below this line //
1663//////////////////////////////////////////////////////////////////////
1664
1665/**
David Chenc8a43242017-10-17 16:23:28 -07001666 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
1667 *
1668 * Pulled from:
1669 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1670 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001671message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001672 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001673
1674 optional int64 rx_bytes = 2;
1675
1676 optional int64 rx_packets = 3;
1677
1678 optional int64 tx_bytes = 4;
1679
1680 optional int64 tx_packets = 5;
1681}
1682
1683/**
1684 * Pulls bytes transferred via wifi (separated by foreground and background usage).
1685 *
1686 * Pulled from:
1687 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1688 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001689message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001690 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001691
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001692 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
1693 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07001694
1695 optional int64 rx_bytes = 3;
1696
1697 optional int64 rx_packets = 4;
1698
1699 optional int64 tx_bytes = 5;
1700
1701 optional int64 tx_packets = 6;
1702}
1703
1704/**
1705 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
1706 *
1707 * Pulled from:
1708 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1709 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001710message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001711 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001712
1713 optional int64 rx_bytes = 2;
1714
1715 optional int64 rx_packets = 3;
1716
1717 optional int64 tx_bytes = 4;
1718
1719 optional int64 tx_packets = 5;
1720}
1721
1722/**
1723 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
1724 *
1725 * Pulled from:
1726 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1727 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001728message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001729 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001730
Yao Chenc40a19d2018-03-15 16:48:25 -07001731 // 1 denotes foreground and 0 denotes background. This is called Set in
1732 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001733 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07001734
1735 optional int64 rx_bytes = 3;
1736
1737 optional int64 rx_packets = 4;
1738
1739 optional int64 tx_bytes = 5;
1740
1741 optional int64 tx_packets = 6;
1742}
1743
1744/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001745 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
1746 *
1747 * Pulled from:
1748 * StatsCompanionService
1749 */
1750message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001751 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001752
1753 optional int64 rx_bytes = 2;
1754
1755 optional int64 tx_bytes = 3;
1756}
1757
1758/**
David Chenc8a43242017-10-17 16:23:28 -07001759 * Pulls the kernel wakelock durations. This atom is adapted from
1760 * android/internal/os/KernelWakelockStats.java
1761 *
1762 * Pulled from:
1763 * StatsCompanionService using KernelWakelockReader.
1764 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001765message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07001766 optional string name = 1;
1767
1768 optional int32 count = 2;
1769
1770 optional int32 version = 3;
1771
1772 optional int64 time = 4;
1773}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001774
Chenjie Yu05013b32017-11-21 10:21:41 -08001775/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001776 * Pulls low power state information. This includes platform and subsystem sleep state information,
1777 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001778 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001779 * hardware/interfaces/power/1.1/types.hal
1780 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001781message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08001782 // Subsystem name
1783 optional string subsystem_name = 1;
1784 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
1785 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
1786 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001787 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08001788 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001789 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08001790 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07001791}
Chenjie Yu7f8def92017-11-03 09:33:15 -07001792
Chenjie Yu05013b32017-11-21 10:21:41 -08001793/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07001794 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08001795 * Pulls the time the cpu spend on the frequency index. Frequency index
1796 * starts from highest to lowest. The value should be monotonically
1797 * increasing since boot. However, if there is a cpu
1798 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07001799 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001800message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07001801 optional uint32 cluster = 1;
1802 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001803 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07001804}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001805
Chenjie Yu05013b32017-11-21 10:21:41 -08001806/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001807 * Pulls Cpu Time Per Uid.
1808 * Note that isolated process uid time should be attributed to host uids.
1809 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001810message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07001811 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00001812 optional uint64 user_time_micros = 2;
1813 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001814}
1815
1816/**
1817 * Pulls Cpu Time Per Uid per frequency.
1818 * Note that isolated process uid time should be attributed to host uids.
1819 * For each uid, we order the time by descending frequencies.
1820 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001821message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07001822 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001823 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001824 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001825}
Hugo Benichi884970e2017-11-14 22:42:46 +09001826
Chenjie Yu05013b32017-11-21 10:21:41 -08001827/**
1828 * Pulls Wifi Controller Activity Energy Info
1829 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001830message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001831 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001832 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001833 // stack reported state
1834 // TODO: replace this with proto enum
1835 optional int32 stack_state = 2;
1836 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001837 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001838 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001839 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001840 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001841 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001842 // product of current(mA), voltage(V) and time(ms)
1843 optional uint64 controller_energy_used = 6;
1844}
1845
1846/**
1847 * Pulls Modem Activity Energy Info
1848 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001849message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001850 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001851 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001852 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001853 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08001854 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001855 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001856 /**
1857 * Tx power index
1858 * index 0 = tx_power < 0dBm
1859 * index 1 = 0dBm < tx_power < 5dBm
1860 * index 2 = 5dBm < tx_power < 15dBm
1861 * index 3 = 15dBm < tx_power < 20dBm
1862 * index 4 = tx_power > 20dBm
1863 */
1864 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08001865 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001866 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08001867 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001868 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08001869 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08001870 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08001871 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08001872 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08001873 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08001874 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08001875 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08001876 // product of current(mA), voltage(V) and time(ms)
1877 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08001878}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001879
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001880/**
1881 * Pulls Bluetooth Activity Energy Info
1882 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
1883 */
1884message BluetoothActivityInfo {
1885 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001886 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001887 // bluetooth stack state
1888 optional int32 bluetooth_stack_state = 2;
1889 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001890 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001891 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001892 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001893 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001894 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001895 // product of current(mA), voltage(V) and time(ms)
1896 optional uint64 energy_used = 6;
1897}
1898
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08001899/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001900 * Logs the memory stats for a process.
1901 */
1902message ProcessMemoryState {
1903 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001904 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001905
1906 // The process name.
1907 optional string process_name = 2;
1908
1909 // oom adj score.
1910 optional int32 oom_score = 3;
1911
1912 // # of page-faults
1913 optional int64 pgfault = 4;
1914
1915 // # of major page-faults
1916 optional int64 pgmajfault = 5;
1917
Rajeev Kumar90235992018-01-29 11:06:48 -08001918 // RSS
1919 optional int64 rss_in_bytes = 6;
1920
1921 // CACHE
1922 optional int64 cache_in_bytes = 7;
1923
1924 // SWAP
1925 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08001926}
1927
1928/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001929 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001930 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001931message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08001932 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001933}
1934
1935/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001936 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08001937 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001938message SystemUptime {
1939 // Milliseconds since the system was booted.
1940 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
1941 // for external input).
1942 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08001943 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001944}
1945
1946/*
1947 * Reads from /proc/uid_concurrent_active_time which has the format:
1948 * active: X (X is # cores)
1949 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
1950 * [uid1]: [time-0] [time-1] [time-2] ... ...
1951 * ...
1952 * Time-N means the CPU time a UID spent running concurrently with N other processes.
1953 * The file contains a monotonically increasing count of time for a single boot.
1954 */
1955message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07001956 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001957 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08001958}
1959
1960/**
1961 * Reads from /proc/uid_concurrent_policy_time which has the format:
1962 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
1963 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1964 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
1965 * ...
1966 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
1967 * The file contains a monotonically increasing count of time for a single boot.
1968 */
1969message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07001970 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001971 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001972 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08001973}
1974
1975/*
1976 * Pulls free disk space, for data, system partition and temporary directory.
1977 */
1978message DiskSpace {
1979 // available bytes in data partition
1980 optional uint64 data_available_bytes = 1;
1981 // available bytes in system partition
1982 optional uint64 system_available_bytes = 2;
1983 // available bytes in download cache or temp directories
1984 optional uint64 temp_available_bytes = 3;
1985}
Tej Singhbf972d92018-01-10 20:51:13 -08001986
1987/**
1988 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08001989 * Pulled from:
1990 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08001991 */
1992message RemainingBatteryCapacity {
1993 optional int32 charge_uAh = 1;
1994}
1995
1996/**
1997 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08001998 * Pulled from:
1999 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002000 */
2001message FullBatteryCapacity {
2002 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08002003}
2004
2005/**
Tej Singhd89137e2018-03-26 14:51:40 -07002006 * Pulls the temperature of various parts of the device.
2007 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002008 *
2009 * Pulled from:
2010 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2011 */
2012message Temperature {
2013 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2014 optional android.os.TemperatureTypeEnum sensor_location = 1;
2015
2016 // The name of the temperature source. Eg. CPU0
2017 optional string sensor_name = 2;
2018
Tej Singhd89137e2018-03-26 14:51:40 -07002019 // Temperature in tenths of a degree C.
2020 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08002021}
lifr35a7cf02018-12-12 16:38:04 +08002022
2023/**
2024 * Logs the latency period(in microseconds) and the return code of
2025 * the DNS(Domain Name System) lookups.
2026 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
2027 * to get info(address or hostname) from DNS server(or DNS cache).
2028 * Logged from:
2029 * /system/netd/server/DnsProxyListener.cpp
2030 */
2031message NetworkDnsEventReported {
2032 // The types of the DNS lookups, as defined in
2033 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
2034 enum EventType {
2035 EVENT_UNKNOWN = 0;
2036 EVENT_GETADDRINFO = 1;
2037 EVENT_GETHOSTBYNAME = 2;
2038 EVENT_GETHOSTBYADDR = 3;
2039 EVENT_RES_NSEND = 4;
2040 }
2041 optional EventType event_type = 1;
2042
2043 // The return value of the DNS resolver for each DNS lookups.
2044 //bionic/libc/include/netdb.h
2045 //system/netd/resolv/include/netd_resolv/resolv.h
2046 enum ReturnCode {
2047 EAI_NO_ERROR = 0;
2048 EAI_ADDRFAMILY = 1;
2049 EAI_AGAIN = 2;
2050 EAI_BADFLAGS = 3;
2051 EAI_FAIL = 4;
2052 EAI_FAMILY = 5;
2053 EAI_MEMORY = 6;
2054 EAI_NODATA = 7;
2055 EAI_NONAME = 8;
2056 EAI_SERVICE = 9;
2057 EAI_SOCKTYPE = 10;
2058 EAI_SYSTEM = 11;
2059 EAI_BADHINTS = 12;
2060 EAI_PROTOCOL = 13;
2061 EAI_OVERFLOW = 14;
2062 RESOLV_TIMEOUT = 255;
2063 EAI_MAX = 256;
2064 }
2065 optional ReturnCode return_code = 2;
2066
2067 // The latency period(in microseconds) it took for this DNS lookup to complete.
2068 optional int32 latency_micros = 3;
2069}
2070
Chiachang Wang67f24472019-01-15 15:14:00 +08002071/**
2072 * Logs when a data stall event occurs.
2073 *
2074 * Log from:
2075 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2076 */
2077message DataStallEvent {
2078 // Data stall evaluation type.
2079 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2080 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
2081 optional int32 evaluation_type = 1;
2082 // See definition in data_stall_event.proto.
2083 optional com.android.server.connectivity.ProbeResult validation_result = 2;
2084 // See definition in data_stall_event.proto.
2085 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
2086 // See definition in data_stall_event.proto.
2087 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
2088 // See definition in data_stall_event.proto.
2089 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
2090 // See definition in data_stall_event.proto.
2091 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
2092}