blob: 2fe6caf8844c50219e8e9a01eed546517940c3fc [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";
Jack He4d6abe62019-01-20 21:22:46 -080030import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Chiachang Wang67f24472019-01-15 15:14:00 +080031import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080032import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wang67f24472019-01-15 15:14:00 +080033import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080034import "frameworks/base/core/proto/android/server/enums.proto";
Yao Chen046b5122018-10-24 14:09:20 -070035import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080036import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080037import "frameworks/base/core/proto/android/telephony/enums.proto";
38import "frameworks/base/core/proto/android/view/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080039
Yao Chend54f9dd2017-10-17 17:37:48 +000040/**
Stefan Lafonae2df012017-11-14 09:17:21 -080041 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000042 * raw stats log events from the Android system, also known as "atoms."
43 *
44 * This field contains a single oneof with all of the available messages.
45 * The stats-log-api-gen tool runs as part of the Android build and
46 * generates the android.util.StatsLog class, which contains the constants
47 * and methods that Android uses to log.
48 *
Stefan Lafonae2df012017-11-14 09:17:21 -080049 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000050 * Instead, statsd on Android constructs these messages synthetically,
51 * in the format defined here and in stats_log.proto.
52 */
Stefan Lafonae2df012017-11-14 09:17:21 -080053message Atom {
54 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070055 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070056 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
57 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080058 // 3 is available for use
Bookatzc1a050a2017-10-10 15:49:28 -070059 BleScanResultReceived ble_scan_result_received = 4;
60 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080061 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070062 SyncStateChanged sync_state_changed = 7;
63 ScheduledJobStateChanged scheduled_job_state_changed = 8;
64 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070065 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080066 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
67 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
68 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Hyunyoung Songcc651c12018-10-17 13:35:32 -070069 // 14 - 18 are available
70 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080071 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
72 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
73 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070074 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080075 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070076 CameraStateChanged camera_state_changed = 25;
77 FlashlightStateChanged flashlight_state_changed = 26;
78 UidProcessStateChanged uid_process_state_changed = 27;
79 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
80 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070081 BatteryLevelChanged battery_level_changed = 30;
82 ChargingStateChanged charging_state_changed = 31;
83 PluggedStateChanged plugged_state_changed = 32;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080084 // 33 - 34 are available
Bookatz8c6571b2017-10-24 15:04:41 -070085 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
86 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070087 WifiLockStateChanged wifi_lock_state_changed = 37;
88 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
89 WifiScanStateChanged wifi_scan_state_changed = 39;
90 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070091 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070092 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070093 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090094 PacketWakeupOccurred packet_wakeup_occurred = 44;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080095 // 45 is available
Bookatz8fcd09a2017-12-18 13:01:10 -080096 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080097 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080098 AppStartOccurred app_start_occurred = 48;
99 AppStartCanceled app_start_canceled = 49;
100 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800101 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800102 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800103 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800104 LmkStateChanged lmk_state_changed = 54;
105 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800106 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800107 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800108 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800109 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800110 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800111 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800112 KeyguardStateChanged keyguard_state_changed = 62;
113 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
114 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800115 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800116 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800117 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
118 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Tej Singh02200f92018-04-02 19:37:59 -0700119 // 69 is blank but need not be.
Andrew Chantb56388b2018-03-22 21:07:33 -0700120 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800121 SpeakerImpedanceReported speaker_impedance_reported = 71;
122 HardwareFailed hardware_failed = 72;
123 PhysicalDropDetected physical_drop_detected = 73;
124 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800125 MobileConnectionStateChanged mobile_connection_state_changed = 75;
126 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700127 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800128 AppCrashOccurred app_crash_occurred = 78;
129 ANROccurred anr_occurred = 79;
130 WTFOccurred wtf_occurred = 80;
Yangster4ccebea2018-10-09 17:09:02 -0700131 PhoneServiceStateChanged phone_service_state_changed = 94;
132 PhoneStateChanged phone_state_changed = 95;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800133 LowMemReported low_mem_reported = 81;
Yangster-mac80c44742018-08-26 12:20:16 -0700134 ThermalThrottlingStateChanged thermal_throttling = 86;
lifr35a7cf02018-12-12 16:38:04 +0800135 NetworkDnsEventReported network_dns_event_reported = 116;
Chiachang Wang67f24472019-01-15 15:14:00 +0800136 DataStallEvent data_stall_event = 121;
Jack He52260142018-12-18 15:43:27 -0800137 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack He22e4a1d2019-01-09 01:19:13 -0800138 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
139 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Jack Yu6d421bc2019-01-23 17:42:54 +0800140 NfcErrorOccurred nfc_error_occurred = 134;
141 NfcStateChanged nfc_state_changed = 135;
142 NfcBeamOccurred nfc_beam_occurred = 136;
143 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
144 NfcTagOccurred nfc_tag_occurred = 138;
145 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
146 SeStateChanged se_state_changed = 140;
147 SeOmapiReported se_omapi_reported = 141;
Jack He924f3462019-01-09 20:54:41 -0800148 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
149 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
150 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
151 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
152 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
153 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
154 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
155 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
156 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He4d6abe62019-01-20 21:22:46 -0800157 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
158 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
159 BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162;
160 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
161 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
162 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
163 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
164 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Hui Yuf57e4012019-02-13 12:29:38 -0800165 ProcessStartTime process_start_time = 169;
Jack He9c30c7c6b2019-01-30 17:24:55 -0800166 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Yao Chend54f9dd2017-10-17 17:37:48 +0000167 }
David Chenc8a43242017-10-17 16:23:28 -0700168
David Chen6e3e6cb2018-01-03 16:14:06 -0800169 // Pulled events will start at field 10000.
Tej Singh40298312018-02-16 00:15:09 -0800170 // Next: 10022
David Chenc8a43242017-10-17 16:23:28 -0700171 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800172 WifiBytesTransfer wifi_bytes_transfer = 10000;
173 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
174 MobileBytesTransfer mobile_bytes_transfer = 10002;
175 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800176 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800177 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800178 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800179 CpuTimePerFreq cpu_time_per_freq = 10008;
180 CpuTimePerUid cpu_time_per_uid = 10009;
181 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800182 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800183 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800184 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800185 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800186 SystemElapsedRealtime system_elapsed_realtime = 10014;
187 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800188 CpuActiveTime cpu_active_time = 10016;
189 CpuClusterTime cpu_cluster_time = 10017;
Chenjie Yu937d7422018-01-10 16:37:53 -0800190 DiskSpace disk_space = 10018;
Tej Singhbf972d92018-01-10 20:51:13 -0800191 RemainingBatteryCapacity remaining_battery_capacity = 10019;
192 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800193 Temperature temperature = 10021;
David Chenc8a43242017-10-17 16:23:28 -0700194 }
yroa1fe77c2018-02-26 14:22:54 -0800195
Bookatz76aafcf2018-09-17 16:17:10 -0700196 // DO NOT USE field numbers above 100,000 in AOSP.
197 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
198 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700199}
200
Yao Chend54f9dd2017-10-17 17:37:48 +0000201/**
Yangster-mac20877162017-12-22 17:19:39 -0800202 * This proto represents a node of an attribution chain.
203 * Note: All attribution chains are represented as a repeated field of type
204 * AttributionNode. It is understood that in such arrays, the order is that
205 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000206 */
Yangster-mac20877162017-12-22 17:19:39 -0800207message AttributionNode {
208 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800209 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800210
Yangster-mac20877162017-12-22 17:19:39 -0800211 // The (optional) string tag for an element in the attribution chain. If the
212 // element has no tag, it is encoded as an empty string.
213 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700214}
215
Yao Chend54f9dd2017-10-17 17:37:48 +0000216/*
217 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800218 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000219 *
220 * RULES:
221 * - The field ids for each atom must start at 1, and count upwards by 1.
222 * Skipping field ids is not allowed.
223 * - These form an API, so renaming, renumbering or removing fields is
224 * not allowed between android releases. (This is not currently enforced,
225 * but there will be a tool to enforce this restriction).
226 * - The types must be built-in protocol buffer types, namely, no sub-messages
227 * are allowed (yet). The bytes type is also not allowed.
228 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800229 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000230 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800231 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000232 * - A field that is a uid should be a string field, tagged with the [xxx]
233 * annotation. The generated code on android will be represented by UIDs,
234 * and those UIDs will be translated in xxx to those strings.
235 *
236 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700237 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000238 * - If there is a UID, it goes first. Think in an object-oriented fashion.
239 * *****************************************************************************
240 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700241
Yao Chend54f9dd2017-10-17 17:37:48 +0000242/**
Yangster-mac80c44742018-08-26 12:20:16 -0700243 * Logs when the Thermal service HAL notifies the throttling start/stop events.
244 *
245 * Logged from:
246 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
247 */
248message ThermalThrottlingStateChanged {
249 optional android.os.TemperatureTypeEnum sensor_type = 1;
250
251 enum State {
252 UNKNOWN = 0;
253 START = 1;
254 STOP = 2;
255 }
256
257 optional State state = 2;
258
259 optional float temperature = 3;
260}
261
262/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000263 * Logs when the screen state changes.
264 *
265 * Logged from:
266 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
267 */
268message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800269 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800270 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700271}
Yao Chend54f9dd2017-10-17 17:37:48 +0000272
273/**
Bookatzc1a050a2017-10-10 15:49:28 -0700274 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000275 *
276 * Logged from:
277 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
278 */
Bookatzc1a050a2017-10-10 15:49:28 -0700279message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700280 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000281
Bookatzdb026a22018-01-10 19:01:56 -0800282 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800283 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000284}
285
286/**
Bookatzc1a050a2017-10-10 15:49:28 -0700287 * Logs that a process started, finished, crashed, or ANRed.
288 *
289 * Logged from:
290 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
291 */
292message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700293 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700294
David Chen0b5c90c2018-01-25 16:51:49 -0800295 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800296 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700297
Bookatzddccf0a2017-11-28 16:48:14 -0800298 // What lifecycle state the process changed to.
299 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800300 enum State {
301 FINISHED = 0;
302 STARTED = 1;
303 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800304 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800305 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700306}
307
Bookatzc1a050a2017-10-10 15:49:28 -0700308/**
309 * Logs when the ble scan state changes.
310 *
311 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700312 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700313 */
314message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800315 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700316
317 enum State {
318 OFF = 0;
319 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700320 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
321 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700322 }
323 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700324
Bookatze5ec0b42018-03-26 13:34:56 -0700325 // Does the scan have a filter.
326 optional bool is_filtered = 3;
327 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
328 optional bool is_first_match = 4;
329 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
330 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700331}
332
333/**
334 * Logs reporting of a ble scan finding results.
335 *
336 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700337 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700338 */
Bookatzae6738e2018-09-13 11:38:56 -0700339// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700340message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800341 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700342
343 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800344 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700345}
346
347/**
348 * Logs when a sensor state changes.
349 *
350 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700351 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700352 */
353message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800354 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700355
Bookatzc1a050a2017-10-10 15:49:28 -0700356 // The id (int) of the sensor.
357 optional int32 sensor_id = 2;
358
359 enum State {
360 OFF = 0;
361 ON = 1;
362 }
363 optional State state = 3;
364}
365
366
367/**
368 * Logs when GPS state changes.
369 *
370 * Logged from:
371 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
372 */
373message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800374 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700375
376 enum State {
377 OFF = 0;
378 ON = 1;
379 }
380 optional State state = 2;
381}
382
383
384/**
385 * Logs when a sync manager sync state changes.
386 *
387 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700388 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700389 */
390message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800391 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700392
David Chen0b5c90c2018-01-25 16:51:49 -0800393 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800394 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700395
396 enum State {
397 OFF = 0;
398 ON = 1;
399 }
400 optional State state = 3;
401}
402
403/**
404 * Logs when a job scheduler job state changes.
405 *
406 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700407 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700408 */
409message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800410 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700411
412 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800413 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700414
415 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800416 FINISHED = 0;
417 STARTED = 1;
418 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700419 }
420 optional State state = 3;
421
Tej Singh33a412b2018-03-16 18:43:59 -0700422 // The reason a job has stopped.
423 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700424 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700425 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700426}
427
428/**
429 * Logs when the audio state changes.
430 *
431 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700432 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700433 */
434message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800435 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700436
437 enum State {
438 OFF = 0;
439 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700440 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
441 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700442 }
443 optional State state = 2;
444}
445
446/**
447 * Logs when the video codec state changes.
448 *
449 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700450 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700451 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800452message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800453 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700454
455 enum State {
456 OFF = 0;
457 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700458 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
459 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700460 }
461 optional State state = 2;
462}
463
464/**
465 * Logs when the flashlight state changes.
466 *
467 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700468 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700469 */
470message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800471 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700472
473 enum State {
474 OFF = 0;
475 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700476 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
477 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700478 }
479 optional State state = 2;
480}
481
482/**
483 * Logs when the camera state changes.
484 *
485 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700486 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700487 */
488message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800489 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700490
491 enum State {
492 OFF = 0;
493 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700494 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
495 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700496 }
497 optional State state = 2;
498}
499
500/**
501 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000502 *
503 * Logged from:
504 * TODO
505 */
Bookatzd6746242017-10-24 18:39:35 -0700506message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800507 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000508
Bookatz1a1b0462018-01-12 11:47:03 -0800509 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
510 // From frameworks/base/core/proto/android/os/enums.proto.
511 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700512
513 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
514 optional string tag = 3;
515
516 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800517 RELEASE = 0;
518 ACQUIRE = 1;
519 CHANGE_RELEASE = 2;
520 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700521 }
522 optional State state = 4;
523}
524
525/**
Bookatzc1a050a2017-10-10 15:49:28 -0700526 * Logs when a partial wakelock is considered 'long' (over 1 min).
527 *
528 * Logged from:
529 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
530 */
531message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800532 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700533
Yao Chend54f9dd2017-10-17 17:37:48 +0000534 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
535 optional string tag = 2;
536
Bookatzc1a050a2017-10-10 15:49:28 -0700537 // TODO: I have no idea what this is.
538 optional string history_tag = 3;
539
540 enum State {
541 OFF = 0;
542 ON = 1;
543 }
544 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000545}
546
Bookatzc1a050a2017-10-10 15:49:28 -0700547/**
548 * Logs Battery Saver state change.
549 *
550 * Logged from:
551 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
552 */
553message BatterySaverModeStateChanged {
554 enum State {
555 OFF = 0;
556 ON = 1;
557 }
558 optional State state = 1;
559}
560
561/**
562 * Logs Doze mode state change.
563 *
564 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800565 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700566 */
567message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800568 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800569}
570
571
572/**
573 * Logs state change of Doze mode including maintenance windows.
574 *
575 * Logged from:
576 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
577 */
578message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800579 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700580}
581
582/**
583 * Logs screen brightness level.
584 *
585 * Logged from:
586 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
587 */
588message ScreenBrightnessChanged {
589 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
590 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700591}
592
593/**
594 * Logs battery level (percent full, from 0 to 100).
595 *
596 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700597 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700598 */
599message BatteryLevelChanged {
600 // Battery level. Should be in [0, 100].
601 optional int32 battery_level = 1;
602}
603
604/**
605 * Logs change in charging status of the device.
606 *
607 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700608 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700609 */
610message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800611 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
612 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700613}
614
615/**
616 * Logs whether the device is plugged in, and what power source it is using.
617 *
618 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700619 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700620 */
621message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800622 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
623 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700624}
625
Bookatz8c6571b2017-10-24 15:04:41 -0700626/**
627 * Logs when an app's wakeup alarm fires.
628 *
629 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700630 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700631 */
632message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800633 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800634
635 // Name of the wakeup alarm.
636 optional string tag = 2;
637}
638
639/**
640 * Logs when an an app causes the mobile radio to change state.
641 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
642 *
643 * Logged from:
644 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
645 */
646message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800647 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800648
Bookatz1a1b0462018-01-12 11:47:03 -0800649 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
650 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800651}
652
653/**
654 * Logs when an an app causes the wifi radio to change state.
655 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
656 *
657 * Logged from:
658 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
659 */
660message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800661 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800662
Bookatz1a1b0462018-01-12 11:47:03 -0800663 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
664 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700665}
666
667/**
668 * Logs kernel wakeup reasons and aborts.
669 *
670 * Logged from:
671 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
672 */
673message KernelWakeupReported {
674 // Name of the kernel wakeup reason (or abort).
675 optional string wakeup_reason_name = 1;
676
677 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800678 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700679}
680
681/**
682 * Logs wifi locks held by an app.
683 *
684 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700685 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700686 */
687message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800688 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700689
690 enum State {
691 OFF = 0;
692 ON = 1;
693 }
694 optional State state = 2;
695}
696
697/**
698 * Logs wifi signal strength changes.
699 *
700 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700701 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700702 */
703message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800704 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
705 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700706}
707
708/**
709 * Logs wifi scans performed by an app.
710 *
711 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700712 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700713 */
714message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800715 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700716
717 enum State {
718 OFF = 0;
719 ON = 1;
720 }
721 optional State state = 2;
722}
723
724/**
Tej Singh4503e102018-01-04 14:35:01 -0800725 * Logs wifi multicast locks held by an app
726 *
727 * Logged from:
728 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
729 */
730message WifiMulticastLockStateChanged {
731 repeated AttributionNode attribution_node = 1;
732
733 enum State {
734 OFF = 0;
735 ON = 1;
736 }
737 optional State state = 2;
738}
739
740/**
Tej Singh1ea42892018-01-19 09:27:00 -0800741 * Logs shutdown reason and duration on next boot.
742 *
743 * Logged from:
744 * frameworks/base/core/java/com/android/server/BootReceiver.java
745 */
746message ShutdownSequenceReported {
747 // True if shutdown is for a reboot. Default: false if we do not know.
748 optional bool reboot = 1;
749
750 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
751 optional string reason = 2;
752
753 // Beginning of shutdown time in ms using wall clock time since unix epoch.
754 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800755 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800756
757 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800758 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800759}
760
Tej Singh6483ea42018-01-25 17:45:49 -0800761
762/**
763 * Logs boot reason and duration.
764 *
765 * Logged from:
766 * system/core/bootstat/bootstat.cpp
767 */
768message BootSequenceReported {
769 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
770 // Default: "<EMPTY>" if not available.
771 optional string bootloader_reason = 1;
772
773 // Reason for system boot. Eg. bootloader, reboot,userrequested
774 // Default: "<EMPTY>" if not available.
775 optional string system_reason = 2;
776
777 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800778 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800779
780 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800781 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800782
783 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800784 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800785
786 // Time since last boot in ms. Default: 0 if not available.
787 optional int64 time_since_last_boot = 6;
788}
789
Tej Singhc477d9c2018-02-05 18:31:39 -0800790
791/**
792 * Logs call state and disconnect cause (if applicable).
793 *
794 * Logged from:
795 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
796 */
797message CallStateChanged {
798 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
799 // From frameworks/base/core/proto/android/telecomm/enums.proto.
800 optional android.telecom.CallStateEnum call_state = 1;
801
802 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
803 // This value is only applicable when the call_state is DISCONNECTED, and
804 // should always be UNKNOWN if the call_state is not DISCONNECTED.
805 // From frameworks/base/core/proto/android/telecomm/enums.proto.
806 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
807
808 // True if the call is self-managed, which are apps that use the
809 // telecom infrastructure to make their own calls.
810 optional bool self_managed = 3;
811
812 // True if call is external. External calls are calls on connected Wear
813 // devices but show up in Telecom so the user can pull them onto the device.
814 optional bool external_call = 4;
815}
816
Tej Singh1ea42892018-01-19 09:27:00 -0800817/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800818 * Logs keyguard state. The keyguard is the lock screen.
819 *
820 * Logged from:
821 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
822 */
823message KeyguardStateChanged {
824 enum State {
825 UNKNOWN = 0;
826 // The keyguard is hidden when the phone is unlocked.
827 HIDDEN = 1;
828 // The keyguard is shown when the phone is locked (screen turns off).
829 SHOWN= 2;
830 // The keyguard is occluded when something is overlaying the keyguard.
831 // Eg. Opening the camera while on the lock screen.
832 OCCLUDED = 3;
833 }
834 optional State state = 1;
835}
836
837/**
838 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
839 * prompts the user to enter a password (pattern, pin, etc).
840 *
841 * Logged from:
842 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
843 */
844
845message KeyguardBouncerStateChanged {
846 enum State {
847 UNKNOWN = 0;
848 // Bouncer is hidden, either as a result of successfully entering the
849 // password, screen timing out, or user going back to lock screen.
850 HIDDEN = 1;
851 // This is when the user is being prompted to enter the password.
852 SHOWN = 2;
853 }
854 optional State state = 1;
855}
856
857/**
858 * Logs the result of entering a password into the keyguard bouncer.
859 *
860 * Logged from:
861 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
862 */
863message KeyguardBouncerPasswordEntered {
864 enum BouncerResult {
865 UNKNOWN = 0;
866 // The password entered was incorrect.
867 FAILURE = 1;
868 // The password entered was correct.
869 SUCCESS = 2;
870 }
871 optional BouncerResult result = 1;
872}
873
Tej Singha883b372018-02-15 11:30:01 -0800874/*
875 * Logs changes to the configuration of the device. The configuration is defined
876 * in frameworks/base/core/java/android/content/res/Configuration.java
877 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
878 * Please go there to interpret the possible values each field can be.
879 *
880 * Logged from:
881 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
882 */
883message ResourceConfigurationChanged {
884 // Bit mask of color capabilities of the screen.
885 // Contains information about the color gamut and hdr mode of the screen.
886 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
887 optional int32 colorMode = 1;
888
889 // The target screen density being rendered to.
890 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
891 optional int32 densityDpi = 2;
892
893 // Current user preference for the scaling factor for fonts,
894 // relative to the base density scaling.
895 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
896 optional float fontScale = 3;
897
898 // Flag indicating whether the hard keyboard is hidden.
899 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
900 optional int32 hardKeyboardHidden = 4;
901
902 // The type of keyboard attached to the device.
903 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
904 optional int32 keyboard = 5;
905
906 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
907 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
908 optional int32 keyboardHideen = 6;
909
910 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
911 // 0 if undefined.
912 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
913 optional int32 mcc = 7;
914
915 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
916 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
917 // MNC_ZERO symbol defined in Configuration.java.
918 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
919 optional int32 mnc = 8;
920
921 // The kind of navigation available on the device.
922 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
923 optional int32 navigation = 9;
924
925 // Flag indicating whether the navigation is available.
926 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
927 optional int32 navigationHidden = 10;
928
929 // Overall orientation of the screen.
930 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
931 optional int32 orientation = 11;
932
933 // The current height of the available screen space, in dp units.
934 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
935 optional int32 screenHeightDp = 12;
936
937 // Bit mask of overall layout of the screen.
938 // Contains information about screen size, whether the screen is wider/taller
939 // than normal, whether the screen layout is right-tl-left or left-to-right,
940 // and whether the screen has a rounded shape.
941 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
942 optional int32 screenLayout = 13;
943
944 // Current width of the available screen space, in dp units.
945 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
946 optional int32 screenWidthDp = 14;
947
948 // The smallest screen size an application will see in normal operation.
949 // This is the smallest value of both screenWidthDp and screenHeightDp
950 // in portrait and landscape.
951 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
952 optional int32 smallestScreenWidthDp = 15;
953
954 // The type of touch screen attached to the device.
955 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
956 optional int32 touchscreen = 16;
957
958 // Bit mask of the ui mode.
959 // Contains information about the overall ui mode of the device.
960 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
961 // Also contains information about whether the device is in night mode.
962 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
963 optional int32 uiMode = 17;
964}
965
Tej Singheee317b2018-03-07 19:28:05 -0800966
967/**
968 * Logs changes in the connection state of the mobile radio.
969 *
970 * Logged from:
971 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
972 */
973message MobileConnectionStateChanged {
974 // States are from the state machine DataConnection.java.
975 enum State {
976 UNKNOWN = 0;
977 // The connection is inactive, or disconnected.
978 INACTIVE = 1;
979 // The connection is being activated, or connecting.
980 ACTIVATING = 2;
981 // The connection is active, or connected.
982 ACTIVE = 3;
983 // The connection is disconnecting.
984 DISCONNECTING = 4;
985 // The connection is disconnecting after creating a connection.
986 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
987 }
988 optional State state = 1;
989 // For multi-sim phones, this distinguishes between the sim cards.
990 optional int32 sim_slot_index = 2;
991 // Used to identify the connection. Starts at 0 and increments by 1 for
992 // every new network created. Resets whenever the device reboots.
993 optional int32 data_connection_id = 3;
994 // A bitmask for the capabilities of this connection.
995 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
996 // Default value (if we have no information): 0
997 optional int64 capabilities = 4;
998 // If this connection has internet.
999 // This just checks if the DEFAULT bit of capabilities is set.
1000 optional bool has_internet = 5;
1001}
1002
1003/**
1004 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1005 *
1006 * Logged from:
1007 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1008 */
1009message MobileRadioTechnologyChanged {
1010 optional android.telephony.NetworkTypeEnum state = 1;
1011 // For multi-sim phones, this distinguishes between the sim cards.
1012 optional int32 sim_slot_index = 2;
1013}
1014
Andrew Chantb56388b2018-03-22 21:07:33 -07001015/**
1016 * Logs the VID and PID of any connected USB devices.
1017 *
1018 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1019 *
1020 * Logged by Vendor.
1021 */
1022message UsbDeviceAttached {
1023 optional int32 vid = 1;
1024 optional int32 pid = 2;
1025 optional bool has_audio = 3;
1026 optional bool has_hid = 4;
1027 optional bool has_storage = 5;
1028}
1029
Tej Singheee317b2018-03-07 19:28:05 -08001030
Tej Singhdd7bd352018-02-09 19:33:15 -08001031/**
Tej Singh5d991e12018-03-09 19:48:11 -08001032 * Logs when Bluetooth is enabled and disabled.
1033 *
1034 * Logged from:
1035 * services/core/java/com/android/server/BluetoothManagerService.java
1036 */
1037message BluetoothEnabledStateChanged {
1038 repeated AttributionNode attribution_node = 1;
1039 // Whether or not bluetooth is enabled on the device.
1040 enum State {
1041 UNKNOWN = 0;
1042 ENABLED = 1;
1043 DISABLED = 2;
1044 }
1045 optional State state = 2;
1046 // The reason for being enabled/disabled.
1047 // Eg. Airplane mode, crash, application request.
1048 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1049 // If the reason is an application request, this will be the package name.
1050 optional string pkgName = 4;
1051}
1052
1053/**
Jack He22e4a1d2019-01-09 01:19:13 -08001054 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001055 *
1056 * Logged from:
Jack He22e4a1d2019-01-09 01:19:13 -08001057 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1058 *
1059 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001060 */
1061message BluetoothConnectionStateChanged {
1062 // The state of the connection.
1063 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1064 optional android.bluetooth.ConnectionStateEnum state = 1;
1065 // An identifier that can be used to match connect and disconnect events.
1066 // Currently is last two bytes of a hash of a device level ID and
1067 // the mac address of the bluetooth device that is connected.
Jack He22e4a1d2019-01-09 01:19:13 -08001068 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1069 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001070 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1071 // From android.bluetooth.BluetoothAdapter.java
Jack He22e4a1d2019-01-09 01:19:13 -08001072 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001073 optional int32 bt_profile = 3;
Jack He22e4a1d2019-01-09 01:19:13 -08001074 // An identifier that can be used to match events for this device.
1075 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1076 // Salt: Randomly generated 256 bit value
1077 // Hash algorithm: HMAC-SHA256
1078 // Size: 32 byte
1079 // Default: null or empty if the device identifier is not known
1080 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1081}
1082
1083/**
1084 * Logs when a Bluetooth device connects and disconnects over ACL
1085 *
1086 * Logged from:
1087 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1088 *
1089 * Next Tag: 3
1090 */
1091message BluetoothAclConnectionStateChanged {
1092 // An identifier that can be used to match events for this device.
1093 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1094 // Salt: Randomly generated 256 bit value
1095 // Hash algorithm: HMAC-SHA256
1096 // Size: 32 byte
1097 // Default: null or empty if the device identifier is not known
1098 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1099 // The state of the connection.
1100 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1101 optional android.bluetooth.ConnectionStateEnum state = 2;
1102}
1103
1104/**
1105 * Logs when a Bluetooth device connects and disconnects over SCO
1106 *
1107 * Logged from:
1108 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1109 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1110 *
1111 * Next Tag: 4
1112 */
1113message BluetoothScoConnectionStateChanged {
1114 // An identifier that can be used to match events for this device.
1115 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1116 // Salt: Randomly generated 256 bit value
1117 // Hash algorithm: HMAC-SHA256
1118 // Size: 32 byte
1119 // Default: null or empty if the device identifier is not known
1120 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1121 // The state of the connection.
1122 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1123 optional android.bluetooth.ConnectionStateEnum state = 2;
1124 // Codec used for this SCO connection
1125 // Default: UNKNOWN
1126 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001127}
1128
Jack He924f3462019-01-09 20:54:41 -08001129/**
1130 * Logged when active device of a profile changes
1131 *
1132 * Logged from:
1133 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1134 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1135 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1136 */
1137message BluetoothActiveDeviceChanged {
1138 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1139 // From android.bluetooth.BluetoothProfile
1140 optional int32 bt_profile = 1;
1141 // An identifier that can be used to match events for this new active device.
1142 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1143 // Salt: Randomly generated 256 bit value
1144 // Hash algorithm: HMAC-SHA256
1145 // Size: 32 byte
1146 // Default: null or empty if there is no active device for this profile
1147 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1148}
1149
Jack He52260142018-12-18 15:43:27 -08001150// Logs when there is an event affecting Bluetooth device's link layer connection.
1151// - This event is triggered when there is a related HCI command or event
1152// - Users of this metrics can deduce Bluetooth device's connection state from these events
1153// - HCI commands are logged before the command is sent, after receiving command status, and after
1154// receiving command complete
1155// - HCI events are logged when they arrive
1156//
1157// Low level log from system/bt
1158//
1159// Bluetooth classic commands:
1160// - CMD_CREATE_CONNECTION
1161// - CMD_DISCONNECT
1162// - CMD_CREATE_CONNECTION_CANCEL
1163// - CMD_ACCEPT_CONNECTION_REQUEST
1164// - CMD_REJECT_CONNECTION_REQUEST
1165// - CMD_SETUP_ESCO_CONNECTION
1166// - CMD_ACCEPT_ESCO_CONNECTION
1167// - CMD_REJECT_ESCO_CONNECTION
1168// - CMD_ENH_SETUP_ESCO_CONNECTION
1169// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1170//
1171// Bluetooth low energy commands:
1172// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1173// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1174// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1175// - CMD_BLE_CLEAR_WHITE_LIST
1176// - CMD_BLE_ADD_WHITE_LIST
1177// - CMD_BLE_REMOVE_WHITE_LIST
1178//
1179// Bluetooth classic events:
1180// - EVT_CONNECTION_COMP
1181// - EVT_CONNECTION_REQUEST
1182// - EVT_DISCONNECTION_COMP
1183// - EVT_ESCO_CONNECTION_COMP
1184// - EVT_ESCO_CONNECTION_CHANGED
1185//
1186// Bluetooth low energy meta events:
1187// - BLE_EVT_CONN_COMPLETE_EVT
1188// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1189//
1190// Next tag: 10
1191message BluetoothLinkLayerConnectionEvent {
1192 // An identifier that can be used to match events for this device.
1193 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1194 // Salt: Randomly generated 256 bit value
1195 // Hash algorithm: HMAC-SHA256
1196 // Size: 32 byte
1197 // Default: null or empty if the device identifier is not known
1198 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1199 // Connection handle of this connection if available
1200 // Range: 0x0000 - 0x0EFF (12 bits)
1201 // Default: 0xFFFF if the handle is unknown
1202 optional int32 connection_handle = 2;
1203 // Direction of the link
1204 // Default: DIRECTION_UNKNOWN
1205 optional android.bluetooth.DirectionEnum direction = 3;
1206 // Type of this link
1207 // Default: LINK_TYPE_UNKNOWN
1208 optional android.bluetooth.LinkTypeEnum type = 4;
1209
1210 // Reason metadata for this link layer connection event, rules for interpretation:
1211 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1212 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1213 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1214 // set and valid, ignore hci_ble_event
1215
1216 // HCI command associated with this event
1217 // Default: CMD_UNKNOWN
1218 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1219 // HCI event associated with this event
1220 // Default: EVT_UNKNOWN
1221 optional android.bluetooth.hci.EventEnum hci_event = 6;
1222 // HCI BLE meta event associated with this event
1223 // Default: BLE_EVT_UNKNOWN
1224 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1225 // HCI command status code if this is triggerred by hci_cmd
1226 // Default: STATUS_UNKNOWN
1227 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1228 // HCI reason code associated with this event
1229 // Default: STATUS_UNKNOWN
1230 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1231}
1232
Jack He924f3462019-01-09 20:54:41 -08001233/**
1234 * Logs when there is a change in Bluetooth A2DP playback state
1235 *
1236 * Logged from:
1237 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1238 */
1239message BluetoothA2dpPlaybackStateChanged {
1240 // An identifier that can be used to match events for this device.
1241 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1242 // Salt: Randomly generated 256 bit value
1243 // Hash algorithm: HMAC-SHA256
1244 // Size: 32 byte
1245 // Default: null or empty if the device identifier is not known
1246 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1247 // Current playback state
1248 // Default: PLAYBACK_STATE_UNKNOWN
1249 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1250 // Current audio coding mode
1251 // Default: AUDIO_CODING_MODE_UNKNOWN
1252 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1253}
1254
1255/**
1256 * Logs when there is a change in A2DP codec config for a particular remote device
1257 *
1258 * Logged from:
1259 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1260 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1261 */
1262message BluetoothA2dpCodecConfigChanged {
1263 // An identifier that can be used to match events for this device.
1264 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1265 // Salt: Randomly generated 256 bit value
1266 // Hash algorithm: HMAC-SHA256
1267 // Size: 32 byte
1268 // Default: null or empty if the device identifier is not known
1269 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1270 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1271 // Default SOURCE_CODEC_TYPE_INVALID
1272 optional int32 codec_type = 2;
1273 // Codec priroity, the higher the more preferred, -1 for disabled
1274 // Default: CODEC_PRIORITY_DEFAULT
1275 optional int32 codec_priority = 3;
1276 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1277 // Default: SAMPLE_RATE_NONE
1278 optional int32 sample_rate = 4;
1279 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1280 // Default: BITS_PER_SAMPLE_NONE
1281 optional int32 bits_per_sample = 5;
1282 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1283 // Default: CHANNEL_MODE_NONE
1284 optional int32 channel_mode = 6;
1285 // Codec specific values
1286 // Default 0
1287 optional int64 codec_specific_1 = 7;
1288 optional int64 codec_specific_2 = 8;
1289 optional int64 codec_specific_3 = 9;
1290 optional int64 codec_specific_4 = 10;
1291}
1292
1293/**
1294 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1295 * Each codec's capability is logged separately due to statsd restriction
1296 *
1297 * Logged from:
1298 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1299 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1300 */
1301message BluetoothA2dpCodecCapabilityChanged {
1302 // An identifier that can be used to match events for this device.
1303 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1304 // Salt: Randomly generated 256 bit value
1305 // Hash algorithm: HMAC-SHA256
1306 // Size: 32 byte
1307 // Default: null or empty if the device identifier is not known
1308 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1309 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1310 // Default SOURCE_CODEC_TYPE_INVALID
1311 optional int32 codec_type = 2;
1312 // Codec priroity, the higher the more preferred, -1 for disabled
1313 // Default: CODEC_PRIORITY_DEFAULT
1314 optional int32 codec_priority = 3;
1315 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1316 // in BluetoothCodecConfig
1317 // Default: empty and SAMPLE_RATE_NONE for individual item
1318 optional int32 sample_rate = 4;
1319 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1320 // in BluetoothCodecConfig
1321 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1322 optional int32 bits_per_sample = 5;
1323 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1324 // BluetoothCodecConfig
1325 // Default: empty and CHANNEL_MODE_NONE for individual item
1326 optional int32 channel_mode = 6;
1327 // Codec specific values
1328 // Default 0
1329 optional int64 codec_specific_1 = 7;
1330 optional int64 codec_specific_2 = 8;
1331 optional int64 codec_specific_3 = 9;
1332 optional int64 codec_specific_4 = 10;
1333}
1334
1335/**
1336 * Logs when A2DP failed to read from PCM source.
1337 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1338 *
1339 * Logged from:
1340 * system/bt
1341 */
1342message BluetoothA2dpAudioUnderrunReported {
1343 // An identifier that can be used to match events for this device.
1344 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1345 // Salt: Randomly generated 256 bit value
1346 // Hash algorithm: HMAC-SHA256
1347 // Size: 32 byte
1348 // Default: null or empty if the device identifier is not known
1349 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1350 // Encoding interval in nanoseconds
1351 // Default: 0
1352 optional int64 encoding_interval_nanos = 2;
1353 // Number of bytes of PCM data that could not be read from the source
1354 // Default: 0
1355 optional int32 num_missing_pcm_bytes = 3;
1356}
1357
1358/**
1359 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1360 * buffer queue is full and we have to drop data
1361 *
1362 * Logged from:
1363 * system/bt
1364 */
1365message BluetoothA2dpAudioOverrunReported {
1366 // An identifier that can be used to match events for this device.
1367 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1368 // Salt: Randomly generated 256 bit value
1369 // Hash algorithm: HMAC-SHA256
1370 // Size: 32 byte
1371 // Default: null or empty if the device identifier is not known
1372 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1373 // Encoding interval in nanoseconds
1374 // Default: 0
1375 optional int64 encoding_interval_nanos = 2;
1376 // Number of buffers dropped in this event
1377 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1378 // Default: 0
1379 optional int32 num_dropped_buffers = 3;
1380 // Number of encoded buffers dropped in this event
1381 // Default 0
1382 optional int32 num_dropped_encoded_frames = 4;
1383 // Number of encoded bytes dropped in this event
1384 // Default: 0
1385 optional int32 num_dropped_encoded_bytes = 5;
1386}
1387
1388/**
1389 * Logs when we receive reports regarding a device's RSSI value
1390 *
1391 * Logged from:
1392 * system/bt
1393 */
1394message BluetoothDeviceRssiReported {
1395 // An identifier that can be used to match events for this device.
1396 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1397 // Salt: Randomly generated 256 bit value
1398 // Hash algorithm: HMAC-SHA256
1399 // Size: 32 byte
1400 // Default: null or empty if the device identifier is not known
1401 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1402 // Connection handle of this connection if available
1403 // Range: 0x0000 - 0x0EFF (12 bits)
1404 // Default: 0xFFFF if the handle is unknown
1405 optional int32 connection_handle = 2;
1406 // HCI command status code if this is triggerred by hci_cmd
1407 // Default: STATUS_UNKNOWN
1408 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1409 // BR/EDR
1410 // Range: -128 ≤ N ≤ 127 (signed integer)
1411 // Units: dB
1412 // LE:
1413 // Range: -127 to 20, 127 (signed integer)
1414 // Units: dBm
1415 // Invalid when an out of range value is reported
1416 optional int32 rssi = 4;
1417}
1418
1419/**
1420 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1421 *
1422 * Logged from:
1423 * system/bt
1424 */
1425message BluetoothDeviceFailedContactCounterReported {
1426 // An identifier that can be used to match events for this device.
1427 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1428 // Salt: Randomly generated 256 bit value
1429 // Hash algorithm: HMAC-SHA256
1430 // Size: 32 byte
1431 // Default: null or empty if the device identifier is not known
1432 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1433 // Connection handle of this connection if available
1434 // Range: 0x0000 - 0x0EFF (12 bits)
1435 // Default: 0xFFFF if the handle is unknown
1436 optional int32 connection_handle = 2;
1437 // HCI command status code if this is triggerred by hci_cmd
1438 // Default: STATUS_UNKNOWN
1439 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1440 // Number of consecutive failed contacts for a connection corresponding to the Handle
1441 // Range: uint16_t, 0-0xFFFF
1442 // Default: 0xFFFFF
1443 optional int32 failed_contact_counter = 4;
1444}
1445
1446/**
1447 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1448 *
1449 * Logged from:
1450 * system/bt
1451 */
1452message BluetoothDeviceTxPowerLevelReported {
1453 // An identifier that can be used to match events for this device.
1454 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1455 // Salt: Randomly generated 256 bit value
1456 // Hash algorithm: HMAC-SHA256
1457 // Size: 32 byte
1458 // Default: null or empty if the device identifier is not known
1459 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1460 // Connection handle of this connection if available
1461 // Range: 0x0000 - 0x0EFF (12 bits)
1462 // Default: 0xFFFF if the handle is unknown
1463 optional int32 connection_handle = 2;
Jack He4d6abe62019-01-20 21:22:46 -08001464 // HCI command status code if this is triggered by hci_cmd
Jack He924f3462019-01-09 20:54:41 -08001465 // Default: STATUS_UNKNOWN
1466 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1467 // Range: -30 ≤ N ≤ 20
1468 // Units: dBm
1469 // Invalid when an out of range value is reported
1470 optional int32 transmit_power_level = 4;
1471}
Jack He52260142018-12-18 15:43:27 -08001472
Tej Singh5d991e12018-03-09 19:48:11 -08001473/**
Jack He4d6abe62019-01-20 21:22:46 -08001474 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1475 * receiving an HCI command from the host
1476 *
1477 * Logged from: system/bt
1478 */
1479message BluetoothHciTimeoutReported {
1480 // HCI command associated with this event
1481 // Default: CMD_UNKNOWN
1482 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1483}
1484
1485/**
1486 * Logs when we receive Bluetooth Link Quality Report event from the controller
1487 * See Android Bluetooth HCI specification for more details
1488 *
1489 * Note: all count and bytes field are counted since last event
1490 *
1491 * Logged from: system/bt
1492 */
1493message BluetoothQualityReportReported {
1494 // Quality report ID
1495 // Original type: uint8_t
1496 // Default: BQR_ID_UNKNOWN
1497 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1498 // Packet type of the connection
1499 // Original type: uint8_t
1500 // Default: BQR_PACKET_TYPE_UNKNOWN
1501 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1502 // Connection handle of the connection
1503 // Original type: uint16_t
1504 optional int32 connection_handle = 3;
1505 // Performing Role for the connection
1506 // Original type: uint8_t
1507 optional int32 connection_role = 4;
1508 // Current Transmit Power Level for the connection. This value is the same as the controller's
1509 // response to the HCI_Read_Transmit_Power_Level HCI command
1510 // Original type: uint8_t
1511 optional int32 tx_power_level = 5;
1512 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1513 // absolute receiver signal strength value
1514 // Original type: int8_t
1515 optional int32 rssi = 6;
1516 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1517 // channels used by the link currently
1518 // Original type: uint8_t
1519 optional int32 snr = 7;
1520 // Indicates the number of unused channels in AFH_channel_map
1521 // Original type: uint8_t
1522 optional int32 unused_afh_channel_count = 8;
1523 // Indicates the number of the channels which are interfered and quality is bad but are still
1524 // selected for AFH
1525 // Original type: uint8_t
1526 optional int32 afh_select_unideal_channel_count = 9;
1527 // Current Link Supervision Timeout Setting
1528 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1529 // Original type: uint16_t
1530 optional int32 lsto = 10;
1531 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1532 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1533 // 0x01 (Piconet Clock)
1534 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1535 // Original type: uint32_t
1536 optional int64 connection_piconet_clock = 11;
1537 // The count of retransmission
1538 // Original type: uint32_t
1539 optional int64 retransmission_count = 12;
1540 // The count of no RX
1541 // Original type: uint32_t
1542 optional int64 no_rx_count = 13;
1543 // The count of NAK (Negative Acknowledge)
1544 // Original type: uint32_t
1545 optional int64 nak_count = 14;
1546 // Controller timestamp of last TX ACK
1547 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1548 // Original type: uint32_t
1549 optional int64 last_tx_ack_timestamp = 15;
1550 // The count of Flow-off (STOP)
1551 // Original type: uint32_t
1552 optional int64 flow_off_count = 16;
1553 // Controller timestamp of last Flow-on (GO)
1554 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1555 // Original type: uint32_t
1556 optional int64 last_flow_on_timestamp = 17;
1557 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1558 // Original type: uint32_t
1559 optional int64 buffer_overflow_bytes = 18;
1560 // Buffer underflow count (in byte) since last event
1561 // Original type: uint32_t
1562 optional int64 buffer_underflow_bytes = 19;
1563}
1564
1565/**
1566 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1567 *
1568 * Notes:
1569 * - Each event can be partially filled as we might learn different pieces of device
1570 * information at different time
1571 * - Multiple device info events can be combined to give more complete picture
1572 * - When multiple device info events tries to describe the same information, the
1573 * later one wins
1574 *
1575 * Logged from:
1576 * packages/apps/Bluetooth
1577 */
1578message BluetoothManufacturerInfoReported {
1579 // An identifier that can be used to match events for this device.
1580 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1581 // Salt: Randomly generated 256 bit value
1582 // Hash algorithm: HMAC-SHA256
1583 // Size: 32 byte
1584 // Default: null or empty if the device identifier is not known
1585 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1586 // Where is this device info obtained from
1587 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1588 // Name of the data source
1589 // For EXTERNAL: package name of the data source
1590 // For INTERNAL: null for general case, component name otherwise
1591 optional string source_name = 3;
1592 // Name of the manufacturer of this device
1593 optional string manufacturer = 4;
1594 // Model of this device
1595 optional string model = 5;
1596 // Hardware version of this device
1597 optional string hardware_version = 6;
1598 // Software version of this device
1599 optional string software_version = 7;
1600}
1601
1602/**
1603 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1604 * device, as documented by the Bluetooth Core HCI specification
1605 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1606 * Vol 2, Part E, Page 1118
1607 *
1608 * Logged from:
1609 * system/bt
1610 */
1611message BluetoothRemoteVersionInfoReported {
1612 // Connection handle of the connection
1613 // Original type: uint16_t
1614 optional int32 connection_handle = 1;
1615 // HCI command status code
1616 // Default: STATUS_UNKNOWN
1617 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1618 // 1 byte Version of current LMP in the remote controller
1619 optional int32 lmp_version = 3;
1620 // 2 bytes LMP manufacturer code of the remote controller
1621 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1622 optional int32 lmp_manufacturer_code = 4;
1623 // 4 bytes subversion of the LMP in the remote controller
1624 optional int32 lmp_subversion = 5;
1625}
1626
1627/**
1628 * Logs when certain Bluetooth SDP attributes are discovered
1629 * Constant definitions are from:
1630 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1631 *
1632 * Current logged attributes:
1633 * - BluetoothProfileDescriptorList
1634 * - Supported Features Bitmask
1635 *
1636 * Logged from:
1637 * system/bt
1638 */
1639message BluetoothSdpAttributeReported {
1640 // An identifier that can be used to match events for this device.
1641 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1642 // Salt: Randomly generated 256 bit value
1643 // Hash algorithm: HMAC-SHA256
1644 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1645 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1646 // Original type: uint16_t
1647 optional int32 protocol_uuid = 2;
1648 // Short form UUIDs used to identify Bluetooth SDP attribute types
1649 // Original type: uint16_t
1650 optional int32 attribute_id = 3;
1651 // Attribute value for the particular attribute
1652 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1653}
1654
1655/**
1656 * Logs when bond state of a Bluetooth device changes
1657 *
1658 * Logged from:
1659 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1660 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1661 */
1662message BluetoothBondStateChanged {
1663 // An identifier that can be used to match events for this device.
1664 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1665 // Salt: Randomly generated 256 bit value
1666 // Hash algorithm: HMAC-SHA256
1667 // Size: 32 byte
1668 // Default: null or empty if the device identifier is not known
1669 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1670 // Preferred transport type to remote dual mode device
1671 // Default: TRANSPORT_AUTO means no preference
1672 optional android.bluetooth.TransportTypeEnum transport = 2;
1673 // The type of this Bluetooth device (Classic, LE, or Dual mode)
1674 // Default: UNKNOWN
1675 optional android.bluetooth.DeviceTypeEnum type = 3;
1676 // Current bond state (NONE, BONDING, BONDED)
1677 // Default: BOND_STATE_UNKNOWN
1678 optional android.bluetooth.BondStateEnum bond_state = 4;
1679 // Bonding sub state
1680 // Default: BOND_SUB_STATE_UNKNOWN
1681 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
1682 // Unbond Reason
1683 // Default: UNBOND_REASON_UNKNOWN
1684 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
1685}
1686
1687/**
1688 * Logs there is an event related Bluetooth classic pairing
1689 *
1690 * Logged from:
1691 * system/bt
1692 */
1693message BluetoothClassicPairingEventReported {
1694 // An identifier that can be used to match events for this device.
1695 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1696 // Salt: Randomly generated 256 bit value
1697 // Hash algorithm: HMAC-SHA256
1698 // Size: 32 byte
1699 // Default: null or empty if the device identifier is not known
1700 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1701 // Connection handle of this connection if available
1702 // Range: 0x0000 - 0x0EFF (12 bits)
1703 // Default: 0xFFFF if the handle is unknown
1704 optional int32 connection_handle = 2;
1705 // HCI command associated with this event
1706 // Default: CMD_UNKNOWN
1707 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
1708 // HCI event associated with this event
1709 // Default: EVT_UNKNOWN
1710 optional android.bluetooth.hci.EventEnum hci_event = 4;
1711 // HCI command status code if this is triggerred by hci_cmd
1712 // Default: STATUS_UNKNOWN
1713 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
1714 // HCI reason code associated with this event
1715 // Default: STATUS_UNKNOWN
1716 optional android.bluetooth.hci.StatusEnum reason_code = 6;
1717}
1718
1719/**
1720 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
1721 *
1722 * Logged from:
1723 * system/bt
1724 */
1725message BluetoothSmpPairingEventReported {
1726 // An identifier that can be used to match events for this device.
1727 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1728 // Salt: Randomly generated 256 bit value
1729 // Hash algorithm: HMAC-SHA256
1730 // Size: 32 byte
1731 // Default: null or empty if the device identifier is not known
1732 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1733 // SMP command sent or received over L2CAP
1734 // Default: CMD_UNKNOWN
1735 optional android.bluetooth.smp.CommandEnum smp_command = 2;
1736 // Whether this command is sent or received
1737 // Default: DIRECTION_UNKNOWN
1738 optional android.bluetooth.DirectionEnum direction = 3;
1739 // SMP failure reason code
1740 // Default: PAIRING_FAIL_REASON_DEFAULT
1741 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
1742}
1743
1744/**
Jack He9c30c7c6b2019-01-30 17:24:55 -08001745 * Logs when a Bluetooth socket’s connection state changed
1746 *
1747 * Logged from:
1748 * system/bt
1749 */
1750message BluetoothSocketConnectionStateChanged {
1751 // An identifier that can be used to match events for this device.
1752 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1753 // Salt: Randomly generated 256 bit value
1754 // Hash algorithm: HMAC-SHA256
1755 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08001756 // Default: null or empty if this is a server listener socket
Jack He9c30c7c6b2019-01-30 17:24:55 -08001757 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08001758 // Temporary port of this socket for the current connection or session only
Jack He9c30c7c6b2019-01-30 17:24:55 -08001759 // Default 0 when unknown or don't care
1760 optional int32 port = 2;
1761 // Socket type as mentioned in
1762 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
1763 // Default: SOCKET_TYPE_UNKNOWN
1764 optional android.bluetooth.SocketTypeEnum type = 3;
1765 // Socket connection state
1766 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
1767 optional android.bluetooth.SocketConnectionstateEnum state = 4;
1768 // Number of bytes sent to remote device during this connection
1769 optional int64 tx_bytes = 5;
1770 // Number of bytes received from remote device during this connection
1771 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08001772 // Socket owner's UID
1773 optional int32 uid = 7 [(is_uid) = true];
1774 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
1775 // |port| must be spawned by |server_port|
1776 // Default 0 when unknown or don't care
1777 optional int32 server_port = 8;
1778 // Whether this is a server listener socket
1779 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He9c30c7c6b2019-01-30 17:24:55 -08001780}
1781
1782/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001783 * Logs when something is plugged into or removed from the USB-C connector.
1784 *
1785 * Logged from:
1786 * Vendor USB HAL.
1787 */
1788message UsbConnectorStateChanged {
1789 enum State {
1790 DISCONNECTED = 0;
1791 CONNECTED = 1;
1792 }
1793 optional State state = 1;
1794}
1795
1796/**
1797 * Logs the reported speaker impedance.
1798 *
1799 * Logged from:
1800 * Vendor audio implementation.
1801 */
1802message SpeakerImpedanceReported {
1803 optional int32 speaker_location = 1;
1804 optional int32 impedance = 2;
1805}
1806
1807/**
1808 * Logs the report of a failed hardware.
1809 *
1810 * Logged from:
1811 * Vendor HALs.
1812 *
1813 */
1814message HardwareFailed {
1815 enum HardwareType {
1816 HARDWARE_FAILED_UNKNOWN = 0;
1817 HARDWARE_FAILED_MICROPHONE = 1;
1818 HARDWARE_FAILED_CODEC = 2;
1819 HARDWARE_FAILED_SPEAKER = 3;
1820 HARDWARE_FAILED_FINGERPRINT = 4;
1821 }
1822 optional HardwareType hardware_type = 1;
1823
1824 /* hardware_location allows vendors to differentiate between multiple instances of
1825 * the same hardware_type. The specific locations are vendor defined integers,
1826 * referring to board-specific numbering schemes.
1827 */
1828 optional int32 hardware_location = 2;
1829
1830 /* failure_code is specific to the HardwareType of the failed hardware.
1831 * It should use the enum values defined below.
1832 */
1833 enum MicrophoneFailureCode {
1834 MICROPHONE_FAILURE_COMPLETE = 0;
1835 }
1836 enum CodecFailureCode {
1837 CODEC_FAILURE_COMPLETE = 0;
1838 }
1839 enum SpeakerFailureCode {
1840 SPEAKER_FAILURE_COMPLETE = 0;
1841 SPEAKER_FAILURE_HIGH_Z = 1;
1842 SPEAKER_FAILURE_SHORT = 2;
1843 }
1844 enum FingerprintFailureCode {
1845 FINGERPRINT_FAILURE_COMPLETE = 0;
1846 FINGERPRINT_SENSOR_BROKEN = 1;
1847 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1848 }
1849 optional int32 failure_code = 3;
1850}
1851
1852/**
1853 * Log an event when the device has been physically dropped.
1854 * Reported from the /vendor partition.
1855 */
1856message PhysicalDropDetected {
1857 // Confidence that the event was actually a drop, 0 -> 100
1858 optional int32 confidence_pctg = 1;
1859 // Peak acceleration of the drop, in 1/1000s of a g.
1860 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001861 // Duration of freefall in ms
1862 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001863}
1864
1865/**
1866 * Log bucketed battery charge cycles.
1867 *
1868 * Each bucket represents cycles of the battery past
1869 * a given charge point. For example, bucket 1 is the
1870 * lowest 1/8th of the battery, and bucket 8 is 100%.
1871 *
1872 * Logged from:
1873 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1874 */
1875message ChargeCyclesReported {
1876 optional int32 cycle_bucket_1 = 1;
1877 optional int32 cycle_bucket_2 = 2;
1878 optional int32 cycle_bucket_3 = 3;
1879 optional int32 cycle_bucket_4 = 4;
1880 optional int32 cycle_bucket_5 = 5;
1881 optional int32 cycle_bucket_6 = 6;
1882 optional int32 cycle_bucket_7 = 7;
1883 optional int32 cycle_bucket_8 = 8;
1884}
1885
1886/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001887 * Logs the duration of a davey (jank of >=700ms) when it occurs
1888 *
1889 * Logged from:
1890 * frameworks/base/libs/hwui/JankTracker.cpp
1891 */
1892message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001893 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001894 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001895
Tej Singhbb8554a2018-01-26 11:59:14 -08001896 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001897 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001898}
1899
1900/**
Bookatze5885242017-10-24 20:10:31 -07001901 * Logs phone signal strength changes.
1902 *
1903 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001904 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001905 */
1906message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001907 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1908 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001909}
1910
Yangster4ccebea2018-10-09 17:09:02 -07001911
1912/**
1913 * Logs when the phone state, sim state or signal strength changes
1914 *
1915 * Logged from:
1916 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1917 */
1918message PhoneServiceStateChanged {
1919 optional android.telephony.ServiceStateEnum state = 1;
1920 optional android.telephony.SimStateEnum sim_state = 2;
1921 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1922}
1923
1924/**
1925 * Logs when the phone becomes on or off.
1926 *
1927 * Logged from:
1928 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1929 */
1930message PhoneStateChanged {
1931 enum State {
1932 OFF = 0;
1933 ON = 1;
1934 }
1935 optional State state = 1;
1936}
1937
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001938message LauncherUIChanged {
Yao Chen046b5122018-10-24 14:09:20 -07001939 optional android.stats.launcher.LauncherAction action = 1;
1940 optional android.stats.launcher.LauncherState src_state = 2;
1941 optional android.stats.launcher.LauncherState dst_state = 3;
1942 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001943 optional bool is_swipe_up_enabled = 5;
1944}
1945
David Chenc28b2bb2017-10-24 12:52:52 -07001946/**
1947 * Logs that a setting was updated.
1948 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001949 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001950 * The tag and is_default allow resetting of settings to default values based on the specified
1951 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1952 */
1953message SettingChanged {
1954 // The name of the setting.
1955 optional string setting = 1;
1956
1957 // The change being imposed on this setting. May represent a number, eg "3".
1958 optional string value = 2;
1959
1960 // The new value of this setting. For most settings, this is same as value. For some settings,
1961 // value is +X or -X where X represents an element in a set. For example, if the previous value
1962 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1963 // The +/- feature is currently only used for location_providers_allowed.
1964 optional string new_value = 3;
1965
1966 // The previous value of this setting.
1967 optional string prev_value = 4;
1968
1969 // The tag used with the is_default for resetting sets of settings. This is generally null.
1970 optional string tag = 5;
1971
Bookatz90867622018-01-31 15:05:57 -08001972 // True if this setting with tag should be resettable.
1973 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001974
David Chenbd789912018-03-16 17:19:55 -07001975 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001976 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001977
1978 enum ChangeReason {
1979 UPDATED = 1; // Updated can be an insertion or an update.
1980 DELETED = 2;
1981 }
1982 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001983}
Chenjie Yub3dda412017-10-24 13:41:59 -07001984
Chenjie Yu05013b32017-11-21 10:21:41 -08001985/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001986 * Logs activity going to foreground or background
1987 *
1988 * Logged from:
1989 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1990 */
1991message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001992 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001993 optional string pkg_name = 2;
1994 optional string class_name = 3;
1995
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001996 enum State {
1997 BACKGROUND = 0;
1998 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001999 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002000 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002001}
David Chenc8a43242017-10-17 16:23:28 -07002002
2003/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002004 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002005 * Logged from:
2006 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2007 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002008message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002009 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002010
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002011 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002012
2013 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002014 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002015 optional string process_name = 3;
2016
2017 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002018 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002019
2020 optional string package_name = 5;
2021
2022 enum InstantApp {
2023 UNAVAILABLE = 0;
2024 FALSE = 1;
2025 TRUE = 2;
2026 }
2027 optional InstantApp is_instant_app = 6;
2028
2029 enum ForegroundState {
2030 UNKNOWN = 0;
2031 BACKGROUND = 1;
2032 FOREGROUND = 2;
2033 }
2034 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002035}
David Chen9e3808c2017-11-20 17:25:34 -08002036
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002037/**
2038 * Logs when a WTF (What a Terrible Failure) happened.
2039 * Logged from:
2040 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2041 */
2042message WTFOccurred {
2043 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002044
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002045 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002046
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002047 // The name of the process.
2048 // system_server if it is not by an app
2049 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002050
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002051 // The pid if available. -1 means not available.
2052 optional sint32 pid = 4;
2053}
2054
2055/**
2056 * Logs when system server reports low memory.
2057 * Logged from:
2058 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2059 */
2060message LowMemReported {
2061}
2062
2063/**
2064 * Logs when an app ANR (App Not Responding) occurs.
2065 * Logged from:
2066 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2067 */
2068message ANROccurred {
2069 optional int32 uid = 1 [(is_uid) = true];
2070
2071 optional string process_name = 2;
2072
2073 optional string short_component_name = 3;
2074
2075 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002076
2077 enum InstantApp {
2078 UNAVAILABLE = 0;
2079 FALSE = 1;
2080 TRUE = 2;
2081 }
2082 optional InstantApp is_instant_app = 5;
2083
2084 enum ForegroundState {
2085 UNKNOWN = 0;
2086 BACKGROUND = 1;
2087 FOREGROUND = 2;
2088 }
2089 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08002090}
2091
David Chen0a368b22017-12-06 16:28:16 -08002092/*
2093 * Allows other apps to push events into statsd.
2094 * Logged from:
2095 * frameworks/base/core/java/android/util/StatsLog.java
2096 */
David Chen0b5c90c2018-01-25 16:51:49 -08002097message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002098 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002099 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002100
2101 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2102 optional int32 label = 2;
2103
2104 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2105 // predicates for the metrics).
2106 enum State {
2107 UNKNOWN = 0;
2108 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2109 STOP = 2;
2110 START = 3;
2111 }
2112 optional State state = 3;
2113}
2114
David Chen9e3808c2017-11-20 17:25:34 -08002115/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002116 * Logs when statsd detects an anomaly.
2117 *
2118 * Logged from:
2119 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2120 */
2121message AnomalyDetected {
2122 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002123 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002124
Yangster-mac94e197c2018-01-02 16:03:03 -08002125 // Id of the config whose anomaly detection alert fired.
2126 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002127
Yangster-mac94e197c2018-01-02 16:03:03 -08002128 // Id of the alert (i.e. name of the anomaly that was detected).
2129 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002130}
2131
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002132message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002133 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002134 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002135
2136 // The app package name.
2137 optional string pkg_name = 2;
2138
2139 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002140 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002141 WARM = 1;
2142 HOT = 2;
2143 COLD = 3;
2144 }
2145 // The transition type.
2146 optional TransitionType type = 3;
2147
2148 // The activity name.
2149 optional string activity_name = 4;
2150
2151 // The name of the calling app. Empty if not set.
2152 optional string calling_pkg_name = 5;
2153
2154 // Whether the app is an instant app.
2155 optional bool is_instant_app = 6;
2156
2157 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002158 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002159
Bookatz80d11a02018-01-16 10:46:35 -08002160 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002161
David Chen0b5c90c2018-01-25 16:51:49 -08002162 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002163 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002164 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002165 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002166 optional int32 bind_application_delay_millis = 11;
2167 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002168
2169 // Empty if not set.
2170 optional string launch_token = 13;
2171
Calin Juravle759fbda2018-02-20 19:52:30 +00002172 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002173 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002174
2175 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002176 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002177}
2178
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002179message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002180 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002181 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002182
2183 // The app package name.
2184 optional string pkg_name = 2;
2185
2186 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002187 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002188 WARM = 1;
2189 HOT = 2;
2190 COLD = 3;
2191 }
2192 // The transition type.
2193 optional TransitionType type = 3;
2194
2195 // The activity name.
2196 optional string activity_name = 4;
2197}
2198
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002199message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002200 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002201 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002202
2203 // The app package name.
2204 optional string pkg_name = 2;
2205
2206 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002207 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002208 WITH_BUNDLE = 1;
2209 WITHOUT_BUNDLE = 2;
2210 }
2211 // The transition type.
2212 optional TransitionType type = 3;
2213
2214 // The activity name.
2215 optional string activity_name = 4;
2216
2217 optional bool transition_process_running = 5;
2218
2219 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002220 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002221}
2222
Bookatz8fcd09a2017-12-18 13:01:10 -08002223/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002224 * Logs a picture-in-picture action
2225 * Logged from:
2226 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2227 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2228 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2229 */
2230message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002231 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002232 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002233
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002234 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002235
Chenjie Yu52cacc62017-12-08 18:11:45 -08002236 enum State {
2237 ENTERED = 1;
2238 EXPANDED_TO_FULL_SCREEN = 2;
2239 MINIMIZED = 3;
2240 DISMISSED = 4;
2241 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002242 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002243}
2244
2245/**
Chenjie Yue8904192017-12-08 19:12:57 -08002246 * Logs overlay action
2247 * Logged from:
2248 * services/core/java/com/android/server/wm/Session.java
2249 */
2250message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002251 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002252
2253 optional string package_name = 2;
2254
2255 optional bool using_alert_window = 3;
2256
2257 enum State {
2258 ENTERED = 1;
2259 EXITED = 2;
2260 }
2261 optional State state = 4;
2262}
2263
Chenjie Yuccfe6452018-01-30 11:33:21 -08002264/*
2265 * Logs foreground service starts and stops.
2266 * Note that this is not when a service starts or stops, but when it is
2267 * considered foreground.
2268 * Logged from
2269 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2270 */
2271message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002272 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002273 // package_name + "/" + class_name
2274 optional string short_name = 2;
2275
2276 enum State {
2277 ENTER = 1;
2278 EXIT = 2;
2279 }
2280 optional State state = 3;
2281}
2282
Chenjie Yue8904192017-12-08 19:12:57 -08002283/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002284 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2285 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2286 * attributed back to the parent (host) uid. One example is Chrome.
2287 *
2288 * Logged from:
2289 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2290 */
2291message IsolatedUidChanged {
2292 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002293 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002294 optional int32 parent_uid = 1;
2295
2296 optional int32 isolated_uid = 2;
2297
2298 // We expect an isolated uid to be removed before if it's used for another parent uid.
2299 enum Event {
2300 REMOVED = 0;
2301 CREATED = 1;
2302 }
2303 optional Event event = 3;
2304}
2305
2306/*
2307 * Logs the reception of an incoming network packet causing the main system to wake up for
2308 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2309 * and processed by WakeupController.cpp.
2310 */
2311message PacketWakeupOccurred {
2312 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2313 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002314 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002315 // The interface name on which the packet was received.
2316 optional string iface = 2;
2317 // The ethertype value of the packet.
2318 optional int32 ethertype = 3;
2319 // String representation of the destination MAC address of the packet.
2320 optional string destination_hardware_address = 4;
2321 // String representation of the source address of the packet if this was an IP packet.
2322 optional string source_ip = 5;
2323 // String representation of the destination address of the packet if this was an IP packet.
2324 optional string destination_ip = 6;
2325 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2326 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2327 // families.
2328 optional int32 ip_next_header = 7;
2329 // The source port if this was a TCP or UDP packet.
2330 optional int32 source_port = 8;
2331 // The destination port if this was a TCP or UDP packet.
2332 optional int32 destination_port = 9;
2333}
2334
2335/*
2336 * Logs the memory stats for an app on startup.
2337 * Logged from:
2338 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2339 */
2340message AppStartMemoryStateCaptured {
2341 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002342 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002343
2344 // The process name.
2345 optional string process_name = 2;
2346
2347 // The activity name.
2348 optional string activity_name = 3;
2349
2350 // # of page-faults
2351 optional int64 pgfault = 4;
2352
2353 // # of major page-faults
2354 optional int64 pgmajfault = 5;
2355
2356 // RSS
2357 optional int64 rss_in_bytes = 6;
2358
2359 // CACHE
2360 optional int64 cache_in_bytes = 7;
2361
2362 // SWAP
2363 optional int64 swap_in_bytes = 8;
2364}
2365
2366/*
2367 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2368 * for LMK event.
2369 * Logged from:
2370 * system/core/lmkd/lmkd.c
2371 */
2372message LmkStateChanged {
2373 enum State {
2374 UNKNOWN = 0;
2375 START = 1;
2376 STOP = 2;
2377 }
2378 optional State state = 1;
2379}
2380
2381/*
2382 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2383 * Logged from:
2384 * system/core/lmkd/lmkd.c
2385 */
2386message LmkKillOccurred {
2387 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002388 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002389
2390 // The process name.
2391 optional string process_name = 2;
2392
2393 // oom adj score.
2394 optional int32 oom_score = 3;
2395
2396 // # of page-faults
2397 optional int64 pgfault = 4;
2398
2399 // # of major page-faults
2400 optional int64 pgmajfault = 5;
2401
2402 // RSS
2403 optional int64 rss_in_bytes = 6;
2404
2405 // CACHE
2406 optional int64 cache_in_bytes = 7;
2407
2408 // SWAP
2409 optional int64 swap_in_bytes = 8;
Jim Blackler972a5c52018-11-21 15:24:48 +00002410
2411 // The elapsed real time of start of the process.
2412 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002413}
2414
Rajeev Kumar51b54602018-03-01 12:18:26 -08002415/*
2416 * Logs when the ActivityManagerService detects that an app died.
2417 *
2418 * Logged from:
2419 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2420 */
2421message AppDied {
2422 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07002423 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002424}
2425
Chenjie Yubbcbc602018-02-05 16:51:52 -08002426//////////////////////////////////////////////////////////////////////
2427// Pulled atoms below this line //
2428//////////////////////////////////////////////////////////////////////
2429
2430/**
David Chenc8a43242017-10-17 16:23:28 -07002431 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2432 *
2433 * Pulled from:
2434 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2435 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002436message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002437 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002438
2439 optional int64 rx_bytes = 2;
2440
2441 optional int64 rx_packets = 3;
2442
2443 optional int64 tx_bytes = 4;
2444
2445 optional int64 tx_packets = 5;
2446}
2447
2448/**
2449 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2450 *
2451 * Pulled from:
2452 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2453 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002454message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002455 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002456
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002457 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2458 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002459
2460 optional int64 rx_bytes = 3;
2461
2462 optional int64 rx_packets = 4;
2463
2464 optional int64 tx_bytes = 5;
2465
2466 optional int64 tx_packets = 6;
2467}
2468
2469/**
2470 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2471 *
2472 * Pulled from:
2473 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2474 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002475message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002476 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002477
2478 optional int64 rx_bytes = 2;
2479
2480 optional int64 rx_packets = 3;
2481
2482 optional int64 tx_bytes = 4;
2483
2484 optional int64 tx_packets = 5;
2485}
2486
2487/**
2488 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2489 *
2490 * Pulled from:
2491 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2492 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002493message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002494 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002495
Yao Chenc40a19d2018-03-15 16:48:25 -07002496 // 1 denotes foreground and 0 denotes background. This is called Set in
2497 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002498 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002499
2500 optional int64 rx_bytes = 3;
2501
2502 optional int64 rx_packets = 4;
2503
2504 optional int64 tx_bytes = 5;
2505
2506 optional int64 tx_packets = 6;
2507}
2508
2509/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002510 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2511 *
2512 * Pulled from:
2513 * StatsCompanionService
2514 */
2515message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002516 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002517
2518 optional int64 rx_bytes = 2;
2519
2520 optional int64 tx_bytes = 3;
2521}
2522
2523/**
David Chenc8a43242017-10-17 16:23:28 -07002524 * Pulls the kernel wakelock durations. This atom is adapted from
2525 * android/internal/os/KernelWakelockStats.java
2526 *
2527 * Pulled from:
2528 * StatsCompanionService using KernelWakelockReader.
2529 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002530message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002531 optional string name = 1;
2532
2533 optional int32 count = 2;
2534
2535 optional int32 version = 3;
2536
2537 optional int64 time = 4;
2538}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002539
Chenjie Yu05013b32017-11-21 10:21:41 -08002540/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002541 * Pulls low power state information. This includes platform and subsystem sleep state information,
2542 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002543 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002544 * hardware/interfaces/power/1.1/types.hal
2545 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002546message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002547 // Subsystem name
2548 optional string subsystem_name = 1;
2549 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2550 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2551 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002552 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002553 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002554 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002555 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002556}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002557
Chenjie Yu05013b32017-11-21 10:21:41 -08002558/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002559 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002560 * Pulls the time the cpu spend on the frequency index. Frequency index
2561 * starts from highest to lowest. The value should be monotonically
2562 * increasing since boot. However, if there is a cpu
2563 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002564 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002565message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002566 optional uint32 cluster = 1;
2567 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002568 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002569}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002570
Chenjie Yu05013b32017-11-21 10:21:41 -08002571/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002572 * Pulls Cpu Time Per Uid.
2573 * Note that isolated process uid time should be attributed to host uids.
2574 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002575message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002576 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002577 optional uint64 user_time_micros = 2;
2578 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002579}
2580
2581/**
2582 * Pulls Cpu Time Per Uid per frequency.
2583 * Note that isolated process uid time should be attributed to host uids.
2584 * For each uid, we order the time by descending frequencies.
2585 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002586message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002587 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002588 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002589 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002590}
Hugo Benichi884970e2017-11-14 22:42:46 +09002591
Chenjie Yu05013b32017-11-21 10:21:41 -08002592/**
2593 * Pulls Wifi Controller Activity Energy Info
2594 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002595message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002596 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002597 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002598 // stack reported state
2599 // TODO: replace this with proto enum
2600 optional int32 stack_state = 2;
2601 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002602 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002603 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002604 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002605 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002606 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002607 // product of current(mA), voltage(V) and time(ms)
2608 optional uint64 controller_energy_used = 6;
2609}
2610
2611/**
2612 * Pulls Modem Activity Energy Info
2613 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002614message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002615 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002616 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002617 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08002618 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08002619 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002620 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002621 /**
2622 * Tx power index
2623 * index 0 = tx_power < 0dBm
2624 * index 1 = 0dBm < tx_power < 5dBm
2625 * index 2 = 5dBm < tx_power < 15dBm
2626 * index 3 = 15dBm < tx_power < 20dBm
2627 * index 4 = tx_power > 20dBm
2628 */
2629 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002630 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002631 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002632 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002633 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002634 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002635 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002636 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002637 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002638 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002639 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002640 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002641 // product of current(mA), voltage(V) and time(ms)
2642 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002643}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002644
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002645/**
2646 * Pulls Bluetooth Activity Energy Info
2647 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2648 */
2649message BluetoothActivityInfo {
2650 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002651 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002652 // bluetooth stack state
2653 optional int32 bluetooth_stack_state = 2;
2654 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002655 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002656 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002657 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002658 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002659 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002660 // product of current(mA), voltage(V) and time(ms)
2661 optional uint64 energy_used = 6;
2662}
2663
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002664/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002665 * Logs the memory stats for a process.
2666 */
2667message ProcessMemoryState {
2668 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002669 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002670
2671 // The process name.
2672 optional string process_name = 2;
2673
2674 // oom adj score.
2675 optional int32 oom_score = 3;
2676
2677 // # of page-faults
2678 optional int64 pgfault = 4;
2679
2680 // # of major page-faults
2681 optional int64 pgmajfault = 5;
2682
Rajeev Kumar90235992018-01-29 11:06:48 -08002683 // RSS
2684 optional int64 rss_in_bytes = 6;
2685
2686 // CACHE
2687 optional int64 cache_in_bytes = 7;
2688
2689 // SWAP
2690 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002691}
2692
2693/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002694 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002695 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002696message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002697 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002698}
2699
2700/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002701 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002702 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002703message SystemUptime {
2704 // Milliseconds since the system was booted.
2705 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2706 // for external input).
2707 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002708 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002709}
2710
2711/*
2712 * Reads from /proc/uid_concurrent_active_time which has the format:
2713 * active: X (X is # cores)
2714 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2715 * [uid1]: [time-0] [time-1] [time-2] ... ...
2716 * ...
2717 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2718 * The file contains a monotonically increasing count of time for a single boot.
2719 */
2720message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002721 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002722 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002723}
2724
2725/**
2726 * Reads from /proc/uid_concurrent_policy_time which has the format:
2727 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2728 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2729 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2730 * ...
2731 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2732 * The file contains a monotonically increasing count of time for a single boot.
2733 */
2734message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002735 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002736 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002737 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002738}
2739
2740/*
2741 * Pulls free disk space, for data, system partition and temporary directory.
2742 */
2743message DiskSpace {
2744 // available bytes in data partition
2745 optional uint64 data_available_bytes = 1;
2746 // available bytes in system partition
2747 optional uint64 system_available_bytes = 2;
2748 // available bytes in download cache or temp directories
2749 optional uint64 temp_available_bytes = 3;
2750}
Tej Singhbf972d92018-01-10 20:51:13 -08002751
2752/**
2753 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002754 * Pulled from:
2755 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002756 */
2757message RemainingBatteryCapacity {
2758 optional int32 charge_uAh = 1;
2759}
2760
2761/**
2762 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002763 * Pulled from:
2764 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002765 */
2766message FullBatteryCapacity {
2767 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08002768}
2769
2770/**
Tej Singhd89137e2018-03-26 14:51:40 -07002771 * Pulls the temperature of various parts of the device.
2772 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002773 *
2774 * Pulled from:
2775 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2776 */
2777message Temperature {
2778 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2779 optional android.os.TemperatureTypeEnum sensor_location = 1;
2780
2781 // The name of the temperature source. Eg. CPU0
2782 optional string sensor_name = 2;
2783
Tej Singhd89137e2018-03-26 14:51:40 -07002784 // Temperature in tenths of a degree C.
2785 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08002786}
lifr35a7cf02018-12-12 16:38:04 +08002787
2788/**
2789 * Logs the latency period(in microseconds) and the return code of
2790 * the DNS(Domain Name System) lookups.
2791 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
2792 * to get info(address or hostname) from DNS server(or DNS cache).
2793 * Logged from:
2794 * /system/netd/server/DnsProxyListener.cpp
2795 */
2796message NetworkDnsEventReported {
2797 // The types of the DNS lookups, as defined in
2798 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
2799 enum EventType {
2800 EVENT_UNKNOWN = 0;
2801 EVENT_GETADDRINFO = 1;
2802 EVENT_GETHOSTBYNAME = 2;
2803 EVENT_GETHOSTBYADDR = 3;
2804 EVENT_RES_NSEND = 4;
2805 }
2806 optional EventType event_type = 1;
2807
2808 // The return value of the DNS resolver for each DNS lookups.
2809 //bionic/libc/include/netdb.h
2810 //system/netd/resolv/include/netd_resolv/resolv.h
2811 enum ReturnCode {
2812 EAI_NO_ERROR = 0;
2813 EAI_ADDRFAMILY = 1;
2814 EAI_AGAIN = 2;
2815 EAI_BADFLAGS = 3;
2816 EAI_FAIL = 4;
2817 EAI_FAMILY = 5;
2818 EAI_MEMORY = 6;
2819 EAI_NODATA = 7;
2820 EAI_NONAME = 8;
2821 EAI_SERVICE = 9;
2822 EAI_SOCKTYPE = 10;
2823 EAI_SYSTEM = 11;
2824 EAI_BADHINTS = 12;
2825 EAI_PROTOCOL = 13;
2826 EAI_OVERFLOW = 14;
2827 RESOLV_TIMEOUT = 255;
2828 EAI_MAX = 256;
2829 }
2830 optional ReturnCode return_code = 2;
2831
2832 // The latency period(in microseconds) it took for this DNS lookup to complete.
2833 optional int32 latency_micros = 3;
2834}
2835
Chiachang Wang67f24472019-01-15 15:14:00 +08002836/**
2837 * Logs when a data stall event occurs.
2838 *
2839 * Log from:
2840 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2841 */
2842message DataStallEvent {
2843 // Data stall evaluation type.
2844 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2845 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
2846 optional int32 evaluation_type = 1;
2847 // See definition in data_stall_event.proto.
2848 optional com.android.server.connectivity.ProbeResult validation_result = 2;
2849 // See definition in data_stall_event.proto.
2850 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
2851 // See definition in data_stall_event.proto.
2852 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
2853 // See definition in data_stall_event.proto.
2854 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
2855 // See definition in data_stall_event.proto.
2856 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
2857}
Jack Yu6d421bc2019-01-23 17:42:54 +08002858
2859/**
2860 * Logs when a NFC device's error occurred.
2861 * Logged from:
2862 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2863 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
2864 */
2865message NfcErrorOccurred {
2866 enum Type {
2867 UNKNOWN = 0;
2868 CMD_TIMEOUT = 1;
2869 ERROR_NOTIFICATION = 2;
2870 AID_OVERFLOW = 3;
2871 }
2872 optional Type type = 1;
2873 // If it's nci cmd timeout, log the timeout command.
2874 optional uint32 nci_cmd = 2;
2875
2876 optional uint32 error_ntf_status_code = 3;
2877}
2878
2879/**
2880 * Logs when a NFC device's state changed event
2881 * Logged from:
2882 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
2883 */
2884message NfcStateChanged {
2885 enum State {
2886 UNKNOWN = 0;
2887 OFF = 1;
2888 ON = 2;
2889 ON_LOCKED = 3; // Secure Nfc enabled.
2890 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
2891 }
2892 optional State state = 1;
2893}
2894
2895/**
2896 * Logs when a NFC Beam Transaction occurred.
2897 * Logged from:
2898 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
2899 */
2900message NfcBeamOccurred {
2901 enum Operation {
2902 UNKNOWN = 0;
2903 SEND = 1;
2904 RECEIVE = 2;
2905 }
2906 optional Operation operation = 1;
2907}
2908
2909/**
2910 * Logs when a NFC Card Emulation Transaction occurred.
2911 * Logged from:
2912 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
2913 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
2914 */
2915message NfcCardemulationOccurred {
2916 enum Category {
2917 UNKNOWN = 0;
2918 HCE_PAYMENT = 1;
2919 HCE_OTHER = 2;
2920 OFFHOST = 3;
2921 }
2922 // Transaction belongs to HCE payment or HCE other category, or offhost.
2923 optional Category category = 1;
2924 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
2925 optional string se_name = 2;
2926}
2927
2928/**
2929 * Logs when a NFC Tag event occurred.
2930 * Logged from:
2931 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
2932 */
2933message NfcTagOccurred {
2934 enum Type {
2935 UNKNOWN = 0;
2936 URL = 1;
2937 BT_PAIRING = 2;
2938 PROVISION = 3;
2939 WIFI_CONNECT = 4;
2940 APP_LAUNCH = 5;
2941 OTHERS = 6;
2942 }
2943 optional Type type = 1;
2944}
2945
2946/**
2947 * Logs when Hce transaction triggered
2948 * Logged from:
2949 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2950 */
2951message NfcHceTransactionOccurred {
2952 // The latency period(in microseconds) it took for the first HCE data
2953 // exchange.
2954 optional uint32 latency_micros = 1;
2955}
2956
2957/**
2958 * Logs when SecureElement state event changed
2959 * Logged from:
2960 * packages/apps/SecureElement/src/com/android/se/Terminal.java
2961 */
2962message SeStateChanged {
2963 enum State {
2964 UNKNOWN = 0;
2965 INITIALIZED = 1;
2966 DISCONNECTED = 2;
2967 CONNECTED = 3;
2968 HALCRASH = 4;
2969 }
2970 optional State state = 1;
2971
2972 optional string state_change_reason = 2;
2973 // SIMx or eSEx.
2974 optional string terminal = 3;
2975}
2976
2977/**
2978 * Logs when Omapi API used
2979 * Logged from:
2980 * packages/apps/SecureElement/src/com/android/se/Terminal.java
2981 */
2982message SeOmapiReported {
2983 enum Operation {
2984 UNKNOWN = 0;
2985 OPEN_CHANNEL = 1;
2986 }
2987 optional Operation operation = 1;
2988 // SIMx or eSEx.
2989 optional string terminal = 2;
2990
2991 optional string package_name = 3;
2992}
Hui Yuf57e4012019-02-13 12:29:38 -08002993
2994/*
2995* Logs number of milliseconds it takes to start a process.
2996* The definition of app process start time is from the app launch time to
2997* the time that Zygote finished forking the app process and loaded the
2998* application package's java classes.
2999
3000* This metric is different from AppStartOccurred which is for foreground
3001* activity only.
3002
3003* ProcessStartTime can report all processes (both foreground and background)
3004* start time.
3005*
3006* Logged from:
3007* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3008*/
3009message ProcessStartTime {
3010 // The uid of the ProcessRecord.
3011 optional int32 uid = 1 [(is_uid) = true];
3012
3013 // The process pid.
3014 optional int32 pid = 2;
3015
3016 // The process name.
3017 // Usually package name, "system" for system server.
3018 // Provided by ActivityManagerService.
3019 optional string process_name = 3;
3020
3021 enum StartType {
3022 UNKNOWN = 0;
3023 WARM = 1;
3024 HOT = 2;
3025 COLD = 3;
3026 }
3027
3028 // The start type.
3029 optional StartType type = 4;
3030
3031 // The elapsed realtime at the start of the process.
3032 optional int64 process_start_time_millis = 5;
3033
3034 // Number of milliseconds it takes to reach bind application.
3035 optional int32 bind_application_delay_millis = 6;
3036
3037 // Number of milliseconds it takes to finish start of the process.
3038 optional int32 process_start_delay_millis = 7;
3039
3040 // hostingType field in ProcessRecord, the component type such as "activity",
3041 // "service", "content provider", "broadcast" or other strings.
3042 optional string hosting_type = 8;
3043
3044 // hostingNameStr field in ProcessRecord. The component class name that runs
3045 // in this process.
3046 optional string hosting_name = 9;
3047}
3048