blob: 5fd148e5d5afb1955446dc79e5965edecd790882 [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;
lifr35a7cf02018-12-12 16:38:04 +0800134 NetworkDnsEventReported network_dns_event_reported = 116;
Chiachang Wang67f24472019-01-15 15:14:00 +0800135 DataStallEvent data_stall_event = 121;
Jack He52260142018-12-18 15:43:27 -0800136 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack He22e4a1d2019-01-09 01:19:13 -0800137 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
138 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Jack Yu6d421bc2019-01-23 17:42:54 +0800139 NfcErrorOccurred nfc_error_occurred = 134;
140 NfcStateChanged nfc_state_changed = 135;
141 NfcBeamOccurred nfc_beam_occurred = 136;
142 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
143 NfcTagOccurred nfc_tag_occurred = 138;
144 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
145 SeStateChanged se_state_changed = 140;
146 SeOmapiReported se_omapi_reported = 141;
Jack He924f3462019-01-09 20:54:41 -0800147 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
148 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
149 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
150 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
151 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
152 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
153 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
154 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
155 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He4d6abe62019-01-20 21:22:46 -0800156 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
157 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
158 BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162;
159 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
160 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
161 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
162 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
163 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Yao Chend54f9dd2017-10-17 17:37:48 +0000164 }
David Chenc8a43242017-10-17 16:23:28 -0700165
David Chen6e3e6cb2018-01-03 16:14:06 -0800166 // Pulled events will start at field 10000.
Tej Singh40298312018-02-16 00:15:09 -0800167 // Next: 10022
David Chenc8a43242017-10-17 16:23:28 -0700168 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800169 WifiBytesTransfer wifi_bytes_transfer = 10000;
170 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
171 MobileBytesTransfer mobile_bytes_transfer = 10002;
172 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800173 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800174 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800175 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800176 CpuTimePerFreq cpu_time_per_freq = 10008;
177 CpuTimePerUid cpu_time_per_uid = 10009;
178 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800179 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800180 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800181 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800182 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800183 SystemElapsedRealtime system_elapsed_realtime = 10014;
184 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800185 CpuActiveTime cpu_active_time = 10016;
186 CpuClusterTime cpu_cluster_time = 10017;
Chenjie Yu937d7422018-01-10 16:37:53 -0800187 DiskSpace disk_space = 10018;
Tej Singhbf972d92018-01-10 20:51:13 -0800188 RemainingBatteryCapacity remaining_battery_capacity = 10019;
189 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800190 Temperature temperature = 10021;
David Chenc8a43242017-10-17 16:23:28 -0700191 }
yroa1fe77c2018-02-26 14:22:54 -0800192
Bookatz76aafcf2018-09-17 16:17:10 -0700193 // DO NOT USE field numbers above 100,000 in AOSP.
194 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
195 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700196}
197
Yao Chend54f9dd2017-10-17 17:37:48 +0000198/**
Yangster-mac20877162017-12-22 17:19:39 -0800199 * This proto represents a node of an attribution chain.
200 * Note: All attribution chains are represented as a repeated field of type
201 * AttributionNode. It is understood that in such arrays, the order is that
202 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000203 */
Yangster-mac20877162017-12-22 17:19:39 -0800204message AttributionNode {
205 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800206 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800207
Yangster-mac20877162017-12-22 17:19:39 -0800208 // The (optional) string tag for an element in the attribution chain. If the
209 // element has no tag, it is encoded as an empty string.
210 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700211}
212
Yao Chend54f9dd2017-10-17 17:37:48 +0000213/*
214 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800215 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000216 *
217 * RULES:
218 * - The field ids for each atom must start at 1, and count upwards by 1.
219 * Skipping field ids is not allowed.
220 * - These form an API, so renaming, renumbering or removing fields is
221 * not allowed between android releases. (This is not currently enforced,
222 * but there will be a tool to enforce this restriction).
223 * - The types must be built-in protocol buffer types, namely, no sub-messages
224 * are allowed (yet). The bytes type is also not allowed.
225 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800226 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000227 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800228 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000229 * - A field that is a uid should be a string field, tagged with the [xxx]
230 * annotation. The generated code on android will be represented by UIDs,
231 * and those UIDs will be translated in xxx to those strings.
232 *
233 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700234 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000235 * - If there is a UID, it goes first. Think in an object-oriented fashion.
236 * *****************************************************************************
237 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700238
Yao Chend54f9dd2017-10-17 17:37:48 +0000239/**
240 * Logs when the screen state changes.
241 *
242 * Logged from:
243 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
244 */
245message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800246 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800247 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700248}
Yao Chend54f9dd2017-10-17 17:37:48 +0000249
250/**
Bookatzc1a050a2017-10-10 15:49:28 -0700251 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000252 *
253 * Logged from:
254 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
255 */
Bookatzc1a050a2017-10-10 15:49:28 -0700256message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700257 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000258
Bookatzdb026a22018-01-10 19:01:56 -0800259 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800260 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000261}
262
263/**
Bookatzc1a050a2017-10-10 15:49:28 -0700264 * Logs that a process started, finished, crashed, or ANRed.
265 *
266 * Logged from:
267 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
268 */
269message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700270 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700271
David Chen0b5c90c2018-01-25 16:51:49 -0800272 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800273 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700274
Bookatzddccf0a2017-11-28 16:48:14 -0800275 // What lifecycle state the process changed to.
276 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800277 enum State {
278 FINISHED = 0;
279 STARTED = 1;
280 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800281 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800282 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700283}
284
Bookatzc1a050a2017-10-10 15:49:28 -0700285/**
286 * Logs when the ble scan state changes.
287 *
288 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700289 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700290 */
291message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800292 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700293
294 enum State {
295 OFF = 0;
296 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700297 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
298 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700299 }
300 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700301
Bookatze5ec0b42018-03-26 13:34:56 -0700302 // Does the scan have a filter.
303 optional bool is_filtered = 3;
304 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
305 optional bool is_first_match = 4;
306 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
307 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700308}
309
310/**
311 * Logs reporting of a ble scan finding results.
312 *
313 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700314 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700315 */
Bookatzae6738e2018-09-13 11:38:56 -0700316// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700317message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800318 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700319
320 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800321 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700322}
323
324/**
325 * Logs when a sensor state changes.
326 *
327 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700328 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700329 */
330message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800331 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700332
Bookatzc1a050a2017-10-10 15:49:28 -0700333 // The id (int) of the sensor.
334 optional int32 sensor_id = 2;
335
336 enum State {
337 OFF = 0;
338 ON = 1;
339 }
340 optional State state = 3;
341}
342
343
344/**
345 * Logs when GPS state changes.
346 *
347 * Logged from:
348 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
349 */
350message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800351 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700352
353 enum State {
354 OFF = 0;
355 ON = 1;
356 }
357 optional State state = 2;
358}
359
360
361/**
362 * Logs when a sync manager sync state changes.
363 *
364 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700365 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700366 */
367message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800368 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700369
David Chen0b5c90c2018-01-25 16:51:49 -0800370 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800371 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700372
373 enum State {
374 OFF = 0;
375 ON = 1;
376 }
377 optional State state = 3;
378}
379
380/**
381 * Logs when a job scheduler job state changes.
382 *
383 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700384 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700385 */
386message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800387 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700388
389 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800390 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700391
392 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800393 FINISHED = 0;
394 STARTED = 1;
395 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700396 }
397 optional State state = 3;
398
Tej Singh33a412b2018-03-16 18:43:59 -0700399 // The reason a job has stopped.
400 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700401 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700402 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700403}
404
405/**
406 * Logs when the audio state changes.
407 *
408 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700409 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700410 */
411message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800412 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700413
414 enum State {
415 OFF = 0;
416 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700417 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
418 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700419 }
420 optional State state = 2;
421}
422
423/**
424 * Logs when the video codec state changes.
425 *
426 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700427 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700428 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800429message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800430 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700431
432 enum State {
433 OFF = 0;
434 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700435 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
436 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700437 }
438 optional State state = 2;
439}
440
441/**
442 * Logs when the flashlight state changes.
443 *
444 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700445 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700446 */
447message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800448 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700449
450 enum State {
451 OFF = 0;
452 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700453 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
454 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700455 }
456 optional State state = 2;
457}
458
459/**
460 * Logs when the camera state changes.
461 *
462 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700463 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700464 */
465message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800466 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700467
468 enum State {
469 OFF = 0;
470 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700471 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
472 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700473 }
474 optional State state = 2;
475}
476
477/**
478 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000479 *
480 * Logged from:
481 * TODO
482 */
Bookatzd6746242017-10-24 18:39:35 -0700483message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800484 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000485
Bookatz1a1b0462018-01-12 11:47:03 -0800486 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
487 // From frameworks/base/core/proto/android/os/enums.proto.
488 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700489
490 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
491 optional string tag = 3;
492
493 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800494 RELEASE = 0;
495 ACQUIRE = 1;
496 CHANGE_RELEASE = 2;
497 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700498 }
499 optional State state = 4;
500}
501
502/**
Bookatzc1a050a2017-10-10 15:49:28 -0700503 * Logs when a partial wakelock is considered 'long' (over 1 min).
504 *
505 * Logged from:
506 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
507 */
508message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800509 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700510
Yao Chend54f9dd2017-10-17 17:37:48 +0000511 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
512 optional string tag = 2;
513
Bookatzc1a050a2017-10-10 15:49:28 -0700514 // TODO: I have no idea what this is.
515 optional string history_tag = 3;
516
517 enum State {
518 OFF = 0;
519 ON = 1;
520 }
521 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000522}
523
Bookatzc1a050a2017-10-10 15:49:28 -0700524/**
525 * Logs Battery Saver state change.
526 *
527 * Logged from:
528 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
529 */
530message BatterySaverModeStateChanged {
531 enum State {
532 OFF = 0;
533 ON = 1;
534 }
535 optional State state = 1;
536}
537
538/**
539 * Logs Doze mode state change.
540 *
541 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800542 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700543 */
544message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800545 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800546}
547
548
549/**
550 * Logs state change of Doze mode including maintenance windows.
551 *
552 * Logged from:
553 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
554 */
555message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800556 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700557}
558
559/**
560 * Logs screen brightness level.
561 *
562 * Logged from:
563 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
564 */
565message ScreenBrightnessChanged {
566 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
567 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700568}
569
570/**
571 * Logs battery level (percent full, from 0 to 100).
572 *
573 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700574 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700575 */
576message BatteryLevelChanged {
577 // Battery level. Should be in [0, 100].
578 optional int32 battery_level = 1;
579}
580
581/**
582 * Logs change in charging status of the device.
583 *
584 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700585 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700586 */
587message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800588 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
589 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700590}
591
592/**
593 * Logs whether the device is plugged in, and what power source it is using.
594 *
595 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700596 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700597 */
598message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800599 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
600 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700601}
602
Bookatz8c6571b2017-10-24 15:04:41 -0700603/**
604 * Logs when an app's wakeup alarm fires.
605 *
606 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700607 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700608 */
609message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800610 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800611
612 // Name of the wakeup alarm.
613 optional string tag = 2;
614}
615
616/**
617 * Logs when an an app causes the mobile radio to change state.
618 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
619 *
620 * Logged from:
621 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
622 */
623message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800624 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800625
Bookatz1a1b0462018-01-12 11:47:03 -0800626 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
627 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800628}
629
630/**
631 * Logs when an an app causes the wifi radio to change state.
632 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
633 *
634 * Logged from:
635 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
636 */
637message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800638 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800639
Bookatz1a1b0462018-01-12 11:47:03 -0800640 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
641 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700642}
643
644/**
645 * Logs kernel wakeup reasons and aborts.
646 *
647 * Logged from:
648 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
649 */
650message KernelWakeupReported {
651 // Name of the kernel wakeup reason (or abort).
652 optional string wakeup_reason_name = 1;
653
654 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800655 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700656}
657
658/**
659 * Logs wifi locks held by an app.
660 *
661 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700662 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700663 */
664message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800665 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700666
667 enum State {
668 OFF = 0;
669 ON = 1;
670 }
671 optional State state = 2;
672}
673
674/**
675 * Logs wifi signal strength changes.
676 *
677 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700678 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700679 */
680message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800681 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
682 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700683}
684
685/**
686 * Logs wifi scans performed by an app.
687 *
688 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700689 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700690 */
691message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800692 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700693
694 enum State {
695 OFF = 0;
696 ON = 1;
697 }
698 optional State state = 2;
699}
700
701/**
Tej Singh4503e102018-01-04 14:35:01 -0800702 * Logs wifi multicast locks held by an app
703 *
704 * Logged from:
705 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
706 */
707message WifiMulticastLockStateChanged {
708 repeated AttributionNode attribution_node = 1;
709
710 enum State {
711 OFF = 0;
712 ON = 1;
713 }
714 optional State state = 2;
715}
716
717/**
Tej Singh1ea42892018-01-19 09:27:00 -0800718 * Logs shutdown reason and duration on next boot.
719 *
720 * Logged from:
721 * frameworks/base/core/java/com/android/server/BootReceiver.java
722 */
723message ShutdownSequenceReported {
724 // True if shutdown is for a reboot. Default: false if we do not know.
725 optional bool reboot = 1;
726
727 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
728 optional string reason = 2;
729
730 // Beginning of shutdown time in ms using wall clock time since unix epoch.
731 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800732 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800733
734 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800735 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800736}
737
Tej Singh6483ea42018-01-25 17:45:49 -0800738
739/**
740 * Logs boot reason and duration.
741 *
742 * Logged from:
743 * system/core/bootstat/bootstat.cpp
744 */
745message BootSequenceReported {
746 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
747 // Default: "<EMPTY>" if not available.
748 optional string bootloader_reason = 1;
749
750 // Reason for system boot. Eg. bootloader, reboot,userrequested
751 // Default: "<EMPTY>" if not available.
752 optional string system_reason = 2;
753
754 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800755 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800756
757 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800758 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800759
760 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800761 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800762
763 // Time since last boot in ms. Default: 0 if not available.
764 optional int64 time_since_last_boot = 6;
765}
766
Tej Singhc477d9c2018-02-05 18:31:39 -0800767
768/**
769 * Logs call state and disconnect cause (if applicable).
770 *
771 * Logged from:
772 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
773 */
774message CallStateChanged {
775 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
776 // From frameworks/base/core/proto/android/telecomm/enums.proto.
777 optional android.telecom.CallStateEnum call_state = 1;
778
779 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
780 // This value is only applicable when the call_state is DISCONNECTED, and
781 // should always be UNKNOWN if the call_state is not DISCONNECTED.
782 // From frameworks/base/core/proto/android/telecomm/enums.proto.
783 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
784
785 // True if the call is self-managed, which are apps that use the
786 // telecom infrastructure to make their own calls.
787 optional bool self_managed = 3;
788
789 // True if call is external. External calls are calls on connected Wear
790 // devices but show up in Telecom so the user can pull them onto the device.
791 optional bool external_call = 4;
792}
793
Tej Singh1ea42892018-01-19 09:27:00 -0800794/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800795 * Logs keyguard state. The keyguard is the lock screen.
796 *
797 * Logged from:
798 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
799 */
800message KeyguardStateChanged {
801 enum State {
802 UNKNOWN = 0;
803 // The keyguard is hidden when the phone is unlocked.
804 HIDDEN = 1;
805 // The keyguard is shown when the phone is locked (screen turns off).
806 SHOWN= 2;
807 // The keyguard is occluded when something is overlaying the keyguard.
808 // Eg. Opening the camera while on the lock screen.
809 OCCLUDED = 3;
810 }
811 optional State state = 1;
812}
813
814/**
815 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
816 * prompts the user to enter a password (pattern, pin, etc).
817 *
818 * Logged from:
819 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
820 */
821
822message KeyguardBouncerStateChanged {
823 enum State {
824 UNKNOWN = 0;
825 // Bouncer is hidden, either as a result of successfully entering the
826 // password, screen timing out, or user going back to lock screen.
827 HIDDEN = 1;
828 // This is when the user is being prompted to enter the password.
829 SHOWN = 2;
830 }
831 optional State state = 1;
832}
833
834/**
835 * Logs the result of entering a password into the keyguard bouncer.
836 *
837 * Logged from:
838 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
839 */
840message KeyguardBouncerPasswordEntered {
841 enum BouncerResult {
842 UNKNOWN = 0;
843 // The password entered was incorrect.
844 FAILURE = 1;
845 // The password entered was correct.
846 SUCCESS = 2;
847 }
848 optional BouncerResult result = 1;
849}
850
Tej Singha883b372018-02-15 11:30:01 -0800851/*
852 * Logs changes to the configuration of the device. The configuration is defined
853 * in frameworks/base/core/java/android/content/res/Configuration.java
854 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
855 * Please go there to interpret the possible values each field can be.
856 *
857 * Logged from:
858 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
859 */
860message ResourceConfigurationChanged {
861 // Bit mask of color capabilities of the screen.
862 // Contains information about the color gamut and hdr mode of the screen.
863 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
864 optional int32 colorMode = 1;
865
866 // The target screen density being rendered to.
867 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
868 optional int32 densityDpi = 2;
869
870 // Current user preference for the scaling factor for fonts,
871 // relative to the base density scaling.
872 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
873 optional float fontScale = 3;
874
875 // Flag indicating whether the hard keyboard is hidden.
876 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
877 optional int32 hardKeyboardHidden = 4;
878
879 // The type of keyboard attached to the device.
880 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
881 optional int32 keyboard = 5;
882
883 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
884 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
885 optional int32 keyboardHideen = 6;
886
887 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
888 // 0 if undefined.
889 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
890 optional int32 mcc = 7;
891
892 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
893 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
894 // MNC_ZERO symbol defined in Configuration.java.
895 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
896 optional int32 mnc = 8;
897
898 // The kind of navigation available on the device.
899 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
900 optional int32 navigation = 9;
901
902 // Flag indicating whether the navigation is available.
903 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
904 optional int32 navigationHidden = 10;
905
906 // Overall orientation of the screen.
907 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
908 optional int32 orientation = 11;
909
910 // The current height of the available screen space, in dp units.
911 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
912 optional int32 screenHeightDp = 12;
913
914 // Bit mask of overall layout of the screen.
915 // Contains information about screen size, whether the screen is wider/taller
916 // than normal, whether the screen layout is right-tl-left or left-to-right,
917 // and whether the screen has a rounded shape.
918 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
919 optional int32 screenLayout = 13;
920
921 // Current width of the available screen space, in dp units.
922 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
923 optional int32 screenWidthDp = 14;
924
925 // The smallest screen size an application will see in normal operation.
926 // This is the smallest value of both screenWidthDp and screenHeightDp
927 // in portrait and landscape.
928 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
929 optional int32 smallestScreenWidthDp = 15;
930
931 // The type of touch screen attached to the device.
932 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
933 optional int32 touchscreen = 16;
934
935 // Bit mask of the ui mode.
936 // Contains information about the overall ui mode of the device.
937 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
938 // Also contains information about whether the device is in night mode.
939 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
940 optional int32 uiMode = 17;
941}
942
Tej Singheee317b2018-03-07 19:28:05 -0800943
944/**
945 * Logs changes in the connection state of the mobile radio.
946 *
947 * Logged from:
948 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
949 */
950message MobileConnectionStateChanged {
951 // States are from the state machine DataConnection.java.
952 enum State {
953 UNKNOWN = 0;
954 // The connection is inactive, or disconnected.
955 INACTIVE = 1;
956 // The connection is being activated, or connecting.
957 ACTIVATING = 2;
958 // The connection is active, or connected.
959 ACTIVE = 3;
960 // The connection is disconnecting.
961 DISCONNECTING = 4;
962 // The connection is disconnecting after creating a connection.
963 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
964 }
965 optional State state = 1;
966 // For multi-sim phones, this distinguishes between the sim cards.
967 optional int32 sim_slot_index = 2;
968 // Used to identify the connection. Starts at 0 and increments by 1 for
969 // every new network created. Resets whenever the device reboots.
970 optional int32 data_connection_id = 3;
971 // A bitmask for the capabilities of this connection.
972 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
973 // Default value (if we have no information): 0
974 optional int64 capabilities = 4;
975 // If this connection has internet.
976 // This just checks if the DEFAULT bit of capabilities is set.
977 optional bool has_internet = 5;
978}
979
980/**
981 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
982 *
983 * Logged from:
984 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
985 */
986message MobileRadioTechnologyChanged {
987 optional android.telephony.NetworkTypeEnum state = 1;
988 // For multi-sim phones, this distinguishes between the sim cards.
989 optional int32 sim_slot_index = 2;
990}
991
Andrew Chantb56388b2018-03-22 21:07:33 -0700992/**
993 * Logs the VID and PID of any connected USB devices.
994 *
995 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
996 *
997 * Logged by Vendor.
998 */
999message UsbDeviceAttached {
1000 optional int32 vid = 1;
1001 optional int32 pid = 2;
1002 optional bool has_audio = 3;
1003 optional bool has_hid = 4;
1004 optional bool has_storage = 5;
1005}
1006
Tej Singheee317b2018-03-07 19:28:05 -08001007
Tej Singhdd7bd352018-02-09 19:33:15 -08001008/**
Tej Singh5d991e12018-03-09 19:48:11 -08001009 * Logs when Bluetooth is enabled and disabled.
1010 *
1011 * Logged from:
1012 * services/core/java/com/android/server/BluetoothManagerService.java
1013 */
1014message BluetoothEnabledStateChanged {
1015 repeated AttributionNode attribution_node = 1;
1016 // Whether or not bluetooth is enabled on the device.
1017 enum State {
1018 UNKNOWN = 0;
1019 ENABLED = 1;
1020 DISABLED = 2;
1021 }
1022 optional State state = 2;
1023 // The reason for being enabled/disabled.
1024 // Eg. Airplane mode, crash, application request.
1025 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1026 // If the reason is an application request, this will be the package name.
1027 optional string pkgName = 4;
1028}
1029
1030/**
Jack He22e4a1d2019-01-09 01:19:13 -08001031 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001032 *
1033 * Logged from:
Jack He22e4a1d2019-01-09 01:19:13 -08001034 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1035 *
1036 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001037 */
1038message BluetoothConnectionStateChanged {
1039 // The state of the connection.
1040 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1041 optional android.bluetooth.ConnectionStateEnum state = 1;
1042 // An identifier that can be used to match connect and disconnect events.
1043 // Currently is last two bytes of a hash of a device level ID and
1044 // the mac address of the bluetooth device that is connected.
Jack He22e4a1d2019-01-09 01:19:13 -08001045 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1046 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001047 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1048 // From android.bluetooth.BluetoothAdapter.java
Jack He22e4a1d2019-01-09 01:19:13 -08001049 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001050 optional int32 bt_profile = 3;
Jack He22e4a1d2019-01-09 01:19:13 -08001051 // An identifier that can be used to match events for this device.
1052 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1053 // Salt: Randomly generated 256 bit value
1054 // Hash algorithm: HMAC-SHA256
1055 // Size: 32 byte
1056 // Default: null or empty if the device identifier is not known
1057 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1058}
1059
1060/**
1061 * Logs when a Bluetooth device connects and disconnects over ACL
1062 *
1063 * Logged from:
1064 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1065 *
1066 * Next Tag: 3
1067 */
1068message BluetoothAclConnectionStateChanged {
1069 // An identifier that can be used to match events for this device.
1070 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1071 // Salt: Randomly generated 256 bit value
1072 // Hash algorithm: HMAC-SHA256
1073 // Size: 32 byte
1074 // Default: null or empty if the device identifier is not known
1075 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1076 // The state of the connection.
1077 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1078 optional android.bluetooth.ConnectionStateEnum state = 2;
1079}
1080
1081/**
1082 * Logs when a Bluetooth device connects and disconnects over SCO
1083 *
1084 * Logged from:
1085 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1086 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1087 *
1088 * Next Tag: 4
1089 */
1090message BluetoothScoConnectionStateChanged {
1091 // An identifier that can be used to match events for this device.
1092 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1093 // Salt: Randomly generated 256 bit value
1094 // Hash algorithm: HMAC-SHA256
1095 // Size: 32 byte
1096 // Default: null or empty if the device identifier is not known
1097 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1098 // The state of the connection.
1099 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1100 optional android.bluetooth.ConnectionStateEnum state = 2;
1101 // Codec used for this SCO connection
1102 // Default: UNKNOWN
1103 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001104}
1105
Jack He924f3462019-01-09 20:54:41 -08001106/**
1107 * Logged when active device of a profile changes
1108 *
1109 * Logged from:
1110 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1111 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1112 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1113 */
1114message BluetoothActiveDeviceChanged {
1115 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1116 // From android.bluetooth.BluetoothProfile
1117 optional int32 bt_profile = 1;
1118 // An identifier that can be used to match events for this new active device.
1119 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1120 // Salt: Randomly generated 256 bit value
1121 // Hash algorithm: HMAC-SHA256
1122 // Size: 32 byte
1123 // Default: null or empty if there is no active device for this profile
1124 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1125}
1126
Jack He52260142018-12-18 15:43:27 -08001127// Logs when there is an event affecting Bluetooth device's link layer connection.
1128// - This event is triggered when there is a related HCI command or event
1129// - Users of this metrics can deduce Bluetooth device's connection state from these events
1130// - HCI commands are logged before the command is sent, after receiving command status, and after
1131// receiving command complete
1132// - HCI events are logged when they arrive
1133//
1134// Low level log from system/bt
1135//
1136// Bluetooth classic commands:
1137// - CMD_CREATE_CONNECTION
1138// - CMD_DISCONNECT
1139// - CMD_CREATE_CONNECTION_CANCEL
1140// - CMD_ACCEPT_CONNECTION_REQUEST
1141// - CMD_REJECT_CONNECTION_REQUEST
1142// - CMD_SETUP_ESCO_CONNECTION
1143// - CMD_ACCEPT_ESCO_CONNECTION
1144// - CMD_REJECT_ESCO_CONNECTION
1145// - CMD_ENH_SETUP_ESCO_CONNECTION
1146// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1147//
1148// Bluetooth low energy commands:
1149// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1150// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1151// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1152// - CMD_BLE_CLEAR_WHITE_LIST
1153// - CMD_BLE_ADD_WHITE_LIST
1154// - CMD_BLE_REMOVE_WHITE_LIST
1155//
1156// Bluetooth classic events:
1157// - EVT_CONNECTION_COMP
1158// - EVT_CONNECTION_REQUEST
1159// - EVT_DISCONNECTION_COMP
1160// - EVT_ESCO_CONNECTION_COMP
1161// - EVT_ESCO_CONNECTION_CHANGED
1162//
1163// Bluetooth low energy meta events:
1164// - BLE_EVT_CONN_COMPLETE_EVT
1165// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1166//
1167// Next tag: 10
1168message BluetoothLinkLayerConnectionEvent {
1169 // An identifier that can be used to match events for this device.
1170 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1171 // Salt: Randomly generated 256 bit value
1172 // Hash algorithm: HMAC-SHA256
1173 // Size: 32 byte
1174 // Default: null or empty if the device identifier is not known
1175 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1176 // Connection handle of this connection if available
1177 // Range: 0x0000 - 0x0EFF (12 bits)
1178 // Default: 0xFFFF if the handle is unknown
1179 optional int32 connection_handle = 2;
1180 // Direction of the link
1181 // Default: DIRECTION_UNKNOWN
1182 optional android.bluetooth.DirectionEnum direction = 3;
1183 // Type of this link
1184 // Default: LINK_TYPE_UNKNOWN
1185 optional android.bluetooth.LinkTypeEnum type = 4;
1186
1187 // Reason metadata for this link layer connection event, rules for interpretation:
1188 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1189 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1190 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1191 // set and valid, ignore hci_ble_event
1192
1193 // HCI command associated with this event
1194 // Default: CMD_UNKNOWN
1195 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1196 // HCI event associated with this event
1197 // Default: EVT_UNKNOWN
1198 optional android.bluetooth.hci.EventEnum hci_event = 6;
1199 // HCI BLE meta event associated with this event
1200 // Default: BLE_EVT_UNKNOWN
1201 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1202 // HCI command status code if this is triggerred by hci_cmd
1203 // Default: STATUS_UNKNOWN
1204 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1205 // HCI reason code associated with this event
1206 // Default: STATUS_UNKNOWN
1207 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1208}
1209
Jack He924f3462019-01-09 20:54:41 -08001210/**
1211 * Logs when there is a change in Bluetooth A2DP playback state
1212 *
1213 * Logged from:
1214 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1215 */
1216message BluetoothA2dpPlaybackStateChanged {
1217 // An identifier that can be used to match events for this device.
1218 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1219 // Salt: Randomly generated 256 bit value
1220 // Hash algorithm: HMAC-SHA256
1221 // Size: 32 byte
1222 // Default: null or empty if the device identifier is not known
1223 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1224 // Current playback state
1225 // Default: PLAYBACK_STATE_UNKNOWN
1226 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1227 // Current audio coding mode
1228 // Default: AUDIO_CODING_MODE_UNKNOWN
1229 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1230}
1231
1232/**
1233 * Logs when there is a change in A2DP codec config for a particular remote device
1234 *
1235 * Logged from:
1236 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1237 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1238 */
1239message BluetoothA2dpCodecConfigChanged {
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 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1248 // Default SOURCE_CODEC_TYPE_INVALID
1249 optional int32 codec_type = 2;
1250 // Codec priroity, the higher the more preferred, -1 for disabled
1251 // Default: CODEC_PRIORITY_DEFAULT
1252 optional int32 codec_priority = 3;
1253 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1254 // Default: SAMPLE_RATE_NONE
1255 optional int32 sample_rate = 4;
1256 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1257 // Default: BITS_PER_SAMPLE_NONE
1258 optional int32 bits_per_sample = 5;
1259 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1260 // Default: CHANNEL_MODE_NONE
1261 optional int32 channel_mode = 6;
1262 // Codec specific values
1263 // Default 0
1264 optional int64 codec_specific_1 = 7;
1265 optional int64 codec_specific_2 = 8;
1266 optional int64 codec_specific_3 = 9;
1267 optional int64 codec_specific_4 = 10;
1268}
1269
1270/**
1271 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1272 * Each codec's capability is logged separately due to statsd restriction
1273 *
1274 * Logged from:
1275 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1276 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1277 */
1278message BluetoothA2dpCodecCapabilityChanged {
1279 // An identifier that can be used to match events for this device.
1280 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1281 // Salt: Randomly generated 256 bit value
1282 // Hash algorithm: HMAC-SHA256
1283 // Size: 32 byte
1284 // Default: null or empty if the device identifier is not known
1285 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1286 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1287 // Default SOURCE_CODEC_TYPE_INVALID
1288 optional int32 codec_type = 2;
1289 // Codec priroity, the higher the more preferred, -1 for disabled
1290 // Default: CODEC_PRIORITY_DEFAULT
1291 optional int32 codec_priority = 3;
1292 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1293 // in BluetoothCodecConfig
1294 // Default: empty and SAMPLE_RATE_NONE for individual item
1295 optional int32 sample_rate = 4;
1296 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1297 // in BluetoothCodecConfig
1298 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1299 optional int32 bits_per_sample = 5;
1300 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1301 // BluetoothCodecConfig
1302 // Default: empty and CHANNEL_MODE_NONE for individual item
1303 optional int32 channel_mode = 6;
1304 // Codec specific values
1305 // Default 0
1306 optional int64 codec_specific_1 = 7;
1307 optional int64 codec_specific_2 = 8;
1308 optional int64 codec_specific_3 = 9;
1309 optional int64 codec_specific_4 = 10;
1310}
1311
1312/**
1313 * Logs when A2DP failed to read from PCM source.
1314 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1315 *
1316 * Logged from:
1317 * system/bt
1318 */
1319message BluetoothA2dpAudioUnderrunReported {
1320 // An identifier that can be used to match events for this device.
1321 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1322 // Salt: Randomly generated 256 bit value
1323 // Hash algorithm: HMAC-SHA256
1324 // Size: 32 byte
1325 // Default: null or empty if the device identifier is not known
1326 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1327 // Encoding interval in nanoseconds
1328 // Default: 0
1329 optional int64 encoding_interval_nanos = 2;
1330 // Number of bytes of PCM data that could not be read from the source
1331 // Default: 0
1332 optional int32 num_missing_pcm_bytes = 3;
1333}
1334
1335/**
1336 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1337 * buffer queue is full and we have to drop data
1338 *
1339 * Logged from:
1340 * system/bt
1341 */
1342message BluetoothA2dpAudioOverrunReported {
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 buffers dropped in this event
1354 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1355 // Default: 0
1356 optional int32 num_dropped_buffers = 3;
1357 // Number of encoded buffers dropped in this event
1358 // Default 0
1359 optional int32 num_dropped_encoded_frames = 4;
1360 // Number of encoded bytes dropped in this event
1361 // Default: 0
1362 optional int32 num_dropped_encoded_bytes = 5;
1363}
1364
1365/**
1366 * Logs when we receive reports regarding a device's RSSI value
1367 *
1368 * Logged from:
1369 * system/bt
1370 */
1371message BluetoothDeviceRssiReported {
1372 // An identifier that can be used to match events for this device.
1373 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1374 // Salt: Randomly generated 256 bit value
1375 // Hash algorithm: HMAC-SHA256
1376 // Size: 32 byte
1377 // Default: null or empty if the device identifier is not known
1378 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1379 // Connection handle of this connection if available
1380 // Range: 0x0000 - 0x0EFF (12 bits)
1381 // Default: 0xFFFF if the handle is unknown
1382 optional int32 connection_handle = 2;
1383 // HCI command status code if this is triggerred by hci_cmd
1384 // Default: STATUS_UNKNOWN
1385 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1386 // BR/EDR
1387 // Range: -128 ≤ N ≤ 127 (signed integer)
1388 // Units: dB
1389 // LE:
1390 // Range: -127 to 20, 127 (signed integer)
1391 // Units: dBm
1392 // Invalid when an out of range value is reported
1393 optional int32 rssi = 4;
1394}
1395
1396/**
1397 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1398 *
1399 * Logged from:
1400 * system/bt
1401 */
1402message BluetoothDeviceFailedContactCounterReported {
1403 // An identifier that can be used to match events for this device.
1404 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1405 // Salt: Randomly generated 256 bit value
1406 // Hash algorithm: HMAC-SHA256
1407 // Size: 32 byte
1408 // Default: null or empty if the device identifier is not known
1409 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1410 // Connection handle of this connection if available
1411 // Range: 0x0000 - 0x0EFF (12 bits)
1412 // Default: 0xFFFF if the handle is unknown
1413 optional int32 connection_handle = 2;
1414 // HCI command status code if this is triggerred by hci_cmd
1415 // Default: STATUS_UNKNOWN
1416 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1417 // Number of consecutive failed contacts for a connection corresponding to the Handle
1418 // Range: uint16_t, 0-0xFFFF
1419 // Default: 0xFFFFF
1420 optional int32 failed_contact_counter = 4;
1421}
1422
1423/**
1424 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1425 *
1426 * Logged from:
1427 * system/bt
1428 */
1429message BluetoothDeviceTxPowerLevelReported {
1430 // An identifier that can be used to match events for this device.
1431 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1432 // Salt: Randomly generated 256 bit value
1433 // Hash algorithm: HMAC-SHA256
1434 // Size: 32 byte
1435 // Default: null or empty if the device identifier is not known
1436 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1437 // Connection handle of this connection if available
1438 // Range: 0x0000 - 0x0EFF (12 bits)
1439 // Default: 0xFFFF if the handle is unknown
1440 optional int32 connection_handle = 2;
Jack He4d6abe62019-01-20 21:22:46 -08001441 // HCI command status code if this is triggered by hci_cmd
Jack He924f3462019-01-09 20:54:41 -08001442 // Default: STATUS_UNKNOWN
1443 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1444 // Range: -30 ≤ N ≤ 20
1445 // Units: dBm
1446 // Invalid when an out of range value is reported
1447 optional int32 transmit_power_level = 4;
1448}
Jack He52260142018-12-18 15:43:27 -08001449
Tej Singh5d991e12018-03-09 19:48:11 -08001450/**
Jack He4d6abe62019-01-20 21:22:46 -08001451 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1452 * receiving an HCI command from the host
1453 *
1454 * Logged from: system/bt
1455 */
1456message BluetoothHciTimeoutReported {
1457 // HCI command associated with this event
1458 // Default: CMD_UNKNOWN
1459 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1460}
1461
1462/**
1463 * Logs when we receive Bluetooth Link Quality Report event from the controller
1464 * See Android Bluetooth HCI specification for more details
1465 *
1466 * Note: all count and bytes field are counted since last event
1467 *
1468 * Logged from: system/bt
1469 */
1470message BluetoothQualityReportReported {
1471 // Quality report ID
1472 // Original type: uint8_t
1473 // Default: BQR_ID_UNKNOWN
1474 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1475 // Packet type of the connection
1476 // Original type: uint8_t
1477 // Default: BQR_PACKET_TYPE_UNKNOWN
1478 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1479 // Connection handle of the connection
1480 // Original type: uint16_t
1481 optional int32 connection_handle = 3;
1482 // Performing Role for the connection
1483 // Original type: uint8_t
1484 optional int32 connection_role = 4;
1485 // Current Transmit Power Level for the connection. This value is the same as the controller's
1486 // response to the HCI_Read_Transmit_Power_Level HCI command
1487 // Original type: uint8_t
1488 optional int32 tx_power_level = 5;
1489 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1490 // absolute receiver signal strength value
1491 // Original type: int8_t
1492 optional int32 rssi = 6;
1493 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1494 // channels used by the link currently
1495 // Original type: uint8_t
1496 optional int32 snr = 7;
1497 // Indicates the number of unused channels in AFH_channel_map
1498 // Original type: uint8_t
1499 optional int32 unused_afh_channel_count = 8;
1500 // Indicates the number of the channels which are interfered and quality is bad but are still
1501 // selected for AFH
1502 // Original type: uint8_t
1503 optional int32 afh_select_unideal_channel_count = 9;
1504 // Current Link Supervision Timeout Setting
1505 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1506 // Original type: uint16_t
1507 optional int32 lsto = 10;
1508 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1509 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1510 // 0x01 (Piconet Clock)
1511 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1512 // Original type: uint32_t
1513 optional int64 connection_piconet_clock = 11;
1514 // The count of retransmission
1515 // Original type: uint32_t
1516 optional int64 retransmission_count = 12;
1517 // The count of no RX
1518 // Original type: uint32_t
1519 optional int64 no_rx_count = 13;
1520 // The count of NAK (Negative Acknowledge)
1521 // Original type: uint32_t
1522 optional int64 nak_count = 14;
1523 // Controller timestamp of last TX ACK
1524 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1525 // Original type: uint32_t
1526 optional int64 last_tx_ack_timestamp = 15;
1527 // The count of Flow-off (STOP)
1528 // Original type: uint32_t
1529 optional int64 flow_off_count = 16;
1530 // Controller timestamp of last Flow-on (GO)
1531 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1532 // Original type: uint32_t
1533 optional int64 last_flow_on_timestamp = 17;
1534 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1535 // Original type: uint32_t
1536 optional int64 buffer_overflow_bytes = 18;
1537 // Buffer underflow count (in byte) since last event
1538 // Original type: uint32_t
1539 optional int64 buffer_underflow_bytes = 19;
1540}
1541
1542/**
1543 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1544 *
1545 * Notes:
1546 * - Each event can be partially filled as we might learn different pieces of device
1547 * information at different time
1548 * - Multiple device info events can be combined to give more complete picture
1549 * - When multiple device info events tries to describe the same information, the
1550 * later one wins
1551 *
1552 * Logged from:
1553 * packages/apps/Bluetooth
1554 */
1555message BluetoothManufacturerInfoReported {
1556 // An identifier that can be used to match events for this device.
1557 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1558 // Salt: Randomly generated 256 bit value
1559 // Hash algorithm: HMAC-SHA256
1560 // Size: 32 byte
1561 // Default: null or empty if the device identifier is not known
1562 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1563 // Where is this device info obtained from
1564 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1565 // Name of the data source
1566 // For EXTERNAL: package name of the data source
1567 // For INTERNAL: null for general case, component name otherwise
1568 optional string source_name = 3;
1569 // Name of the manufacturer of this device
1570 optional string manufacturer = 4;
1571 // Model of this device
1572 optional string model = 5;
1573 // Hardware version of this device
1574 optional string hardware_version = 6;
1575 // Software version of this device
1576 optional string software_version = 7;
1577}
1578
1579/**
1580 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1581 * device, as documented by the Bluetooth Core HCI specification
1582 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1583 * Vol 2, Part E, Page 1118
1584 *
1585 * Logged from:
1586 * system/bt
1587 */
1588message BluetoothRemoteVersionInfoReported {
1589 // Connection handle of the connection
1590 // Original type: uint16_t
1591 optional int32 connection_handle = 1;
1592 // HCI command status code
1593 // Default: STATUS_UNKNOWN
1594 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1595 // 1 byte Version of current LMP in the remote controller
1596 optional int32 lmp_version = 3;
1597 // 2 bytes LMP manufacturer code of the remote controller
1598 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1599 optional int32 lmp_manufacturer_code = 4;
1600 // 4 bytes subversion of the LMP in the remote controller
1601 optional int32 lmp_subversion = 5;
1602}
1603
1604/**
1605 * Logs when certain Bluetooth SDP attributes are discovered
1606 * Constant definitions are from:
1607 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1608 *
1609 * Current logged attributes:
1610 * - BluetoothProfileDescriptorList
1611 * - Supported Features Bitmask
1612 *
1613 * Logged from:
1614 * system/bt
1615 */
1616message BluetoothSdpAttributeReported {
1617 // An identifier that can be used to match events for this device.
1618 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1619 // Salt: Randomly generated 256 bit value
1620 // Hash algorithm: HMAC-SHA256
1621 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1622 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1623 // Original type: uint16_t
1624 optional int32 protocol_uuid = 2;
1625 // Short form UUIDs used to identify Bluetooth SDP attribute types
1626 // Original type: uint16_t
1627 optional int32 attribute_id = 3;
1628 // Attribute value for the particular attribute
1629 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1630}
1631
1632/**
1633 * Logs when bond state of a Bluetooth device changes
1634 *
1635 * Logged from:
1636 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1637 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1638 */
1639message BluetoothBondStateChanged {
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 // Size: 32 byte
1645 // Default: null or empty if the device identifier is not known
1646 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1647 // Preferred transport type to remote dual mode device
1648 // Default: TRANSPORT_AUTO means no preference
1649 optional android.bluetooth.TransportTypeEnum transport = 2;
1650 // The type of this Bluetooth device (Classic, LE, or Dual mode)
1651 // Default: UNKNOWN
1652 optional android.bluetooth.DeviceTypeEnum type = 3;
1653 // Current bond state (NONE, BONDING, BONDED)
1654 // Default: BOND_STATE_UNKNOWN
1655 optional android.bluetooth.BondStateEnum bond_state = 4;
1656 // Bonding sub state
1657 // Default: BOND_SUB_STATE_UNKNOWN
1658 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
1659 // Unbond Reason
1660 // Default: UNBOND_REASON_UNKNOWN
1661 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
1662}
1663
1664/**
1665 * Logs there is an event related Bluetooth classic pairing
1666 *
1667 * Logged from:
1668 * system/bt
1669 */
1670message BluetoothClassicPairingEventReported {
1671 // An identifier that can be used to match events for this device.
1672 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1673 // Salt: Randomly generated 256 bit value
1674 // Hash algorithm: HMAC-SHA256
1675 // Size: 32 byte
1676 // Default: null or empty if the device identifier is not known
1677 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1678 // Connection handle of this connection if available
1679 // Range: 0x0000 - 0x0EFF (12 bits)
1680 // Default: 0xFFFF if the handle is unknown
1681 optional int32 connection_handle = 2;
1682 // HCI command associated with this event
1683 // Default: CMD_UNKNOWN
1684 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
1685 // HCI event associated with this event
1686 // Default: EVT_UNKNOWN
1687 optional android.bluetooth.hci.EventEnum hci_event = 4;
1688 // HCI command status code if this is triggerred by hci_cmd
1689 // Default: STATUS_UNKNOWN
1690 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
1691 // HCI reason code associated with this event
1692 // Default: STATUS_UNKNOWN
1693 optional android.bluetooth.hci.StatusEnum reason_code = 6;
1694}
1695
1696/**
1697 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
1698 *
1699 * Logged from:
1700 * system/bt
1701 */
1702message BluetoothSmpPairingEventReported {
1703 // An identifier that can be used to match events for this device.
1704 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1705 // Salt: Randomly generated 256 bit value
1706 // Hash algorithm: HMAC-SHA256
1707 // Size: 32 byte
1708 // Default: null or empty if the device identifier is not known
1709 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1710 // SMP command sent or received over L2CAP
1711 // Default: CMD_UNKNOWN
1712 optional android.bluetooth.smp.CommandEnum smp_command = 2;
1713 // Whether this command is sent or received
1714 // Default: DIRECTION_UNKNOWN
1715 optional android.bluetooth.DirectionEnum direction = 3;
1716 // SMP failure reason code
1717 // Default: PAIRING_FAIL_REASON_DEFAULT
1718 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
1719}
1720
1721/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001722 * Logs when something is plugged into or removed from the USB-C connector.
1723 *
1724 * Logged from:
1725 * Vendor USB HAL.
1726 */
1727message UsbConnectorStateChanged {
1728 enum State {
1729 DISCONNECTED = 0;
1730 CONNECTED = 1;
1731 }
1732 optional State state = 1;
1733}
1734
1735/**
1736 * Logs the reported speaker impedance.
1737 *
1738 * Logged from:
1739 * Vendor audio implementation.
1740 */
1741message SpeakerImpedanceReported {
1742 optional int32 speaker_location = 1;
1743 optional int32 impedance = 2;
1744}
1745
1746/**
1747 * Logs the report of a failed hardware.
1748 *
1749 * Logged from:
1750 * Vendor HALs.
1751 *
1752 */
1753message HardwareFailed {
1754 enum HardwareType {
1755 HARDWARE_FAILED_UNKNOWN = 0;
1756 HARDWARE_FAILED_MICROPHONE = 1;
1757 HARDWARE_FAILED_CODEC = 2;
1758 HARDWARE_FAILED_SPEAKER = 3;
1759 HARDWARE_FAILED_FINGERPRINT = 4;
1760 }
1761 optional HardwareType hardware_type = 1;
1762
1763 /* hardware_location allows vendors to differentiate between multiple instances of
1764 * the same hardware_type. The specific locations are vendor defined integers,
1765 * referring to board-specific numbering schemes.
1766 */
1767 optional int32 hardware_location = 2;
1768
1769 /* failure_code is specific to the HardwareType of the failed hardware.
1770 * It should use the enum values defined below.
1771 */
1772 enum MicrophoneFailureCode {
1773 MICROPHONE_FAILURE_COMPLETE = 0;
1774 }
1775 enum CodecFailureCode {
1776 CODEC_FAILURE_COMPLETE = 0;
1777 }
1778 enum SpeakerFailureCode {
1779 SPEAKER_FAILURE_COMPLETE = 0;
1780 SPEAKER_FAILURE_HIGH_Z = 1;
1781 SPEAKER_FAILURE_SHORT = 2;
1782 }
1783 enum FingerprintFailureCode {
1784 FINGERPRINT_FAILURE_COMPLETE = 0;
1785 FINGERPRINT_SENSOR_BROKEN = 1;
1786 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1787 }
1788 optional int32 failure_code = 3;
1789}
1790
1791/**
1792 * Log an event when the device has been physically dropped.
1793 * Reported from the /vendor partition.
1794 */
1795message PhysicalDropDetected {
1796 // Confidence that the event was actually a drop, 0 -> 100
1797 optional int32 confidence_pctg = 1;
1798 // Peak acceleration of the drop, in 1/1000s of a g.
1799 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001800 // Duration of freefall in ms
1801 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001802}
1803
1804/**
1805 * Log bucketed battery charge cycles.
1806 *
1807 * Each bucket represents cycles of the battery past
1808 * a given charge point. For example, bucket 1 is the
1809 * lowest 1/8th of the battery, and bucket 8 is 100%.
1810 *
1811 * Logged from:
1812 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1813 */
1814message ChargeCyclesReported {
1815 optional int32 cycle_bucket_1 = 1;
1816 optional int32 cycle_bucket_2 = 2;
1817 optional int32 cycle_bucket_3 = 3;
1818 optional int32 cycle_bucket_4 = 4;
1819 optional int32 cycle_bucket_5 = 5;
1820 optional int32 cycle_bucket_6 = 6;
1821 optional int32 cycle_bucket_7 = 7;
1822 optional int32 cycle_bucket_8 = 8;
1823}
1824
1825/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001826 * Logs the duration of a davey (jank of >=700ms) when it occurs
1827 *
1828 * Logged from:
1829 * frameworks/base/libs/hwui/JankTracker.cpp
1830 */
1831message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001832 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001833 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001834
Tej Singhbb8554a2018-01-26 11:59:14 -08001835 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001836 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001837}
1838
1839/**
Bookatze5885242017-10-24 20:10:31 -07001840 * Logs phone signal strength changes.
1841 *
1842 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001843 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001844 */
1845message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001846 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1847 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001848}
1849
Yangster4ccebea2018-10-09 17:09:02 -07001850
1851/**
1852 * Logs when the phone state, sim state or signal strength changes
1853 *
1854 * Logged from:
1855 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1856 */
1857message PhoneServiceStateChanged {
1858 optional android.telephony.ServiceStateEnum state = 1;
1859 optional android.telephony.SimStateEnum sim_state = 2;
1860 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1861}
1862
1863/**
1864 * Logs when the phone becomes on or off.
1865 *
1866 * Logged from:
1867 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1868 */
1869message PhoneStateChanged {
1870 enum State {
1871 OFF = 0;
1872 ON = 1;
1873 }
1874 optional State state = 1;
1875}
1876
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001877message LauncherUIChanged {
Yao Chen046b5122018-10-24 14:09:20 -07001878 optional android.stats.launcher.LauncherAction action = 1;
1879 optional android.stats.launcher.LauncherState src_state = 2;
1880 optional android.stats.launcher.LauncherState dst_state = 3;
1881 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001882 optional bool is_swipe_up_enabled = 5;
1883}
1884
David Chenc28b2bb2017-10-24 12:52:52 -07001885/**
1886 * Logs that a setting was updated.
1887 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001888 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001889 * The tag and is_default allow resetting of settings to default values based on the specified
1890 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1891 */
1892message SettingChanged {
1893 // The name of the setting.
1894 optional string setting = 1;
1895
1896 // The change being imposed on this setting. May represent a number, eg "3".
1897 optional string value = 2;
1898
1899 // The new value of this setting. For most settings, this is same as value. For some settings,
1900 // value is +X or -X where X represents an element in a set. For example, if the previous value
1901 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1902 // The +/- feature is currently only used for location_providers_allowed.
1903 optional string new_value = 3;
1904
1905 // The previous value of this setting.
1906 optional string prev_value = 4;
1907
1908 // The tag used with the is_default for resetting sets of settings. This is generally null.
1909 optional string tag = 5;
1910
Bookatz90867622018-01-31 15:05:57 -08001911 // True if this setting with tag should be resettable.
1912 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001913
David Chenbd789912018-03-16 17:19:55 -07001914 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001915 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001916
1917 enum ChangeReason {
1918 UPDATED = 1; // Updated can be an insertion or an update.
1919 DELETED = 2;
1920 }
1921 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001922}
Chenjie Yub3dda412017-10-24 13:41:59 -07001923
Chenjie Yu05013b32017-11-21 10:21:41 -08001924/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001925 * Logs activity going to foreground or background
1926 *
1927 * Logged from:
1928 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1929 */
1930message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001931 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001932 optional string pkg_name = 2;
1933 optional string class_name = 3;
1934
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001935 enum State {
1936 BACKGROUND = 0;
1937 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001938 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001939 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001940}
David Chenc8a43242017-10-17 16:23:28 -07001941
1942/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001943 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001944 * Logged from:
1945 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1946 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001947message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001948 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001949
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001950 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001951
1952 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001953 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001954 optional string process_name = 3;
1955
1956 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001957 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001958
1959 optional string package_name = 5;
1960
1961 enum InstantApp {
1962 UNAVAILABLE = 0;
1963 FALSE = 1;
1964 TRUE = 2;
1965 }
1966 optional InstantApp is_instant_app = 6;
1967
1968 enum ForegroundState {
1969 UNKNOWN = 0;
1970 BACKGROUND = 1;
1971 FOREGROUND = 2;
1972 }
1973 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001974}
David Chen9e3808c2017-11-20 17:25:34 -08001975
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001976/**
1977 * Logs when a WTF (What a Terrible Failure) happened.
1978 * Logged from:
1979 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1980 */
1981message WTFOccurred {
1982 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001983
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001984 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001985
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001986 // The name of the process.
1987 // system_server if it is not by an app
1988 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001989
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001990 // The pid if available. -1 means not available.
1991 optional sint32 pid = 4;
1992}
1993
1994/**
1995 * Logs when system server reports low memory.
1996 * Logged from:
1997 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1998 */
1999message LowMemReported {
2000}
2001
2002/**
2003 * Logs when an app ANR (App Not Responding) occurs.
2004 * Logged from:
2005 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2006 */
2007message ANROccurred {
2008 optional int32 uid = 1 [(is_uid) = true];
2009
2010 optional string process_name = 2;
2011
2012 optional string short_component_name = 3;
2013
2014 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002015
2016 enum InstantApp {
2017 UNAVAILABLE = 0;
2018 FALSE = 1;
2019 TRUE = 2;
2020 }
2021 optional InstantApp is_instant_app = 5;
2022
2023 enum ForegroundState {
2024 UNKNOWN = 0;
2025 BACKGROUND = 1;
2026 FOREGROUND = 2;
2027 }
2028 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08002029}
2030
David Chen0a368b22017-12-06 16:28:16 -08002031/*
2032 * Allows other apps to push events into statsd.
2033 * Logged from:
2034 * frameworks/base/core/java/android/util/StatsLog.java
2035 */
David Chen0b5c90c2018-01-25 16:51:49 -08002036message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002037 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002038 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002039
2040 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2041 optional int32 label = 2;
2042
2043 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2044 // predicates for the metrics).
2045 enum State {
2046 UNKNOWN = 0;
2047 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2048 STOP = 2;
2049 START = 3;
2050 }
2051 optional State state = 3;
2052}
2053
David Chen9e3808c2017-11-20 17:25:34 -08002054/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002055 * Logs when statsd detects an anomaly.
2056 *
2057 * Logged from:
2058 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2059 */
2060message AnomalyDetected {
2061 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002062 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002063
Yangster-mac94e197c2018-01-02 16:03:03 -08002064 // Id of the config whose anomaly detection alert fired.
2065 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002066
Yangster-mac94e197c2018-01-02 16:03:03 -08002067 // Id of the alert (i.e. name of the anomaly that was detected).
2068 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002069}
2070
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002071message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002072 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002073 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002074
2075 // The app package name.
2076 optional string pkg_name = 2;
2077
2078 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002079 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002080 WARM = 1;
2081 HOT = 2;
2082 COLD = 3;
2083 }
2084 // The transition type.
2085 optional TransitionType type = 3;
2086
2087 // The activity name.
2088 optional string activity_name = 4;
2089
2090 // The name of the calling app. Empty if not set.
2091 optional string calling_pkg_name = 5;
2092
2093 // Whether the app is an instant app.
2094 optional bool is_instant_app = 6;
2095
2096 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002097 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002098
Bookatz80d11a02018-01-16 10:46:35 -08002099 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002100
David Chen0b5c90c2018-01-25 16:51:49 -08002101 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002102 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002103 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002104 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002105 optional int32 bind_application_delay_millis = 11;
2106 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002107
2108 // Empty if not set.
2109 optional string launch_token = 13;
2110
Calin Juravle759fbda2018-02-20 19:52:30 +00002111 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002112 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002113
2114 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002115 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002116}
2117
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002118message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002119 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002120 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002121
2122 // The app package name.
2123 optional string pkg_name = 2;
2124
2125 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002126 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002127 WARM = 1;
2128 HOT = 2;
2129 COLD = 3;
2130 }
2131 // The transition type.
2132 optional TransitionType type = 3;
2133
2134 // The activity name.
2135 optional string activity_name = 4;
2136}
2137
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002138message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002139 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002140 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002141
2142 // The app package name.
2143 optional string pkg_name = 2;
2144
2145 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002146 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002147 WITH_BUNDLE = 1;
2148 WITHOUT_BUNDLE = 2;
2149 }
2150 // The transition type.
2151 optional TransitionType type = 3;
2152
2153 // The activity name.
2154 optional string activity_name = 4;
2155
2156 optional bool transition_process_running = 5;
2157
2158 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002159 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002160}
2161
Bookatz8fcd09a2017-12-18 13:01:10 -08002162/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002163 * Logs a picture-in-picture action
2164 * Logged from:
2165 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2166 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2167 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2168 */
2169message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002170 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002171 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002172
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002173 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002174
Chenjie Yu52cacc62017-12-08 18:11:45 -08002175 enum State {
2176 ENTERED = 1;
2177 EXPANDED_TO_FULL_SCREEN = 2;
2178 MINIMIZED = 3;
2179 DISMISSED = 4;
2180 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002181 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002182}
2183
2184/**
Chenjie Yue8904192017-12-08 19:12:57 -08002185 * Logs overlay action
2186 * Logged from:
2187 * services/core/java/com/android/server/wm/Session.java
2188 */
2189message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002190 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002191
2192 optional string package_name = 2;
2193
2194 optional bool using_alert_window = 3;
2195
2196 enum State {
2197 ENTERED = 1;
2198 EXITED = 2;
2199 }
2200 optional State state = 4;
2201}
2202
Chenjie Yuccfe6452018-01-30 11:33:21 -08002203/*
2204 * Logs foreground service starts and stops.
2205 * Note that this is not when a service starts or stops, but when it is
2206 * considered foreground.
2207 * Logged from
2208 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2209 */
2210message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002211 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002212 // package_name + "/" + class_name
2213 optional string short_name = 2;
2214
2215 enum State {
2216 ENTER = 1;
2217 EXIT = 2;
2218 }
2219 optional State state = 3;
2220}
2221
Chenjie Yue8904192017-12-08 19:12:57 -08002222/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002223 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2224 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2225 * attributed back to the parent (host) uid. One example is Chrome.
2226 *
2227 * Logged from:
2228 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2229 */
2230message IsolatedUidChanged {
2231 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002232 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002233 optional int32 parent_uid = 1;
2234
2235 optional int32 isolated_uid = 2;
2236
2237 // We expect an isolated uid to be removed before if it's used for another parent uid.
2238 enum Event {
2239 REMOVED = 0;
2240 CREATED = 1;
2241 }
2242 optional Event event = 3;
2243}
2244
2245/*
2246 * Logs the reception of an incoming network packet causing the main system to wake up for
2247 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2248 * and processed by WakeupController.cpp.
2249 */
2250message PacketWakeupOccurred {
2251 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2252 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002253 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002254 // The interface name on which the packet was received.
2255 optional string iface = 2;
2256 // The ethertype value of the packet.
2257 optional int32 ethertype = 3;
2258 // String representation of the destination MAC address of the packet.
2259 optional string destination_hardware_address = 4;
2260 // String representation of the source address of the packet if this was an IP packet.
2261 optional string source_ip = 5;
2262 // String representation of the destination address of the packet if this was an IP packet.
2263 optional string destination_ip = 6;
2264 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2265 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2266 // families.
2267 optional int32 ip_next_header = 7;
2268 // The source port if this was a TCP or UDP packet.
2269 optional int32 source_port = 8;
2270 // The destination port if this was a TCP or UDP packet.
2271 optional int32 destination_port = 9;
2272}
2273
2274/*
2275 * Logs the memory stats for an app on startup.
2276 * Logged from:
2277 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2278 */
2279message AppStartMemoryStateCaptured {
2280 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002281 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002282
2283 // The process name.
2284 optional string process_name = 2;
2285
2286 // The activity name.
2287 optional string activity_name = 3;
2288
2289 // # of page-faults
2290 optional int64 pgfault = 4;
2291
2292 // # of major page-faults
2293 optional int64 pgmajfault = 5;
2294
2295 // RSS
2296 optional int64 rss_in_bytes = 6;
2297
2298 // CACHE
2299 optional int64 cache_in_bytes = 7;
2300
2301 // SWAP
2302 optional int64 swap_in_bytes = 8;
2303}
2304
2305/*
2306 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2307 * for LMK event.
2308 * Logged from:
2309 * system/core/lmkd/lmkd.c
2310 */
2311message LmkStateChanged {
2312 enum State {
2313 UNKNOWN = 0;
2314 START = 1;
2315 STOP = 2;
2316 }
2317 optional State state = 1;
2318}
2319
2320/*
2321 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2322 * Logged from:
2323 * system/core/lmkd/lmkd.c
2324 */
2325message LmkKillOccurred {
2326 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002327 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002328
2329 // The process name.
2330 optional string process_name = 2;
2331
2332 // oom adj score.
2333 optional int32 oom_score = 3;
2334
2335 // # of page-faults
2336 optional int64 pgfault = 4;
2337
2338 // # of major page-faults
2339 optional int64 pgmajfault = 5;
2340
2341 // RSS
2342 optional int64 rss_in_bytes = 6;
2343
2344 // CACHE
2345 optional int64 cache_in_bytes = 7;
2346
2347 // SWAP
2348 optional int64 swap_in_bytes = 8;
Jim Blackler972a5c52018-11-21 15:24:48 +00002349
2350 // The elapsed real time of start of the process.
2351 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002352}
2353
Rajeev Kumar51b54602018-03-01 12:18:26 -08002354/*
2355 * Logs when the ActivityManagerService detects that an app died.
2356 *
2357 * Logged from:
2358 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2359 */
2360message AppDied {
2361 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07002362 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002363}
2364
Chenjie Yubbcbc602018-02-05 16:51:52 -08002365//////////////////////////////////////////////////////////////////////
2366// Pulled atoms below this line //
2367//////////////////////////////////////////////////////////////////////
2368
2369/**
David Chenc8a43242017-10-17 16:23:28 -07002370 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2371 *
2372 * Pulled from:
2373 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2374 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002375message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002376 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002377
2378 optional int64 rx_bytes = 2;
2379
2380 optional int64 rx_packets = 3;
2381
2382 optional int64 tx_bytes = 4;
2383
2384 optional int64 tx_packets = 5;
2385}
2386
2387/**
2388 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2389 *
2390 * Pulled from:
2391 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2392 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002393message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002394 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002395
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002396 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2397 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002398
2399 optional int64 rx_bytes = 3;
2400
2401 optional int64 rx_packets = 4;
2402
2403 optional int64 tx_bytes = 5;
2404
2405 optional int64 tx_packets = 6;
2406}
2407
2408/**
2409 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2410 *
2411 * Pulled from:
2412 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2413 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002414message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002415 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002416
2417 optional int64 rx_bytes = 2;
2418
2419 optional int64 rx_packets = 3;
2420
2421 optional int64 tx_bytes = 4;
2422
2423 optional int64 tx_packets = 5;
2424}
2425
2426/**
2427 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2428 *
2429 * Pulled from:
2430 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2431 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002432message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002433 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002434
Yao Chenc40a19d2018-03-15 16:48:25 -07002435 // 1 denotes foreground and 0 denotes background. This is called Set in
2436 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002437 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002438
2439 optional int64 rx_bytes = 3;
2440
2441 optional int64 rx_packets = 4;
2442
2443 optional int64 tx_bytes = 5;
2444
2445 optional int64 tx_packets = 6;
2446}
2447
2448/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002449 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2450 *
2451 * Pulled from:
2452 * StatsCompanionService
2453 */
2454message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002455 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002456
2457 optional int64 rx_bytes = 2;
2458
2459 optional int64 tx_bytes = 3;
2460}
2461
2462/**
David Chenc8a43242017-10-17 16:23:28 -07002463 * Pulls the kernel wakelock durations. This atom is adapted from
2464 * android/internal/os/KernelWakelockStats.java
2465 *
2466 * Pulled from:
2467 * StatsCompanionService using KernelWakelockReader.
2468 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002469message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002470 optional string name = 1;
2471
2472 optional int32 count = 2;
2473
2474 optional int32 version = 3;
2475
2476 optional int64 time = 4;
2477}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002478
Chenjie Yu05013b32017-11-21 10:21:41 -08002479/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002480 * Pulls low power state information. This includes platform and subsystem sleep state information,
2481 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002482 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002483 * hardware/interfaces/power/1.1/types.hal
2484 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002485message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002486 // Subsystem name
2487 optional string subsystem_name = 1;
2488 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2489 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2490 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002491 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002492 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002493 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002494 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002495}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002496
Chenjie Yu05013b32017-11-21 10:21:41 -08002497/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002498 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002499 * Pulls the time the cpu spend on the frequency index. Frequency index
2500 * starts from highest to lowest. The value should be monotonically
2501 * increasing since boot. However, if there is a cpu
2502 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002503 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002504message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002505 optional uint32 cluster = 1;
2506 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002507 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002508}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002509
Chenjie Yu05013b32017-11-21 10:21:41 -08002510/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002511 * Pulls Cpu Time Per Uid.
2512 * Note that isolated process uid time should be attributed to host uids.
2513 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002514message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002515 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002516 optional uint64 user_time_micros = 2;
2517 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002518}
2519
2520/**
2521 * Pulls Cpu Time Per Uid per frequency.
2522 * Note that isolated process uid time should be attributed to host uids.
2523 * For each uid, we order the time by descending frequencies.
2524 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002525message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002526 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002527 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002528 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002529}
Hugo Benichi884970e2017-11-14 22:42:46 +09002530
Chenjie Yu05013b32017-11-21 10:21:41 -08002531/**
2532 * Pulls Wifi Controller Activity Energy Info
2533 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002534message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002535 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002536 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002537 // stack reported state
2538 // TODO: replace this with proto enum
2539 optional int32 stack_state = 2;
2540 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002541 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002542 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002543 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002544 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002545 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002546 // product of current(mA), voltage(V) and time(ms)
2547 optional uint64 controller_energy_used = 6;
2548}
2549
2550/**
2551 * Pulls Modem Activity Energy Info
2552 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002553message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002554 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002555 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002556 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08002557 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08002558 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002559 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002560 /**
2561 * Tx power index
2562 * index 0 = tx_power < 0dBm
2563 * index 1 = 0dBm < tx_power < 5dBm
2564 * index 2 = 5dBm < tx_power < 15dBm
2565 * index 3 = 15dBm < tx_power < 20dBm
2566 * index 4 = tx_power > 20dBm
2567 */
2568 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002569 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002570 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002571 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002572 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002573 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002574 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002575 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002576 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002577 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002578 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002579 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002580 // product of current(mA), voltage(V) and time(ms)
2581 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002582}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002583
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002584/**
2585 * Pulls Bluetooth Activity Energy Info
2586 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2587 */
2588message BluetoothActivityInfo {
2589 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002590 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002591 // bluetooth stack state
2592 optional int32 bluetooth_stack_state = 2;
2593 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002594 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002595 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002596 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002597 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002598 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002599 // product of current(mA), voltage(V) and time(ms)
2600 optional uint64 energy_used = 6;
2601}
2602
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002603/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002604 * Logs the memory stats for a process.
2605 */
2606message ProcessMemoryState {
2607 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002608 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002609
2610 // The process name.
2611 optional string process_name = 2;
2612
2613 // oom adj score.
2614 optional int32 oom_score = 3;
2615
2616 // # of page-faults
2617 optional int64 pgfault = 4;
2618
2619 // # of major page-faults
2620 optional int64 pgmajfault = 5;
2621
Rajeev Kumar90235992018-01-29 11:06:48 -08002622 // RSS
2623 optional int64 rss_in_bytes = 6;
2624
2625 // CACHE
2626 optional int64 cache_in_bytes = 7;
2627
2628 // SWAP
2629 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002630}
2631
2632/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002633 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002634 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002635message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002636 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002637}
2638
2639/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002640 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002641 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002642message SystemUptime {
2643 // Milliseconds since the system was booted.
2644 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2645 // for external input).
2646 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002647 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002648}
2649
2650/*
2651 * Reads from /proc/uid_concurrent_active_time which has the format:
2652 * active: X (X is # cores)
2653 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2654 * [uid1]: [time-0] [time-1] [time-2] ... ...
2655 * ...
2656 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2657 * The file contains a monotonically increasing count of time for a single boot.
2658 */
2659message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002660 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002661 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002662}
2663
2664/**
2665 * Reads from /proc/uid_concurrent_policy_time which has the format:
2666 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2667 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2668 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2669 * ...
2670 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2671 * The file contains a monotonically increasing count of time for a single boot.
2672 */
2673message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002674 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002675 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002676 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002677}
2678
2679/*
2680 * Pulls free disk space, for data, system partition and temporary directory.
2681 */
2682message DiskSpace {
2683 // available bytes in data partition
2684 optional uint64 data_available_bytes = 1;
2685 // available bytes in system partition
2686 optional uint64 system_available_bytes = 2;
2687 // available bytes in download cache or temp directories
2688 optional uint64 temp_available_bytes = 3;
2689}
Tej Singhbf972d92018-01-10 20:51:13 -08002690
2691/**
2692 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002693 * Pulled from:
2694 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002695 */
2696message RemainingBatteryCapacity {
2697 optional int32 charge_uAh = 1;
2698}
2699
2700/**
2701 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002702 * Pulled from:
2703 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002704 */
2705message FullBatteryCapacity {
2706 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08002707}
2708
2709/**
Tej Singhd89137e2018-03-26 14:51:40 -07002710 * Pulls the temperature of various parts of the device.
2711 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002712 *
2713 * Pulled from:
2714 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2715 */
2716message Temperature {
2717 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2718 optional android.os.TemperatureTypeEnum sensor_location = 1;
2719
2720 // The name of the temperature source. Eg. CPU0
2721 optional string sensor_name = 2;
2722
Tej Singhd89137e2018-03-26 14:51:40 -07002723 // Temperature in tenths of a degree C.
2724 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08002725}
lifr35a7cf02018-12-12 16:38:04 +08002726
2727/**
2728 * Logs the latency period(in microseconds) and the return code of
2729 * the DNS(Domain Name System) lookups.
2730 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
2731 * to get info(address or hostname) from DNS server(or DNS cache).
2732 * Logged from:
2733 * /system/netd/server/DnsProxyListener.cpp
2734 */
2735message NetworkDnsEventReported {
2736 // The types of the DNS lookups, as defined in
2737 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
2738 enum EventType {
2739 EVENT_UNKNOWN = 0;
2740 EVENT_GETADDRINFO = 1;
2741 EVENT_GETHOSTBYNAME = 2;
2742 EVENT_GETHOSTBYADDR = 3;
2743 EVENT_RES_NSEND = 4;
2744 }
2745 optional EventType event_type = 1;
2746
2747 // The return value of the DNS resolver for each DNS lookups.
2748 //bionic/libc/include/netdb.h
2749 //system/netd/resolv/include/netd_resolv/resolv.h
2750 enum ReturnCode {
2751 EAI_NO_ERROR = 0;
2752 EAI_ADDRFAMILY = 1;
2753 EAI_AGAIN = 2;
2754 EAI_BADFLAGS = 3;
2755 EAI_FAIL = 4;
2756 EAI_FAMILY = 5;
2757 EAI_MEMORY = 6;
2758 EAI_NODATA = 7;
2759 EAI_NONAME = 8;
2760 EAI_SERVICE = 9;
2761 EAI_SOCKTYPE = 10;
2762 EAI_SYSTEM = 11;
2763 EAI_BADHINTS = 12;
2764 EAI_PROTOCOL = 13;
2765 EAI_OVERFLOW = 14;
2766 RESOLV_TIMEOUT = 255;
2767 EAI_MAX = 256;
2768 }
2769 optional ReturnCode return_code = 2;
2770
2771 // The latency period(in microseconds) it took for this DNS lookup to complete.
2772 optional int32 latency_micros = 3;
2773}
2774
Chiachang Wang67f24472019-01-15 15:14:00 +08002775/**
2776 * Logs when a data stall event occurs.
2777 *
2778 * Log from:
2779 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2780 */
2781message DataStallEvent {
2782 // Data stall evaluation type.
2783 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2784 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
2785 optional int32 evaluation_type = 1;
2786 // See definition in data_stall_event.proto.
2787 optional com.android.server.connectivity.ProbeResult validation_result = 2;
2788 // See definition in data_stall_event.proto.
2789 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
2790 // See definition in data_stall_event.proto.
2791 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
2792 // See definition in data_stall_event.proto.
2793 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
2794 // See definition in data_stall_event.proto.
2795 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
2796}
Jack Yu6d421bc2019-01-23 17:42:54 +08002797
2798/**
2799 * Logs when a NFC device's error occurred.
2800 * Logged from:
2801 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2802 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
2803 */
2804message NfcErrorOccurred {
2805 enum Type {
2806 UNKNOWN = 0;
2807 CMD_TIMEOUT = 1;
2808 ERROR_NOTIFICATION = 2;
2809 AID_OVERFLOW = 3;
2810 }
2811 optional Type type = 1;
2812 // If it's nci cmd timeout, log the timeout command.
2813 optional uint32 nci_cmd = 2;
2814
2815 optional uint32 error_ntf_status_code = 3;
2816}
2817
2818/**
2819 * Logs when a NFC device's state changed event
2820 * Logged from:
2821 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
2822 */
2823message NfcStateChanged {
2824 enum State {
2825 UNKNOWN = 0;
2826 OFF = 1;
2827 ON = 2;
2828 ON_LOCKED = 3; // Secure Nfc enabled.
2829 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
2830 }
2831 optional State state = 1;
2832}
2833
2834/**
2835 * Logs when a NFC Beam Transaction occurred.
2836 * Logged from:
2837 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
2838 */
2839message NfcBeamOccurred {
2840 enum Operation {
2841 UNKNOWN = 0;
2842 SEND = 1;
2843 RECEIVE = 2;
2844 }
2845 optional Operation operation = 1;
2846}
2847
2848/**
2849 * Logs when a NFC Card Emulation Transaction occurred.
2850 * Logged from:
2851 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
2852 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
2853 */
2854message NfcCardemulationOccurred {
2855 enum Category {
2856 UNKNOWN = 0;
2857 HCE_PAYMENT = 1;
2858 HCE_OTHER = 2;
2859 OFFHOST = 3;
2860 }
2861 // Transaction belongs to HCE payment or HCE other category, or offhost.
2862 optional Category category = 1;
2863 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
2864 optional string se_name = 2;
2865}
2866
2867/**
2868 * Logs when a NFC Tag event occurred.
2869 * Logged from:
2870 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
2871 */
2872message NfcTagOccurred {
2873 enum Type {
2874 UNKNOWN = 0;
2875 URL = 1;
2876 BT_PAIRING = 2;
2877 PROVISION = 3;
2878 WIFI_CONNECT = 4;
2879 APP_LAUNCH = 5;
2880 OTHERS = 6;
2881 }
2882 optional Type type = 1;
2883}
2884
2885/**
2886 * Logs when Hce transaction triggered
2887 * Logged from:
2888 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2889 */
2890message NfcHceTransactionOccurred {
2891 // The latency period(in microseconds) it took for the first HCE data
2892 // exchange.
2893 optional uint32 latency_micros = 1;
2894}
2895
2896/**
2897 * Logs when SecureElement state event changed
2898 * Logged from:
2899 * packages/apps/SecureElement/src/com/android/se/Terminal.java
2900 */
2901message SeStateChanged {
2902 enum State {
2903 UNKNOWN = 0;
2904 INITIALIZED = 1;
2905 DISCONNECTED = 2;
2906 CONNECTED = 3;
2907 HALCRASH = 4;
2908 }
2909 optional State state = 1;
2910
2911 optional string state_change_reason = 2;
2912 // SIMx or eSEx.
2913 optional string terminal = 3;
2914}
2915
2916/**
2917 * Logs when Omapi API used
2918 * Logged from:
2919 * packages/apps/SecureElement/src/com/android/se/Terminal.java
2920 */
2921message SeOmapiReported {
2922 enum Operation {
2923 UNKNOWN = 0;
2924 OPEN_CHANNEL = 1;
2925 }
2926 optional Operation operation = 1;
2927 // SIMx or eSEx.
2928 optional string terminal = 2;
2929
2930 optional string package_name = 3;
2931}