blob: a2bf946dded4c5f79aa82738f2de6539d829ec87 [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";
Jack He924f3462019-01-09 20:54:41 -080026import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080027import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack He52260142018-12-18 15:43:27 -080028import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack He22e4a1d2019-01-09 01:19:13 -080029import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Chiachang Wang67f24472019-01-15 15:14:00 +080030import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080031import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wang67f24472019-01-15 15:14:00 +080032import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080033import "frameworks/base/core/proto/android/server/enums.proto";
Yao Chen046b5122018-10-24 14:09:20 -070034import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080035import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/telephony/enums.proto";
37import "frameworks/base/core/proto/android/view/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080038
Yao Chend54f9dd2017-10-17 17:37:48 +000039/**
Stefan Lafonae2df012017-11-14 09:17:21 -080040 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000041 * raw stats log events from the Android system, also known as "atoms."
42 *
43 * This field contains a single oneof with all of the available messages.
44 * The stats-log-api-gen tool runs as part of the Android build and
45 * generates the android.util.StatsLog class, which contains the constants
46 * and methods that Android uses to log.
47 *
Stefan Lafonae2df012017-11-14 09:17:21 -080048 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000049 * Instead, statsd on Android constructs these messages synthetically,
50 * in the format defined here and in stats_log.proto.
51 */
Stefan Lafonae2df012017-11-14 09:17:21 -080052message Atom {
53 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070054 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070055 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
56 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080057 // 3 is available for use
Bookatzc1a050a2017-10-10 15:49:28 -070058 BleScanResultReceived ble_scan_result_received = 4;
59 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080060 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070061 SyncStateChanged sync_state_changed = 7;
62 ScheduledJobStateChanged scheduled_job_state_changed = 8;
63 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070064 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080065 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
66 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
67 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Hyunyoung Songcc651c12018-10-17 13:35:32 -070068 // 14 - 18 are available
69 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080070 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
71 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
72 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070073 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080074 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070075 CameraStateChanged camera_state_changed = 25;
76 FlashlightStateChanged flashlight_state_changed = 26;
77 UidProcessStateChanged uid_process_state_changed = 27;
78 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
79 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070080 BatteryLevelChanged battery_level_changed = 30;
81 ChargingStateChanged charging_state_changed = 31;
82 PluggedStateChanged plugged_state_changed = 32;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080083 // 33 - 34 are available
Bookatz8c6571b2017-10-24 15:04:41 -070084 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
85 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070086 WifiLockStateChanged wifi_lock_state_changed = 37;
87 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
88 WifiScanStateChanged wifi_scan_state_changed = 39;
89 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070090 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070091 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070092 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090093 PacketWakeupOccurred packet_wakeup_occurred = 44;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080094 // 45 is available
Bookatz8fcd09a2017-12-18 13:01:10 -080095 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080096 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080097 AppStartOccurred app_start_occurred = 48;
98 AppStartCanceled app_start_canceled = 49;
99 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800100 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800101 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800102 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800103 LmkStateChanged lmk_state_changed = 54;
104 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800105 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800106 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800107 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800108 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800109 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800110 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800111 KeyguardStateChanged keyguard_state_changed = 62;
112 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
113 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800114 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800115 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800116 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
117 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Tej Singh02200f92018-04-02 19:37:59 -0700118 // 69 is blank but need not be.
Andrew Chantb56388b2018-03-22 21:07:33 -0700119 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800120 SpeakerImpedanceReported speaker_impedance_reported = 71;
121 HardwareFailed hardware_failed = 72;
122 PhysicalDropDetected physical_drop_detected = 73;
123 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800124 MobileConnectionStateChanged mobile_connection_state_changed = 75;
125 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700126 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800127 AppCrashOccurred app_crash_occurred = 78;
128 ANROccurred anr_occurred = 79;
129 WTFOccurred wtf_occurred = 80;
Yangster4ccebea2018-10-09 17:09:02 -0700130 PhoneServiceStateChanged phone_service_state_changed = 94;
131 PhoneStateChanged phone_state_changed = 95;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800132 LowMemReported low_mem_reported = 81;
lifr35a7cf02018-12-12 16:38:04 +0800133 NetworkDnsEventReported network_dns_event_reported = 116;
Chiachang Wang67f24472019-01-15 15:14:00 +0800134 DataStallEvent data_stall_event = 121;
Jack He52260142018-12-18 15:43:27 -0800135 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack He22e4a1d2019-01-09 01:19:13 -0800136 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
137 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Jack Yu6d421bc2019-01-23 17:42:54 +0800138 NfcErrorOccurred nfc_error_occurred = 134;
139 NfcStateChanged nfc_state_changed = 135;
140 NfcBeamOccurred nfc_beam_occurred = 136;
141 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
142 NfcTagOccurred nfc_tag_occurred = 138;
143 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
144 SeStateChanged se_state_changed = 140;
145 SeOmapiReported se_omapi_reported = 141;
Jack He924f3462019-01-09 20:54:41 -0800146 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
147 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
148 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
149 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
150 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
151 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
152 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
153 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
154 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Yao Chend54f9dd2017-10-17 17:37:48 +0000155 }
David Chenc8a43242017-10-17 16:23:28 -0700156
David Chen6e3e6cb2018-01-03 16:14:06 -0800157 // Pulled events will start at field 10000.
Tej Singh40298312018-02-16 00:15:09 -0800158 // Next: 10022
David Chenc8a43242017-10-17 16:23:28 -0700159 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800160 WifiBytesTransfer wifi_bytes_transfer = 10000;
161 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
162 MobileBytesTransfer mobile_bytes_transfer = 10002;
163 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800164 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800165 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800166 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800167 CpuTimePerFreq cpu_time_per_freq = 10008;
168 CpuTimePerUid cpu_time_per_uid = 10009;
169 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800170 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800171 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800172 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800173 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800174 SystemElapsedRealtime system_elapsed_realtime = 10014;
175 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800176 CpuActiveTime cpu_active_time = 10016;
177 CpuClusterTime cpu_cluster_time = 10017;
Chenjie Yu937d7422018-01-10 16:37:53 -0800178 DiskSpace disk_space = 10018;
Tej Singhbf972d92018-01-10 20:51:13 -0800179 RemainingBatteryCapacity remaining_battery_capacity = 10019;
180 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800181 Temperature temperature = 10021;
David Chenc8a43242017-10-17 16:23:28 -0700182 }
yroa1fe77c2018-02-26 14:22:54 -0800183
Bookatz76aafcf2018-09-17 16:17:10 -0700184 // DO NOT USE field numbers above 100,000 in AOSP.
185 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
186 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700187}
188
Yao Chend54f9dd2017-10-17 17:37:48 +0000189/**
Yangster-mac20877162017-12-22 17:19:39 -0800190 * This proto represents a node of an attribution chain.
191 * Note: All attribution chains are represented as a repeated field of type
192 * AttributionNode. It is understood that in such arrays, the order is that
193 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000194 */
Yangster-mac20877162017-12-22 17:19:39 -0800195message AttributionNode {
196 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800197 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800198
Yangster-mac20877162017-12-22 17:19:39 -0800199 // The (optional) string tag for an element in the attribution chain. If the
200 // element has no tag, it is encoded as an empty string.
201 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700202}
203
Yao Chend54f9dd2017-10-17 17:37:48 +0000204/*
205 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800206 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000207 *
208 * RULES:
209 * - The field ids for each atom must start at 1, and count upwards by 1.
210 * Skipping field ids is not allowed.
211 * - These form an API, so renaming, renumbering or removing fields is
212 * not allowed between android releases. (This is not currently enforced,
213 * but there will be a tool to enforce this restriction).
214 * - The types must be built-in protocol buffer types, namely, no sub-messages
215 * are allowed (yet). The bytes type is also not allowed.
216 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800217 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000218 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800219 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000220 * - A field that is a uid should be a string field, tagged with the [xxx]
221 * annotation. The generated code on android will be represented by UIDs,
222 * and those UIDs will be translated in xxx to those strings.
223 *
224 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700225 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000226 * - If there is a UID, it goes first. Think in an object-oriented fashion.
227 * *****************************************************************************
228 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700229
Yao Chend54f9dd2017-10-17 17:37:48 +0000230/**
231 * Logs when the screen state changes.
232 *
233 * Logged from:
234 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
235 */
236message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800237 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800238 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700239}
Yao Chend54f9dd2017-10-17 17:37:48 +0000240
241/**
Bookatzc1a050a2017-10-10 15:49:28 -0700242 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000243 *
244 * Logged from:
245 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
246 */
Bookatzc1a050a2017-10-10 15:49:28 -0700247message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700248 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000249
Bookatzdb026a22018-01-10 19:01:56 -0800250 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800251 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000252}
253
254/**
Bookatzc1a050a2017-10-10 15:49:28 -0700255 * Logs that a process started, finished, crashed, or ANRed.
256 *
257 * Logged from:
258 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
259 */
260message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700261 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700262
David Chen0b5c90c2018-01-25 16:51:49 -0800263 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800264 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700265
Bookatzddccf0a2017-11-28 16:48:14 -0800266 // What lifecycle state the process changed to.
267 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800268 enum State {
269 FINISHED = 0;
270 STARTED = 1;
271 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800272 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800273 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700274}
275
Bookatzc1a050a2017-10-10 15:49:28 -0700276/**
277 * Logs when the ble scan state changes.
278 *
279 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700280 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700281 */
282message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800283 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700284
285 enum State {
286 OFF = 0;
287 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700288 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
289 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700290 }
291 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700292
Bookatze5ec0b42018-03-26 13:34:56 -0700293 // Does the scan have a filter.
294 optional bool is_filtered = 3;
295 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
296 optional bool is_first_match = 4;
297 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
298 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700299}
300
301/**
302 * Logs reporting of a ble scan finding results.
303 *
304 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700305 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700306 */
Bookatzae6738e2018-09-13 11:38:56 -0700307// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700308message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800309 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700310
311 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800312 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700313}
314
315/**
316 * Logs when a sensor state changes.
317 *
318 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700319 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700320 */
321message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800322 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700323
Bookatzc1a050a2017-10-10 15:49:28 -0700324 // The id (int) of the sensor.
325 optional int32 sensor_id = 2;
326
327 enum State {
328 OFF = 0;
329 ON = 1;
330 }
331 optional State state = 3;
332}
333
334
335/**
336 * Logs when GPS state changes.
337 *
338 * Logged from:
339 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
340 */
341message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800342 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700343
344 enum State {
345 OFF = 0;
346 ON = 1;
347 }
348 optional State state = 2;
349}
350
351
352/**
353 * Logs when a sync manager sync state changes.
354 *
355 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700356 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700357 */
358message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800359 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700360
David Chen0b5c90c2018-01-25 16:51:49 -0800361 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800362 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700363
364 enum State {
365 OFF = 0;
366 ON = 1;
367 }
368 optional State state = 3;
369}
370
371/**
372 * Logs when a job scheduler job state changes.
373 *
374 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700375 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700376 */
377message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800378 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700379
380 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800381 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700382
383 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800384 FINISHED = 0;
385 STARTED = 1;
386 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700387 }
388 optional State state = 3;
389
Tej Singh33a412b2018-03-16 18:43:59 -0700390 // The reason a job has stopped.
391 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700392 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700393 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700394}
395
396/**
397 * Logs when the audio state changes.
398 *
399 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700400 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700401 */
402message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800403 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700404
405 enum State {
406 OFF = 0;
407 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700408 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
409 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700410 }
411 optional State state = 2;
412}
413
414/**
415 * Logs when the video codec state changes.
416 *
417 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700418 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700419 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800420message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800421 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700422
423 enum State {
424 OFF = 0;
425 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700426 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
427 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700428 }
429 optional State state = 2;
430}
431
432/**
433 * Logs when the flashlight state changes.
434 *
435 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700436 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700437 */
438message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800439 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700440
441 enum State {
442 OFF = 0;
443 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700444 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
445 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700446 }
447 optional State state = 2;
448}
449
450/**
451 * Logs when the camera state changes.
452 *
453 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700454 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700455 */
456message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800457 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700458
459 enum State {
460 OFF = 0;
461 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700462 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
463 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700464 }
465 optional State state = 2;
466}
467
468/**
469 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000470 *
471 * Logged from:
472 * TODO
473 */
Bookatzd6746242017-10-24 18:39:35 -0700474message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800475 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000476
Bookatz1a1b0462018-01-12 11:47:03 -0800477 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
478 // From frameworks/base/core/proto/android/os/enums.proto.
479 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700480
481 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
482 optional string tag = 3;
483
484 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800485 RELEASE = 0;
486 ACQUIRE = 1;
487 CHANGE_RELEASE = 2;
488 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700489 }
490 optional State state = 4;
491}
492
493/**
Bookatzc1a050a2017-10-10 15:49:28 -0700494 * Logs when a partial wakelock is considered 'long' (over 1 min).
495 *
496 * Logged from:
497 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
498 */
499message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800500 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700501
Yao Chend54f9dd2017-10-17 17:37:48 +0000502 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
503 optional string tag = 2;
504
Bookatzc1a050a2017-10-10 15:49:28 -0700505 // TODO: I have no idea what this is.
506 optional string history_tag = 3;
507
508 enum State {
509 OFF = 0;
510 ON = 1;
511 }
512 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000513}
514
Bookatzc1a050a2017-10-10 15:49:28 -0700515/**
516 * Logs Battery Saver state change.
517 *
518 * Logged from:
519 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
520 */
521message BatterySaverModeStateChanged {
522 enum State {
523 OFF = 0;
524 ON = 1;
525 }
526 optional State state = 1;
527}
528
529/**
530 * Logs Doze mode state change.
531 *
532 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800533 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700534 */
535message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800536 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800537}
538
539
540/**
541 * Logs state change of Doze mode including maintenance windows.
542 *
543 * Logged from:
544 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
545 */
546message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800547 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700548}
549
550/**
551 * Logs screen brightness level.
552 *
553 * Logged from:
554 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
555 */
556message ScreenBrightnessChanged {
557 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
558 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700559}
560
561/**
562 * Logs battery level (percent full, from 0 to 100).
563 *
564 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700565 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700566 */
567message BatteryLevelChanged {
568 // Battery level. Should be in [0, 100].
569 optional int32 battery_level = 1;
570}
571
572/**
573 * Logs change in charging status of the device.
574 *
575 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700576 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700577 */
578message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800579 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
580 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700581}
582
583/**
584 * Logs whether the device is plugged in, and what power source it is using.
585 *
586 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700587 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700588 */
589message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800590 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
591 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700592}
593
Bookatz8c6571b2017-10-24 15:04:41 -0700594/**
595 * Logs when an app's wakeup alarm fires.
596 *
597 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700598 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700599 */
600message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800601 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800602
603 // Name of the wakeup alarm.
604 optional string tag = 2;
605}
606
607/**
608 * Logs when an an app causes the mobile radio to change state.
609 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
610 *
611 * Logged from:
612 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
613 */
614message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800615 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800616
Bookatz1a1b0462018-01-12 11:47:03 -0800617 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
618 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800619}
620
621/**
622 * Logs when an an app causes the wifi radio to change state.
623 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
624 *
625 * Logged from:
626 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
627 */
628message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800629 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800630
Bookatz1a1b0462018-01-12 11:47:03 -0800631 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
632 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700633}
634
635/**
636 * Logs kernel wakeup reasons and aborts.
637 *
638 * Logged from:
639 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
640 */
641message KernelWakeupReported {
642 // Name of the kernel wakeup reason (or abort).
643 optional string wakeup_reason_name = 1;
644
645 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800646 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700647}
648
649/**
650 * Logs wifi locks held by an app.
651 *
652 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700653 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700654 */
655message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800656 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700657
658 enum State {
659 OFF = 0;
660 ON = 1;
661 }
662 optional State state = 2;
663}
664
665/**
666 * Logs wifi signal strength changes.
667 *
668 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700669 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700670 */
671message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800672 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
673 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700674}
675
676/**
677 * Logs wifi scans performed by an app.
678 *
679 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700680 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700681 */
682message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800683 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700684
685 enum State {
686 OFF = 0;
687 ON = 1;
688 }
689 optional State state = 2;
690}
691
692/**
Tej Singh4503e102018-01-04 14:35:01 -0800693 * Logs wifi multicast locks held by an app
694 *
695 * Logged from:
696 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
697 */
698message WifiMulticastLockStateChanged {
699 repeated AttributionNode attribution_node = 1;
700
701 enum State {
702 OFF = 0;
703 ON = 1;
704 }
705 optional State state = 2;
706}
707
708/**
Tej Singh1ea42892018-01-19 09:27:00 -0800709 * Logs shutdown reason and duration on next boot.
710 *
711 * Logged from:
712 * frameworks/base/core/java/com/android/server/BootReceiver.java
713 */
714message ShutdownSequenceReported {
715 // True if shutdown is for a reboot. Default: false if we do not know.
716 optional bool reboot = 1;
717
718 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
719 optional string reason = 2;
720
721 // Beginning of shutdown time in ms using wall clock time since unix epoch.
722 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800723 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800724
725 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800726 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800727}
728
Tej Singh6483ea42018-01-25 17:45:49 -0800729
730/**
731 * Logs boot reason and duration.
732 *
733 * Logged from:
734 * system/core/bootstat/bootstat.cpp
735 */
736message BootSequenceReported {
737 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
738 // Default: "<EMPTY>" if not available.
739 optional string bootloader_reason = 1;
740
741 // Reason for system boot. Eg. bootloader, reboot,userrequested
742 // Default: "<EMPTY>" if not available.
743 optional string system_reason = 2;
744
745 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800746 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800747
748 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800749 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800750
751 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800752 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800753
754 // Time since last boot in ms. Default: 0 if not available.
755 optional int64 time_since_last_boot = 6;
756}
757
Tej Singhc477d9c2018-02-05 18:31:39 -0800758
759/**
760 * Logs call state and disconnect cause (if applicable).
761 *
762 * Logged from:
763 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
764 */
765message CallStateChanged {
766 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
767 // From frameworks/base/core/proto/android/telecomm/enums.proto.
768 optional android.telecom.CallStateEnum call_state = 1;
769
770 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
771 // This value is only applicable when the call_state is DISCONNECTED, and
772 // should always be UNKNOWN if the call_state is not DISCONNECTED.
773 // From frameworks/base/core/proto/android/telecomm/enums.proto.
774 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
775
776 // True if the call is self-managed, which are apps that use the
777 // telecom infrastructure to make their own calls.
778 optional bool self_managed = 3;
779
780 // True if call is external. External calls are calls on connected Wear
781 // devices but show up in Telecom so the user can pull them onto the device.
782 optional bool external_call = 4;
783}
784
Tej Singh1ea42892018-01-19 09:27:00 -0800785/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800786 * Logs keyguard state. The keyguard is the lock screen.
787 *
788 * Logged from:
789 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
790 */
791message KeyguardStateChanged {
792 enum State {
793 UNKNOWN = 0;
794 // The keyguard is hidden when the phone is unlocked.
795 HIDDEN = 1;
796 // The keyguard is shown when the phone is locked (screen turns off).
797 SHOWN= 2;
798 // The keyguard is occluded when something is overlaying the keyguard.
799 // Eg. Opening the camera while on the lock screen.
800 OCCLUDED = 3;
801 }
802 optional State state = 1;
803}
804
805/**
806 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
807 * prompts the user to enter a password (pattern, pin, etc).
808 *
809 * Logged from:
810 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
811 */
812
813message KeyguardBouncerStateChanged {
814 enum State {
815 UNKNOWN = 0;
816 // Bouncer is hidden, either as a result of successfully entering the
817 // password, screen timing out, or user going back to lock screen.
818 HIDDEN = 1;
819 // This is when the user is being prompted to enter the password.
820 SHOWN = 2;
821 }
822 optional State state = 1;
823}
824
825/**
826 * Logs the result of entering a password into the keyguard bouncer.
827 *
828 * Logged from:
829 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
830 */
831message KeyguardBouncerPasswordEntered {
832 enum BouncerResult {
833 UNKNOWN = 0;
834 // The password entered was incorrect.
835 FAILURE = 1;
836 // The password entered was correct.
837 SUCCESS = 2;
838 }
839 optional BouncerResult result = 1;
840}
841
Tej Singha883b372018-02-15 11:30:01 -0800842/*
843 * Logs changes to the configuration of the device. The configuration is defined
844 * in frameworks/base/core/java/android/content/res/Configuration.java
845 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
846 * Please go there to interpret the possible values each field can be.
847 *
848 * Logged from:
849 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
850 */
851message ResourceConfigurationChanged {
852 // Bit mask of color capabilities of the screen.
853 // Contains information about the color gamut and hdr mode of the screen.
854 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
855 optional int32 colorMode = 1;
856
857 // The target screen density being rendered to.
858 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
859 optional int32 densityDpi = 2;
860
861 // Current user preference for the scaling factor for fonts,
862 // relative to the base density scaling.
863 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
864 optional float fontScale = 3;
865
866 // Flag indicating whether the hard keyboard is hidden.
867 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
868 optional int32 hardKeyboardHidden = 4;
869
870 // The type of keyboard attached to the device.
871 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
872 optional int32 keyboard = 5;
873
874 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
875 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
876 optional int32 keyboardHideen = 6;
877
878 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
879 // 0 if undefined.
880 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
881 optional int32 mcc = 7;
882
883 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
884 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
885 // MNC_ZERO symbol defined in Configuration.java.
886 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
887 optional int32 mnc = 8;
888
889 // The kind of navigation available on the device.
890 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
891 optional int32 navigation = 9;
892
893 // Flag indicating whether the navigation is available.
894 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
895 optional int32 navigationHidden = 10;
896
897 // Overall orientation of the screen.
898 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
899 optional int32 orientation = 11;
900
901 // The current height of the available screen space, in dp units.
902 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
903 optional int32 screenHeightDp = 12;
904
905 // Bit mask of overall layout of the screen.
906 // Contains information about screen size, whether the screen is wider/taller
907 // than normal, whether the screen layout is right-tl-left or left-to-right,
908 // and whether the screen has a rounded shape.
909 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
910 optional int32 screenLayout = 13;
911
912 // Current width of the available screen space, in dp units.
913 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
914 optional int32 screenWidthDp = 14;
915
916 // The smallest screen size an application will see in normal operation.
917 // This is the smallest value of both screenWidthDp and screenHeightDp
918 // in portrait and landscape.
919 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
920 optional int32 smallestScreenWidthDp = 15;
921
922 // The type of touch screen attached to the device.
923 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
924 optional int32 touchscreen = 16;
925
926 // Bit mask of the ui mode.
927 // Contains information about the overall ui mode of the device.
928 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
929 // Also contains information about whether the device is in night mode.
930 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
931 optional int32 uiMode = 17;
932}
933
Tej Singheee317b2018-03-07 19:28:05 -0800934
935/**
936 * Logs changes in the connection state of the mobile radio.
937 *
938 * Logged from:
939 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
940 */
941message MobileConnectionStateChanged {
942 // States are from the state machine DataConnection.java.
943 enum State {
944 UNKNOWN = 0;
945 // The connection is inactive, or disconnected.
946 INACTIVE = 1;
947 // The connection is being activated, or connecting.
948 ACTIVATING = 2;
949 // The connection is active, or connected.
950 ACTIVE = 3;
951 // The connection is disconnecting.
952 DISCONNECTING = 4;
953 // The connection is disconnecting after creating a connection.
954 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
955 }
956 optional State state = 1;
957 // For multi-sim phones, this distinguishes between the sim cards.
958 optional int32 sim_slot_index = 2;
959 // Used to identify the connection. Starts at 0 and increments by 1 for
960 // every new network created. Resets whenever the device reboots.
961 optional int32 data_connection_id = 3;
962 // A bitmask for the capabilities of this connection.
963 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
964 // Default value (if we have no information): 0
965 optional int64 capabilities = 4;
966 // If this connection has internet.
967 // This just checks if the DEFAULT bit of capabilities is set.
968 optional bool has_internet = 5;
969}
970
971/**
972 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
973 *
974 * Logged from:
975 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
976 */
977message MobileRadioTechnologyChanged {
978 optional android.telephony.NetworkTypeEnum state = 1;
979 // For multi-sim phones, this distinguishes between the sim cards.
980 optional int32 sim_slot_index = 2;
981}
982
Andrew Chantb56388b2018-03-22 21:07:33 -0700983/**
984 * Logs the VID and PID of any connected USB devices.
985 *
986 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
987 *
988 * Logged by Vendor.
989 */
990message UsbDeviceAttached {
991 optional int32 vid = 1;
992 optional int32 pid = 2;
993 optional bool has_audio = 3;
994 optional bool has_hid = 4;
995 optional bool has_storage = 5;
996}
997
Tej Singheee317b2018-03-07 19:28:05 -0800998
Tej Singhdd7bd352018-02-09 19:33:15 -0800999/**
Tej Singh5d991e12018-03-09 19:48:11 -08001000 * Logs when Bluetooth is enabled and disabled.
1001 *
1002 * Logged from:
1003 * services/core/java/com/android/server/BluetoothManagerService.java
1004 */
1005message BluetoothEnabledStateChanged {
1006 repeated AttributionNode attribution_node = 1;
1007 // Whether or not bluetooth is enabled on the device.
1008 enum State {
1009 UNKNOWN = 0;
1010 ENABLED = 1;
1011 DISABLED = 2;
1012 }
1013 optional State state = 2;
1014 // The reason for being enabled/disabled.
1015 // Eg. Airplane mode, crash, application request.
1016 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1017 // If the reason is an application request, this will be the package name.
1018 optional string pkgName = 4;
1019}
1020
1021/**
Jack He22e4a1d2019-01-09 01:19:13 -08001022 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001023 *
1024 * Logged from:
Jack He22e4a1d2019-01-09 01:19:13 -08001025 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1026 *
1027 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001028 */
1029message BluetoothConnectionStateChanged {
1030 // The state of the connection.
1031 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1032 optional android.bluetooth.ConnectionStateEnum state = 1;
1033 // An identifier that can be used to match connect and disconnect events.
1034 // Currently is last two bytes of a hash of a device level ID and
1035 // the mac address of the bluetooth device that is connected.
Jack He22e4a1d2019-01-09 01:19:13 -08001036 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1037 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001038 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1039 // From android.bluetooth.BluetoothAdapter.java
Jack He22e4a1d2019-01-09 01:19:13 -08001040 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001041 optional int32 bt_profile = 3;
Jack He22e4a1d2019-01-09 01:19:13 -08001042 // An identifier that can be used to match events for this device.
1043 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1044 // Salt: Randomly generated 256 bit value
1045 // Hash algorithm: HMAC-SHA256
1046 // Size: 32 byte
1047 // Default: null or empty if the device identifier is not known
1048 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1049}
1050
1051/**
1052 * Logs when a Bluetooth device connects and disconnects over ACL
1053 *
1054 * Logged from:
1055 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1056 *
1057 * Next Tag: 3
1058 */
1059message BluetoothAclConnectionStateChanged {
1060 // An identifier that can be used to match events for this device.
1061 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1062 // Salt: Randomly generated 256 bit value
1063 // Hash algorithm: HMAC-SHA256
1064 // Size: 32 byte
1065 // Default: null or empty if the device identifier is not known
1066 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1067 // The state of the connection.
1068 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1069 optional android.bluetooth.ConnectionStateEnum state = 2;
1070}
1071
1072/**
1073 * Logs when a Bluetooth device connects and disconnects over SCO
1074 *
1075 * Logged from:
1076 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1077 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1078 *
1079 * Next Tag: 4
1080 */
1081message BluetoothScoConnectionStateChanged {
1082 // An identifier that can be used to match events for this device.
1083 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1084 // Salt: Randomly generated 256 bit value
1085 // Hash algorithm: HMAC-SHA256
1086 // Size: 32 byte
1087 // Default: null or empty if the device identifier is not known
1088 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1089 // The state of the connection.
1090 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1091 optional android.bluetooth.ConnectionStateEnum state = 2;
1092 // Codec used for this SCO connection
1093 // Default: UNKNOWN
1094 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001095}
1096
Jack He924f3462019-01-09 20:54:41 -08001097/**
1098 * Logged when active device of a profile changes
1099 *
1100 * Logged from:
1101 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1102 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1103 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1104 */
1105message BluetoothActiveDeviceChanged {
1106 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1107 // From android.bluetooth.BluetoothProfile
1108 optional int32 bt_profile = 1;
1109 // An identifier that can be used to match events for this new active device.
1110 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1111 // Salt: Randomly generated 256 bit value
1112 // Hash algorithm: HMAC-SHA256
1113 // Size: 32 byte
1114 // Default: null or empty if there is no active device for this profile
1115 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1116}
1117
Jack He52260142018-12-18 15:43:27 -08001118// Logs when there is an event affecting Bluetooth device's link layer connection.
1119// - This event is triggered when there is a related HCI command or event
1120// - Users of this metrics can deduce Bluetooth device's connection state from these events
1121// - HCI commands are logged before the command is sent, after receiving command status, and after
1122// receiving command complete
1123// - HCI events are logged when they arrive
1124//
1125// Low level log from system/bt
1126//
1127// Bluetooth classic commands:
1128// - CMD_CREATE_CONNECTION
1129// - CMD_DISCONNECT
1130// - CMD_CREATE_CONNECTION_CANCEL
1131// - CMD_ACCEPT_CONNECTION_REQUEST
1132// - CMD_REJECT_CONNECTION_REQUEST
1133// - CMD_SETUP_ESCO_CONNECTION
1134// - CMD_ACCEPT_ESCO_CONNECTION
1135// - CMD_REJECT_ESCO_CONNECTION
1136// - CMD_ENH_SETUP_ESCO_CONNECTION
1137// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1138//
1139// Bluetooth low energy commands:
1140// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1141// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1142// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1143// - CMD_BLE_CLEAR_WHITE_LIST
1144// - CMD_BLE_ADD_WHITE_LIST
1145// - CMD_BLE_REMOVE_WHITE_LIST
1146//
1147// Bluetooth classic events:
1148// - EVT_CONNECTION_COMP
1149// - EVT_CONNECTION_REQUEST
1150// - EVT_DISCONNECTION_COMP
1151// - EVT_ESCO_CONNECTION_COMP
1152// - EVT_ESCO_CONNECTION_CHANGED
1153//
1154// Bluetooth low energy meta events:
1155// - BLE_EVT_CONN_COMPLETE_EVT
1156// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1157//
1158// Next tag: 10
1159message BluetoothLinkLayerConnectionEvent {
1160 // An identifier that can be used to match events for this device.
1161 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1162 // Salt: Randomly generated 256 bit value
1163 // Hash algorithm: HMAC-SHA256
1164 // Size: 32 byte
1165 // Default: null or empty if the device identifier is not known
1166 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1167 // Connection handle of this connection if available
1168 // Range: 0x0000 - 0x0EFF (12 bits)
1169 // Default: 0xFFFF if the handle is unknown
1170 optional int32 connection_handle = 2;
1171 // Direction of the link
1172 // Default: DIRECTION_UNKNOWN
1173 optional android.bluetooth.DirectionEnum direction = 3;
1174 // Type of this link
1175 // Default: LINK_TYPE_UNKNOWN
1176 optional android.bluetooth.LinkTypeEnum type = 4;
1177
1178 // Reason metadata for this link layer connection event, rules for interpretation:
1179 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1180 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1181 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1182 // set and valid, ignore hci_ble_event
1183
1184 // HCI command associated with this event
1185 // Default: CMD_UNKNOWN
1186 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1187 // HCI event associated with this event
1188 // Default: EVT_UNKNOWN
1189 optional android.bluetooth.hci.EventEnum hci_event = 6;
1190 // HCI BLE meta event associated with this event
1191 // Default: BLE_EVT_UNKNOWN
1192 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1193 // HCI command status code if this is triggerred by hci_cmd
1194 // Default: STATUS_UNKNOWN
1195 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1196 // HCI reason code associated with this event
1197 // Default: STATUS_UNKNOWN
1198 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1199}
1200
Jack He924f3462019-01-09 20:54:41 -08001201/**
1202 * Logs when there is a change in Bluetooth A2DP playback state
1203 *
1204 * Logged from:
1205 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1206 */
1207message BluetoothA2dpPlaybackStateChanged {
1208 // An identifier that can be used to match events for this device.
1209 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1210 // Salt: Randomly generated 256 bit value
1211 // Hash algorithm: HMAC-SHA256
1212 // Size: 32 byte
1213 // Default: null or empty if the device identifier is not known
1214 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1215 // Current playback state
1216 // Default: PLAYBACK_STATE_UNKNOWN
1217 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1218 // Current audio coding mode
1219 // Default: AUDIO_CODING_MODE_UNKNOWN
1220 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1221}
1222
1223/**
1224 * Logs when there is a change in A2DP codec config for a particular remote device
1225 *
1226 * Logged from:
1227 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1228 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1229 */
1230message BluetoothA2dpCodecConfigChanged {
1231 // An identifier that can be used to match events for this device.
1232 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1233 // Salt: Randomly generated 256 bit value
1234 // Hash algorithm: HMAC-SHA256
1235 // Size: 32 byte
1236 // Default: null or empty if the device identifier is not known
1237 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1238 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1239 // Default SOURCE_CODEC_TYPE_INVALID
1240 optional int32 codec_type = 2;
1241 // Codec priroity, the higher the more preferred, -1 for disabled
1242 // Default: CODEC_PRIORITY_DEFAULT
1243 optional int32 codec_priority = 3;
1244 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1245 // Default: SAMPLE_RATE_NONE
1246 optional int32 sample_rate = 4;
1247 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1248 // Default: BITS_PER_SAMPLE_NONE
1249 optional int32 bits_per_sample = 5;
1250 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1251 // Default: CHANNEL_MODE_NONE
1252 optional int32 channel_mode = 6;
1253 // Codec specific values
1254 // Default 0
1255 optional int64 codec_specific_1 = 7;
1256 optional int64 codec_specific_2 = 8;
1257 optional int64 codec_specific_3 = 9;
1258 optional int64 codec_specific_4 = 10;
1259}
1260
1261/**
1262 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1263 * Each codec's capability is logged separately due to statsd restriction
1264 *
1265 * Logged from:
1266 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1267 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1268 */
1269message BluetoothA2dpCodecCapabilityChanged {
1270 // An identifier that can be used to match events for this device.
1271 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1272 // Salt: Randomly generated 256 bit value
1273 // Hash algorithm: HMAC-SHA256
1274 // Size: 32 byte
1275 // Default: null or empty if the device identifier is not known
1276 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1277 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1278 // Default SOURCE_CODEC_TYPE_INVALID
1279 optional int32 codec_type = 2;
1280 // Codec priroity, the higher the more preferred, -1 for disabled
1281 // Default: CODEC_PRIORITY_DEFAULT
1282 optional int32 codec_priority = 3;
1283 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1284 // in BluetoothCodecConfig
1285 // Default: empty and SAMPLE_RATE_NONE for individual item
1286 optional int32 sample_rate = 4;
1287 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1288 // in BluetoothCodecConfig
1289 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1290 optional int32 bits_per_sample = 5;
1291 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1292 // BluetoothCodecConfig
1293 // Default: empty and CHANNEL_MODE_NONE for individual item
1294 optional int32 channel_mode = 6;
1295 // Codec specific values
1296 // Default 0
1297 optional int64 codec_specific_1 = 7;
1298 optional int64 codec_specific_2 = 8;
1299 optional int64 codec_specific_3 = 9;
1300 optional int64 codec_specific_4 = 10;
1301}
1302
1303/**
1304 * Logs when A2DP failed to read from PCM source.
1305 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1306 *
1307 * Logged from:
1308 * system/bt
1309 */
1310message BluetoothA2dpAudioUnderrunReported {
1311 // An identifier that can be used to match events for this device.
1312 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1313 // Salt: Randomly generated 256 bit value
1314 // Hash algorithm: HMAC-SHA256
1315 // Size: 32 byte
1316 // Default: null or empty if the device identifier is not known
1317 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1318 // Encoding interval in nanoseconds
1319 // Default: 0
1320 optional int64 encoding_interval_nanos = 2;
1321 // Number of bytes of PCM data that could not be read from the source
1322 // Default: 0
1323 optional int32 num_missing_pcm_bytes = 3;
1324}
1325
1326/**
1327 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1328 * buffer queue is full and we have to drop data
1329 *
1330 * Logged from:
1331 * system/bt
1332 */
1333message BluetoothA2dpAudioOverrunReported {
1334 // An identifier that can be used to match events for this device.
1335 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1336 // Salt: Randomly generated 256 bit value
1337 // Hash algorithm: HMAC-SHA256
1338 // Size: 32 byte
1339 // Default: null or empty if the device identifier is not known
1340 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1341 // Encoding interval in nanoseconds
1342 // Default: 0
1343 optional int64 encoding_interval_nanos = 2;
1344 // Number of buffers dropped in this event
1345 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1346 // Default: 0
1347 optional int32 num_dropped_buffers = 3;
1348 // Number of encoded buffers dropped in this event
1349 // Default 0
1350 optional int32 num_dropped_encoded_frames = 4;
1351 // Number of encoded bytes dropped in this event
1352 // Default: 0
1353 optional int32 num_dropped_encoded_bytes = 5;
1354}
1355
1356/**
1357 * Logs when we receive reports regarding a device's RSSI value
1358 *
1359 * Logged from:
1360 * system/bt
1361 */
1362message BluetoothDeviceRssiReported {
1363 // An identifier that can be used to match events for this device.
1364 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1365 // Salt: Randomly generated 256 bit value
1366 // Hash algorithm: HMAC-SHA256
1367 // Size: 32 byte
1368 // Default: null or empty if the device identifier is not known
1369 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1370 // Connection handle of this connection if available
1371 // Range: 0x0000 - 0x0EFF (12 bits)
1372 // Default: 0xFFFF if the handle is unknown
1373 optional int32 connection_handle = 2;
1374 // HCI command status code if this is triggerred by hci_cmd
1375 // Default: STATUS_UNKNOWN
1376 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1377 // BR/EDR
1378 // Range: -128 ≤ N ≤ 127 (signed integer)
1379 // Units: dB
1380 // LE:
1381 // Range: -127 to 20, 127 (signed integer)
1382 // Units: dBm
1383 // Invalid when an out of range value is reported
1384 optional int32 rssi = 4;
1385}
1386
1387/**
1388 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1389 *
1390 * Logged from:
1391 * system/bt
1392 */
1393message BluetoothDeviceFailedContactCounterReported {
1394 // An identifier that can be used to match events for this device.
1395 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1396 // Salt: Randomly generated 256 bit value
1397 // Hash algorithm: HMAC-SHA256
1398 // Size: 32 byte
1399 // Default: null or empty if the device identifier is not known
1400 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1401 // Connection handle of this connection if available
1402 // Range: 0x0000 - 0x0EFF (12 bits)
1403 // Default: 0xFFFF if the handle is unknown
1404 optional int32 connection_handle = 2;
1405 // HCI command status code if this is triggerred by hci_cmd
1406 // Default: STATUS_UNKNOWN
1407 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1408 // Number of consecutive failed contacts for a connection corresponding to the Handle
1409 // Range: uint16_t, 0-0xFFFF
1410 // Default: 0xFFFFF
1411 optional int32 failed_contact_counter = 4;
1412}
1413
1414/**
1415 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1416 *
1417 * Logged from:
1418 * system/bt
1419 */
1420message BluetoothDeviceTxPowerLevelReported {
1421 // An identifier that can be used to match events for this device.
1422 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1423 // Salt: Randomly generated 256 bit value
1424 // Hash algorithm: HMAC-SHA256
1425 // Size: 32 byte
1426 // Default: null or empty if the device identifier is not known
1427 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1428 // Connection handle of this connection if available
1429 // Range: 0x0000 - 0x0EFF (12 bits)
1430 // Default: 0xFFFF if the handle is unknown
1431 optional int32 connection_handle = 2;
1432 // HCI command status code if this is triggerred by hci_cmd
1433 // Default: STATUS_UNKNOWN
1434 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1435 // Range: -30 ≤ N ≤ 20
1436 // Units: dBm
1437 // Invalid when an out of range value is reported
1438 optional int32 transmit_power_level = 4;
1439}
Jack He52260142018-12-18 15:43:27 -08001440
Tej Singh5d991e12018-03-09 19:48:11 -08001441/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001442 * Logs when something is plugged into or removed from the USB-C connector.
1443 *
1444 * Logged from:
1445 * Vendor USB HAL.
1446 */
1447message UsbConnectorStateChanged {
1448 enum State {
1449 DISCONNECTED = 0;
1450 CONNECTED = 1;
1451 }
1452 optional State state = 1;
1453}
1454
1455/**
1456 * Logs the reported speaker impedance.
1457 *
1458 * Logged from:
1459 * Vendor audio implementation.
1460 */
1461message SpeakerImpedanceReported {
1462 optional int32 speaker_location = 1;
1463 optional int32 impedance = 2;
1464}
1465
1466/**
1467 * Logs the report of a failed hardware.
1468 *
1469 * Logged from:
1470 * Vendor HALs.
1471 *
1472 */
1473message HardwareFailed {
1474 enum HardwareType {
1475 HARDWARE_FAILED_UNKNOWN = 0;
1476 HARDWARE_FAILED_MICROPHONE = 1;
1477 HARDWARE_FAILED_CODEC = 2;
1478 HARDWARE_FAILED_SPEAKER = 3;
1479 HARDWARE_FAILED_FINGERPRINT = 4;
1480 }
1481 optional HardwareType hardware_type = 1;
1482
1483 /* hardware_location allows vendors to differentiate between multiple instances of
1484 * the same hardware_type. The specific locations are vendor defined integers,
1485 * referring to board-specific numbering schemes.
1486 */
1487 optional int32 hardware_location = 2;
1488
1489 /* failure_code is specific to the HardwareType of the failed hardware.
1490 * It should use the enum values defined below.
1491 */
1492 enum MicrophoneFailureCode {
1493 MICROPHONE_FAILURE_COMPLETE = 0;
1494 }
1495 enum CodecFailureCode {
1496 CODEC_FAILURE_COMPLETE = 0;
1497 }
1498 enum SpeakerFailureCode {
1499 SPEAKER_FAILURE_COMPLETE = 0;
1500 SPEAKER_FAILURE_HIGH_Z = 1;
1501 SPEAKER_FAILURE_SHORT = 2;
1502 }
1503 enum FingerprintFailureCode {
1504 FINGERPRINT_FAILURE_COMPLETE = 0;
1505 FINGERPRINT_SENSOR_BROKEN = 1;
1506 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1507 }
1508 optional int32 failure_code = 3;
1509}
1510
1511/**
1512 * Log an event when the device has been physically dropped.
1513 * Reported from the /vendor partition.
1514 */
1515message PhysicalDropDetected {
1516 // Confidence that the event was actually a drop, 0 -> 100
1517 optional int32 confidence_pctg = 1;
1518 // Peak acceleration of the drop, in 1/1000s of a g.
1519 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001520 // Duration of freefall in ms
1521 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001522}
1523
1524/**
1525 * Log bucketed battery charge cycles.
1526 *
1527 * Each bucket represents cycles of the battery past
1528 * a given charge point. For example, bucket 1 is the
1529 * lowest 1/8th of the battery, and bucket 8 is 100%.
1530 *
1531 * Logged from:
1532 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1533 */
1534message ChargeCyclesReported {
1535 optional int32 cycle_bucket_1 = 1;
1536 optional int32 cycle_bucket_2 = 2;
1537 optional int32 cycle_bucket_3 = 3;
1538 optional int32 cycle_bucket_4 = 4;
1539 optional int32 cycle_bucket_5 = 5;
1540 optional int32 cycle_bucket_6 = 6;
1541 optional int32 cycle_bucket_7 = 7;
1542 optional int32 cycle_bucket_8 = 8;
1543}
1544
1545/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001546 * Logs the duration of a davey (jank of >=700ms) when it occurs
1547 *
1548 * Logged from:
1549 * frameworks/base/libs/hwui/JankTracker.cpp
1550 */
1551message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001552 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001553 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001554
Tej Singhbb8554a2018-01-26 11:59:14 -08001555 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001556 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001557}
1558
1559/**
Bookatze5885242017-10-24 20:10:31 -07001560 * Logs phone signal strength changes.
1561 *
1562 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001563 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001564 */
1565message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001566 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1567 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001568}
1569
Yangster4ccebea2018-10-09 17:09:02 -07001570
1571/**
1572 * Logs when the phone state, sim state or signal strength changes
1573 *
1574 * Logged from:
1575 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1576 */
1577message PhoneServiceStateChanged {
1578 optional android.telephony.ServiceStateEnum state = 1;
1579 optional android.telephony.SimStateEnum sim_state = 2;
1580 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1581}
1582
1583/**
1584 * Logs when the phone becomes on or off.
1585 *
1586 * Logged from:
1587 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1588 */
1589message PhoneStateChanged {
1590 enum State {
1591 OFF = 0;
1592 ON = 1;
1593 }
1594 optional State state = 1;
1595}
1596
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001597message LauncherUIChanged {
Yao Chen046b5122018-10-24 14:09:20 -07001598 optional android.stats.launcher.LauncherAction action = 1;
1599 optional android.stats.launcher.LauncherState src_state = 2;
1600 optional android.stats.launcher.LauncherState dst_state = 3;
1601 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001602 optional bool is_swipe_up_enabled = 5;
1603}
1604
David Chenc28b2bb2017-10-24 12:52:52 -07001605/**
1606 * Logs that a setting was updated.
1607 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001608 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001609 * The tag and is_default allow resetting of settings to default values based on the specified
1610 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1611 */
1612message SettingChanged {
1613 // The name of the setting.
1614 optional string setting = 1;
1615
1616 // The change being imposed on this setting. May represent a number, eg "3".
1617 optional string value = 2;
1618
1619 // The new value of this setting. For most settings, this is same as value. For some settings,
1620 // value is +X or -X where X represents an element in a set. For example, if the previous value
1621 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1622 // The +/- feature is currently only used for location_providers_allowed.
1623 optional string new_value = 3;
1624
1625 // The previous value of this setting.
1626 optional string prev_value = 4;
1627
1628 // The tag used with the is_default for resetting sets of settings. This is generally null.
1629 optional string tag = 5;
1630
Bookatz90867622018-01-31 15:05:57 -08001631 // True if this setting with tag should be resettable.
1632 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001633
David Chenbd789912018-03-16 17:19:55 -07001634 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001635 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001636
1637 enum ChangeReason {
1638 UPDATED = 1; // Updated can be an insertion or an update.
1639 DELETED = 2;
1640 }
1641 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001642}
Chenjie Yub3dda412017-10-24 13:41:59 -07001643
Chenjie Yu05013b32017-11-21 10:21:41 -08001644/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001645 * Logs activity going to foreground or background
1646 *
1647 * Logged from:
1648 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1649 */
1650message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001651 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001652 optional string pkg_name = 2;
1653 optional string class_name = 3;
1654
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001655 enum State {
1656 BACKGROUND = 0;
1657 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001658 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001659 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001660}
David Chenc8a43242017-10-17 16:23:28 -07001661
1662/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001663 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001664 * Logged from:
1665 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1666 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001667message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001668 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001669
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001670 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001671
1672 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001673 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001674 optional string process_name = 3;
1675
1676 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001677 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001678
1679 optional string package_name = 5;
1680
1681 enum InstantApp {
1682 UNAVAILABLE = 0;
1683 FALSE = 1;
1684 TRUE = 2;
1685 }
1686 optional InstantApp is_instant_app = 6;
1687
1688 enum ForegroundState {
1689 UNKNOWN = 0;
1690 BACKGROUND = 1;
1691 FOREGROUND = 2;
1692 }
1693 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001694}
David Chen9e3808c2017-11-20 17:25:34 -08001695
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001696/**
1697 * Logs when a WTF (What a Terrible Failure) happened.
1698 * Logged from:
1699 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1700 */
1701message WTFOccurred {
1702 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001703
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001704 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001705
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001706 // The name of the process.
1707 // system_server if it is not by an app
1708 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001709
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001710 // The pid if available. -1 means not available.
1711 optional sint32 pid = 4;
1712}
1713
1714/**
1715 * Logs when system server reports low memory.
1716 * Logged from:
1717 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1718 */
1719message LowMemReported {
1720}
1721
1722/**
1723 * Logs when an app ANR (App Not Responding) occurs.
1724 * Logged from:
1725 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1726 */
1727message ANROccurred {
1728 optional int32 uid = 1 [(is_uid) = true];
1729
1730 optional string process_name = 2;
1731
1732 optional string short_component_name = 3;
1733
1734 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001735
1736 enum InstantApp {
1737 UNAVAILABLE = 0;
1738 FALSE = 1;
1739 TRUE = 2;
1740 }
1741 optional InstantApp is_instant_app = 5;
1742
1743 enum ForegroundState {
1744 UNKNOWN = 0;
1745 BACKGROUND = 1;
1746 FOREGROUND = 2;
1747 }
1748 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08001749}
1750
David Chen0a368b22017-12-06 16:28:16 -08001751/*
1752 * Allows other apps to push events into statsd.
1753 * Logged from:
1754 * frameworks/base/core/java/android/util/StatsLog.java
1755 */
David Chen0b5c90c2018-01-25 16:51:49 -08001756message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001757 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001758 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001759
1760 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1761 optional int32 label = 2;
1762
1763 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1764 // predicates for the metrics).
1765 enum State {
1766 UNKNOWN = 0;
1767 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1768 STOP = 2;
1769 START = 3;
1770 }
1771 optional State state = 3;
1772}
1773
David Chen9e3808c2017-11-20 17:25:34 -08001774/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001775 * Logs when statsd detects an anomaly.
1776 *
1777 * Logged from:
1778 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1779 */
1780message AnomalyDetected {
1781 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001782 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001783
Yangster-mac94e197c2018-01-02 16:03:03 -08001784 // Id of the config whose anomaly detection alert fired.
1785 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001786
Yangster-mac94e197c2018-01-02 16:03:03 -08001787 // Id of the alert (i.e. name of the anomaly that was detected).
1788 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001789}
1790
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001791message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001792 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001793 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001794
1795 // The app package name.
1796 optional string pkg_name = 2;
1797
1798 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001799 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001800 WARM = 1;
1801 HOT = 2;
1802 COLD = 3;
1803 }
1804 // The transition type.
1805 optional TransitionType type = 3;
1806
1807 // The activity name.
1808 optional string activity_name = 4;
1809
1810 // The name of the calling app. Empty if not set.
1811 optional string calling_pkg_name = 5;
1812
1813 // Whether the app is an instant app.
1814 optional bool is_instant_app = 6;
1815
1816 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001817 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001818
Bookatz80d11a02018-01-16 10:46:35 -08001819 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001820
David Chen0b5c90c2018-01-25 16:51:49 -08001821 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001822 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001823 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001824 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001825 optional int32 bind_application_delay_millis = 11;
1826 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001827
1828 // Empty if not set.
1829 optional string launch_token = 13;
1830
Calin Juravle759fbda2018-02-20 19:52:30 +00001831 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001832 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001833
1834 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001835 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001836}
1837
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001838message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001839 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001840 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001841
1842 // The app package name.
1843 optional string pkg_name = 2;
1844
1845 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001846 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001847 WARM = 1;
1848 HOT = 2;
1849 COLD = 3;
1850 }
1851 // The transition type.
1852 optional TransitionType type = 3;
1853
1854 // The activity name.
1855 optional string activity_name = 4;
1856}
1857
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001858message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001859 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001860 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001861
1862 // The app package name.
1863 optional string pkg_name = 2;
1864
1865 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001866 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001867 WITH_BUNDLE = 1;
1868 WITHOUT_BUNDLE = 2;
1869 }
1870 // The transition type.
1871 optional TransitionType type = 3;
1872
1873 // The activity name.
1874 optional string activity_name = 4;
1875
1876 optional bool transition_process_running = 5;
1877
1878 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001879 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001880}
1881
Bookatz8fcd09a2017-12-18 13:01:10 -08001882/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001883 * Logs a picture-in-picture action
1884 * Logged from:
1885 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1886 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1887 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1888 */
1889message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001890 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001891 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001892
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001893 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001894
Chenjie Yu52cacc62017-12-08 18:11:45 -08001895 enum State {
1896 ENTERED = 1;
1897 EXPANDED_TO_FULL_SCREEN = 2;
1898 MINIMIZED = 3;
1899 DISMISSED = 4;
1900 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001901 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001902}
1903
1904/**
Chenjie Yue8904192017-12-08 19:12:57 -08001905 * Logs overlay action
1906 * Logged from:
1907 * services/core/java/com/android/server/wm/Session.java
1908 */
1909message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001910 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001911
1912 optional string package_name = 2;
1913
1914 optional bool using_alert_window = 3;
1915
1916 enum State {
1917 ENTERED = 1;
1918 EXITED = 2;
1919 }
1920 optional State state = 4;
1921}
1922
Chenjie Yuccfe6452018-01-30 11:33:21 -08001923/*
1924 * Logs foreground service starts and stops.
1925 * Note that this is not when a service starts or stops, but when it is
1926 * considered foreground.
1927 * Logged from
1928 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1929 */
1930message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001931 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001932 // package_name + "/" + class_name
1933 optional string short_name = 2;
1934
1935 enum State {
1936 ENTER = 1;
1937 EXIT = 2;
1938 }
1939 optional State state = 3;
1940}
1941
Chenjie Yue8904192017-12-08 19:12:57 -08001942/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001943 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1944 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1945 * attributed back to the parent (host) uid. One example is Chrome.
1946 *
1947 * Logged from:
1948 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1949 */
1950message IsolatedUidChanged {
1951 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001952 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001953 optional int32 parent_uid = 1;
1954
1955 optional int32 isolated_uid = 2;
1956
1957 // We expect an isolated uid to be removed before if it's used for another parent uid.
1958 enum Event {
1959 REMOVED = 0;
1960 CREATED = 1;
1961 }
1962 optional Event event = 3;
1963}
1964
1965/*
1966 * Logs the reception of an incoming network packet causing the main system to wake up for
1967 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1968 * and processed by WakeupController.cpp.
1969 */
1970message PacketWakeupOccurred {
1971 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1972 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001973 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001974 // The interface name on which the packet was received.
1975 optional string iface = 2;
1976 // The ethertype value of the packet.
1977 optional int32 ethertype = 3;
1978 // String representation of the destination MAC address of the packet.
1979 optional string destination_hardware_address = 4;
1980 // String representation of the source address of the packet if this was an IP packet.
1981 optional string source_ip = 5;
1982 // String representation of the destination address of the packet if this was an IP packet.
1983 optional string destination_ip = 6;
1984 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1985 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1986 // families.
1987 optional int32 ip_next_header = 7;
1988 // The source port if this was a TCP or UDP packet.
1989 optional int32 source_port = 8;
1990 // The destination port if this was a TCP or UDP packet.
1991 optional int32 destination_port = 9;
1992}
1993
1994/*
1995 * Logs the memory stats for an app on startup.
1996 * Logged from:
1997 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1998 */
1999message AppStartMemoryStateCaptured {
2000 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002001 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002002
2003 // The process name.
2004 optional string process_name = 2;
2005
2006 // The activity name.
2007 optional string activity_name = 3;
2008
2009 // # of page-faults
2010 optional int64 pgfault = 4;
2011
2012 // # of major page-faults
2013 optional int64 pgmajfault = 5;
2014
2015 // RSS
2016 optional int64 rss_in_bytes = 6;
2017
2018 // CACHE
2019 optional int64 cache_in_bytes = 7;
2020
2021 // SWAP
2022 optional int64 swap_in_bytes = 8;
2023}
2024
2025/*
2026 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2027 * for LMK event.
2028 * Logged from:
2029 * system/core/lmkd/lmkd.c
2030 */
2031message LmkStateChanged {
2032 enum State {
2033 UNKNOWN = 0;
2034 START = 1;
2035 STOP = 2;
2036 }
2037 optional State state = 1;
2038}
2039
2040/*
2041 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2042 * Logged from:
2043 * system/core/lmkd/lmkd.c
2044 */
2045message LmkKillOccurred {
2046 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002047 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002048
2049 // The process name.
2050 optional string process_name = 2;
2051
2052 // oom adj score.
2053 optional int32 oom_score = 3;
2054
2055 // # of page-faults
2056 optional int64 pgfault = 4;
2057
2058 // # of major page-faults
2059 optional int64 pgmajfault = 5;
2060
2061 // RSS
2062 optional int64 rss_in_bytes = 6;
2063
2064 // CACHE
2065 optional int64 cache_in_bytes = 7;
2066
2067 // SWAP
2068 optional int64 swap_in_bytes = 8;
Jim Blackler972a5c52018-11-21 15:24:48 +00002069
2070 // The elapsed real time of start of the process.
2071 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002072}
2073
Rajeev Kumar51b54602018-03-01 12:18:26 -08002074/*
2075 * Logs when the ActivityManagerService detects that an app died.
2076 *
2077 * Logged from:
2078 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2079 */
2080message AppDied {
2081 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07002082 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002083}
2084
Chenjie Yubbcbc602018-02-05 16:51:52 -08002085//////////////////////////////////////////////////////////////////////
2086// Pulled atoms below this line //
2087//////////////////////////////////////////////////////////////////////
2088
2089/**
David Chenc8a43242017-10-17 16:23:28 -07002090 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2091 *
2092 * Pulled from:
2093 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2094 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002095message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002096 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002097
2098 optional int64 rx_bytes = 2;
2099
2100 optional int64 rx_packets = 3;
2101
2102 optional int64 tx_bytes = 4;
2103
2104 optional int64 tx_packets = 5;
2105}
2106
2107/**
2108 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2109 *
2110 * Pulled from:
2111 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2112 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002113message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002114 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002115
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002116 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2117 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002118
2119 optional int64 rx_bytes = 3;
2120
2121 optional int64 rx_packets = 4;
2122
2123 optional int64 tx_bytes = 5;
2124
2125 optional int64 tx_packets = 6;
2126}
2127
2128/**
2129 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2130 *
2131 * Pulled from:
2132 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2133 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002134message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002135 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002136
2137 optional int64 rx_bytes = 2;
2138
2139 optional int64 rx_packets = 3;
2140
2141 optional int64 tx_bytes = 4;
2142
2143 optional int64 tx_packets = 5;
2144}
2145
2146/**
2147 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2148 *
2149 * Pulled from:
2150 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2151 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002152message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002153 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002154
Yao Chenc40a19d2018-03-15 16:48:25 -07002155 // 1 denotes foreground and 0 denotes background. This is called Set in
2156 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002157 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002158
2159 optional int64 rx_bytes = 3;
2160
2161 optional int64 rx_packets = 4;
2162
2163 optional int64 tx_bytes = 5;
2164
2165 optional int64 tx_packets = 6;
2166}
2167
2168/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002169 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2170 *
2171 * Pulled from:
2172 * StatsCompanionService
2173 */
2174message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002175 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002176
2177 optional int64 rx_bytes = 2;
2178
2179 optional int64 tx_bytes = 3;
2180}
2181
2182/**
David Chenc8a43242017-10-17 16:23:28 -07002183 * Pulls the kernel wakelock durations. This atom is adapted from
2184 * android/internal/os/KernelWakelockStats.java
2185 *
2186 * Pulled from:
2187 * StatsCompanionService using KernelWakelockReader.
2188 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002189message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002190 optional string name = 1;
2191
2192 optional int32 count = 2;
2193
2194 optional int32 version = 3;
2195
2196 optional int64 time = 4;
2197}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002198
Chenjie Yu05013b32017-11-21 10:21:41 -08002199/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002200 * Pulls low power state information. This includes platform and subsystem sleep state information,
2201 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002202 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002203 * hardware/interfaces/power/1.1/types.hal
2204 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002205message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002206 // Subsystem name
2207 optional string subsystem_name = 1;
2208 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2209 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2210 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002211 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002212 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002213 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002214 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002215}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002216
Chenjie Yu05013b32017-11-21 10:21:41 -08002217/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002218 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002219 * Pulls the time the cpu spend on the frequency index. Frequency index
2220 * starts from highest to lowest. The value should be monotonically
2221 * increasing since boot. However, if there is a cpu
2222 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002223 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002224message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002225 optional uint32 cluster = 1;
2226 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002227 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002228}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002229
Chenjie Yu05013b32017-11-21 10:21:41 -08002230/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002231 * Pulls Cpu Time Per Uid.
2232 * Note that isolated process uid time should be attributed to host uids.
2233 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002234message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002235 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002236 optional uint64 user_time_micros = 2;
2237 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002238}
2239
2240/**
2241 * Pulls Cpu Time Per Uid per frequency.
2242 * Note that isolated process uid time should be attributed to host uids.
2243 * For each uid, we order the time by descending frequencies.
2244 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002245message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002246 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002247 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002248 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002249}
Hugo Benichi884970e2017-11-14 22:42:46 +09002250
Chenjie Yu05013b32017-11-21 10:21:41 -08002251/**
2252 * Pulls Wifi Controller Activity Energy Info
2253 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002254message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002255 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002256 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002257 // stack reported state
2258 // TODO: replace this with proto enum
2259 optional int32 stack_state = 2;
2260 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002261 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002262 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002263 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002264 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002265 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002266 // product of current(mA), voltage(V) and time(ms)
2267 optional uint64 controller_energy_used = 6;
2268}
2269
2270/**
2271 * Pulls Modem Activity Energy Info
2272 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002273message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002274 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002275 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002276 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08002277 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08002278 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002279 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002280 /**
2281 * Tx power index
2282 * index 0 = tx_power < 0dBm
2283 * index 1 = 0dBm < tx_power < 5dBm
2284 * index 2 = 5dBm < tx_power < 15dBm
2285 * index 3 = 15dBm < tx_power < 20dBm
2286 * index 4 = tx_power > 20dBm
2287 */
2288 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002289 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002290 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002291 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002292 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002293 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002294 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002295 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002296 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002297 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002298 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002299 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002300 // product of current(mA), voltage(V) and time(ms)
2301 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002302}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002303
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002304/**
2305 * Pulls Bluetooth Activity Energy Info
2306 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2307 */
2308message BluetoothActivityInfo {
2309 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002310 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002311 // bluetooth stack state
2312 optional int32 bluetooth_stack_state = 2;
2313 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002314 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002315 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002316 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002317 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002318 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002319 // product of current(mA), voltage(V) and time(ms)
2320 optional uint64 energy_used = 6;
2321}
2322
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002323/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002324 * Logs the memory stats for a process.
2325 */
2326message ProcessMemoryState {
2327 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002328 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002329
2330 // The process name.
2331 optional string process_name = 2;
2332
2333 // oom adj score.
2334 optional int32 oom_score = 3;
2335
2336 // # of page-faults
2337 optional int64 pgfault = 4;
2338
2339 // # of major page-faults
2340 optional int64 pgmajfault = 5;
2341
Rajeev Kumar90235992018-01-29 11:06:48 -08002342 // RSS
2343 optional int64 rss_in_bytes = 6;
2344
2345 // CACHE
2346 optional int64 cache_in_bytes = 7;
2347
2348 // SWAP
2349 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002350}
2351
2352/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002353 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002354 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002355message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002356 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002357}
2358
2359/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002360 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002361 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002362message SystemUptime {
2363 // Milliseconds since the system was booted.
2364 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2365 // for external input).
2366 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002367 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002368}
2369
2370/*
2371 * Reads from /proc/uid_concurrent_active_time which has the format:
2372 * active: X (X is # cores)
2373 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2374 * [uid1]: [time-0] [time-1] [time-2] ... ...
2375 * ...
2376 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2377 * The file contains a monotonically increasing count of time for a single boot.
2378 */
2379message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002380 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002381 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002382}
2383
2384/**
2385 * Reads from /proc/uid_concurrent_policy_time which has the format:
2386 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2387 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2388 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2389 * ...
2390 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2391 * The file contains a monotonically increasing count of time for a single boot.
2392 */
2393message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002394 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002395 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002396 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002397}
2398
2399/*
2400 * Pulls free disk space, for data, system partition and temporary directory.
2401 */
2402message DiskSpace {
2403 // available bytes in data partition
2404 optional uint64 data_available_bytes = 1;
2405 // available bytes in system partition
2406 optional uint64 system_available_bytes = 2;
2407 // available bytes in download cache or temp directories
2408 optional uint64 temp_available_bytes = 3;
2409}
Tej Singhbf972d92018-01-10 20:51:13 -08002410
2411/**
2412 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002413 * Pulled from:
2414 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002415 */
2416message RemainingBatteryCapacity {
2417 optional int32 charge_uAh = 1;
2418}
2419
2420/**
2421 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002422 * Pulled from:
2423 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002424 */
2425message FullBatteryCapacity {
2426 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08002427}
2428
2429/**
Tej Singhd89137e2018-03-26 14:51:40 -07002430 * Pulls the temperature of various parts of the device.
2431 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002432 *
2433 * Pulled from:
2434 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2435 */
2436message Temperature {
2437 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2438 optional android.os.TemperatureTypeEnum sensor_location = 1;
2439
2440 // The name of the temperature source. Eg. CPU0
2441 optional string sensor_name = 2;
2442
Tej Singhd89137e2018-03-26 14:51:40 -07002443 // Temperature in tenths of a degree C.
2444 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08002445}
lifr35a7cf02018-12-12 16:38:04 +08002446
2447/**
2448 * Logs the latency period(in microseconds) and the return code of
2449 * the DNS(Domain Name System) lookups.
2450 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
2451 * to get info(address or hostname) from DNS server(or DNS cache).
2452 * Logged from:
2453 * /system/netd/server/DnsProxyListener.cpp
2454 */
2455message NetworkDnsEventReported {
2456 // The types of the DNS lookups, as defined in
2457 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
2458 enum EventType {
2459 EVENT_UNKNOWN = 0;
2460 EVENT_GETADDRINFO = 1;
2461 EVENT_GETHOSTBYNAME = 2;
2462 EVENT_GETHOSTBYADDR = 3;
2463 EVENT_RES_NSEND = 4;
2464 }
2465 optional EventType event_type = 1;
2466
2467 // The return value of the DNS resolver for each DNS lookups.
2468 //bionic/libc/include/netdb.h
2469 //system/netd/resolv/include/netd_resolv/resolv.h
2470 enum ReturnCode {
2471 EAI_NO_ERROR = 0;
2472 EAI_ADDRFAMILY = 1;
2473 EAI_AGAIN = 2;
2474 EAI_BADFLAGS = 3;
2475 EAI_FAIL = 4;
2476 EAI_FAMILY = 5;
2477 EAI_MEMORY = 6;
2478 EAI_NODATA = 7;
2479 EAI_NONAME = 8;
2480 EAI_SERVICE = 9;
2481 EAI_SOCKTYPE = 10;
2482 EAI_SYSTEM = 11;
2483 EAI_BADHINTS = 12;
2484 EAI_PROTOCOL = 13;
2485 EAI_OVERFLOW = 14;
2486 RESOLV_TIMEOUT = 255;
2487 EAI_MAX = 256;
2488 }
2489 optional ReturnCode return_code = 2;
2490
2491 // The latency period(in microseconds) it took for this DNS lookup to complete.
2492 optional int32 latency_micros = 3;
2493}
2494
Chiachang Wang67f24472019-01-15 15:14:00 +08002495/**
2496 * Logs when a data stall event occurs.
2497 *
2498 * Log from:
2499 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2500 */
2501message DataStallEvent {
2502 // Data stall evaluation type.
2503 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2504 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
2505 optional int32 evaluation_type = 1;
2506 // See definition in data_stall_event.proto.
2507 optional com.android.server.connectivity.ProbeResult validation_result = 2;
2508 // See definition in data_stall_event.proto.
2509 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
2510 // See definition in data_stall_event.proto.
2511 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
2512 // See definition in data_stall_event.proto.
2513 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
2514 // See definition in data_stall_event.proto.
2515 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
2516}
Jack Yu6d421bc2019-01-23 17:42:54 +08002517
2518/**
2519 * Logs when a NFC device's error occurred.
2520 * Logged from:
2521 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2522 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
2523 */
2524message NfcErrorOccurred {
2525 enum Type {
2526 UNKNOWN = 0;
2527 CMD_TIMEOUT = 1;
2528 ERROR_NOTIFICATION = 2;
2529 AID_OVERFLOW = 3;
2530 }
2531 optional Type type = 1;
2532 // If it's nci cmd timeout, log the timeout command.
2533 optional uint32 nci_cmd = 2;
2534
2535 optional uint32 error_ntf_status_code = 3;
2536}
2537
2538/**
2539 * Logs when a NFC device's state changed event
2540 * Logged from:
2541 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
2542 */
2543message NfcStateChanged {
2544 enum State {
2545 UNKNOWN = 0;
2546 OFF = 1;
2547 ON = 2;
2548 ON_LOCKED = 3; // Secure Nfc enabled.
2549 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
2550 }
2551 optional State state = 1;
2552}
2553
2554/**
2555 * Logs when a NFC Beam Transaction occurred.
2556 * Logged from:
2557 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
2558 */
2559message NfcBeamOccurred {
2560 enum Operation {
2561 UNKNOWN = 0;
2562 SEND = 1;
2563 RECEIVE = 2;
2564 }
2565 optional Operation operation = 1;
2566}
2567
2568/**
2569 * Logs when a NFC Card Emulation Transaction occurred.
2570 * Logged from:
2571 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
2572 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
2573 */
2574message NfcCardemulationOccurred {
2575 enum Category {
2576 UNKNOWN = 0;
2577 HCE_PAYMENT = 1;
2578 HCE_OTHER = 2;
2579 OFFHOST = 3;
2580 }
2581 // Transaction belongs to HCE payment or HCE other category, or offhost.
2582 optional Category category = 1;
2583 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
2584 optional string se_name = 2;
2585}
2586
2587/**
2588 * Logs when a NFC Tag event occurred.
2589 * Logged from:
2590 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
2591 */
2592message NfcTagOccurred {
2593 enum Type {
2594 UNKNOWN = 0;
2595 URL = 1;
2596 BT_PAIRING = 2;
2597 PROVISION = 3;
2598 WIFI_CONNECT = 4;
2599 APP_LAUNCH = 5;
2600 OTHERS = 6;
2601 }
2602 optional Type type = 1;
2603}
2604
2605/**
2606 * Logs when Hce transaction triggered
2607 * Logged from:
2608 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2609 */
2610message NfcHceTransactionOccurred {
2611 // The latency period(in microseconds) it took for the first HCE data
2612 // exchange.
2613 optional uint32 latency_micros = 1;
2614}
2615
2616/**
2617 * Logs when SecureElement state event changed
2618 * Logged from:
2619 * packages/apps/SecureElement/src/com/android/se/Terminal.java
2620 */
2621message SeStateChanged {
2622 enum State {
2623 UNKNOWN = 0;
2624 INITIALIZED = 1;
2625 DISCONNECTED = 2;
2626 CONNECTED = 3;
2627 HALCRASH = 4;
2628 }
2629 optional State state = 1;
2630
2631 optional string state_change_reason = 2;
2632 // SIMx or eSEx.
2633 optional string terminal = 3;
2634}
2635
2636/**
2637 * Logs when Omapi API used
2638 * Logged from:
2639 * packages/apps/SecureElement/src/com/android/se/Terminal.java
2640 */
2641message SeOmapiReported {
2642 enum Operation {
2643 UNKNOWN = 0;
2644 OPEN_CHANNEL = 1;
2645 }
2646 optional Operation operation = 1;
2647 // SIMx or eSEx.
2648 optional string terminal = 2;
2649
2650 optional string package_name = 3;
2651}