blob: 1d629da2f2505468dde836f1c561d4ce7aec1e42 [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;
Hui Yuf57e4012019-02-13 12:29:38 -0800164 ProcessStartTime process_start_time = 169;
Jack He9c30c7c6b2019-01-30 17:24:55 -0800165 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Yao Chend54f9dd2017-10-17 17:37:48 +0000166 }
David Chenc8a43242017-10-17 16:23:28 -0700167
David Chen6e3e6cb2018-01-03 16:14:06 -0800168 // Pulled events will start at field 10000.
Tej Singh40298312018-02-16 00:15:09 -0800169 // Next: 10022
David Chenc8a43242017-10-17 16:23:28 -0700170 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800171 WifiBytesTransfer wifi_bytes_transfer = 10000;
172 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
173 MobileBytesTransfer mobile_bytes_transfer = 10002;
174 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800175 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800176 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800177 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800178 CpuTimePerFreq cpu_time_per_freq = 10008;
179 CpuTimePerUid cpu_time_per_uid = 10009;
180 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800181 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800182 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800183 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800184 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800185 SystemElapsedRealtime system_elapsed_realtime = 10014;
186 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800187 CpuActiveTime cpu_active_time = 10016;
188 CpuClusterTime cpu_cluster_time = 10017;
Chenjie Yu937d7422018-01-10 16:37:53 -0800189 DiskSpace disk_space = 10018;
Tej Singhbf972d92018-01-10 20:51:13 -0800190 RemainingBatteryCapacity remaining_battery_capacity = 10019;
191 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800192 Temperature temperature = 10021;
David Chenc8a43242017-10-17 16:23:28 -0700193 }
yroa1fe77c2018-02-26 14:22:54 -0800194
Bookatz76aafcf2018-09-17 16:17:10 -0700195 // DO NOT USE field numbers above 100,000 in AOSP.
196 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
197 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700198}
199
Yao Chend54f9dd2017-10-17 17:37:48 +0000200/**
Yangster-mac20877162017-12-22 17:19:39 -0800201 * This proto represents a node of an attribution chain.
202 * Note: All attribution chains are represented as a repeated field of type
203 * AttributionNode. It is understood that in such arrays, the order is that
204 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000205 */
Yangster-mac20877162017-12-22 17:19:39 -0800206message AttributionNode {
207 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800208 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800209
Yangster-mac20877162017-12-22 17:19:39 -0800210 // The (optional) string tag for an element in the attribution chain. If the
211 // element has no tag, it is encoded as an empty string.
212 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700213}
214
Yao Chend54f9dd2017-10-17 17:37:48 +0000215/*
216 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800217 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000218 *
219 * RULES:
220 * - The field ids for each atom must start at 1, and count upwards by 1.
221 * Skipping field ids is not allowed.
222 * - These form an API, so renaming, renumbering or removing fields is
223 * not allowed between android releases. (This is not currently enforced,
224 * but there will be a tool to enforce this restriction).
225 * - The types must be built-in protocol buffer types, namely, no sub-messages
226 * are allowed (yet). The bytes type is also not allowed.
227 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800228 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000229 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800230 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000231 * - A field that is a uid should be a string field, tagged with the [xxx]
232 * annotation. The generated code on android will be represented by UIDs,
233 * and those UIDs will be translated in xxx to those strings.
234 *
235 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700236 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000237 * - If there is a UID, it goes first. Think in an object-oriented fashion.
238 * *****************************************************************************
239 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700240
Yao Chend54f9dd2017-10-17 17:37:48 +0000241/**
242 * Logs when the screen state changes.
243 *
244 * Logged from:
245 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
246 */
247message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800248 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800249 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700250}
Yao Chend54f9dd2017-10-17 17:37:48 +0000251
252/**
Bookatzc1a050a2017-10-10 15:49:28 -0700253 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000254 *
255 * Logged from:
256 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
257 */
Bookatzc1a050a2017-10-10 15:49:28 -0700258message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700259 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000260
Bookatzdb026a22018-01-10 19:01:56 -0800261 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800262 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000263}
264
265/**
Bookatzc1a050a2017-10-10 15:49:28 -0700266 * Logs that a process started, finished, crashed, or ANRed.
267 *
268 * Logged from:
269 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
270 */
271message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700272 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700273
David Chen0b5c90c2018-01-25 16:51:49 -0800274 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800275 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700276
Bookatzddccf0a2017-11-28 16:48:14 -0800277 // What lifecycle state the process changed to.
278 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800279 enum State {
280 FINISHED = 0;
281 STARTED = 1;
282 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800283 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800284 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700285}
286
Bookatzc1a050a2017-10-10 15:49:28 -0700287/**
288 * Logs when the ble scan state changes.
289 *
290 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700291 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700292 */
293message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800294 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700295
296 enum State {
297 OFF = 0;
298 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700299 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
300 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700301 }
302 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700303
Bookatze5ec0b42018-03-26 13:34:56 -0700304 // Does the scan have a filter.
305 optional bool is_filtered = 3;
306 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
307 optional bool is_first_match = 4;
308 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
309 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700310}
311
312/**
313 * Logs reporting of a ble scan finding results.
314 *
315 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700316 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700317 */
Bookatzae6738e2018-09-13 11:38:56 -0700318// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700319message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800320 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700321
322 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800323 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700324}
325
326/**
327 * Logs when a sensor state changes.
328 *
329 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700330 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700331 */
332message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800333 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700334
Bookatzc1a050a2017-10-10 15:49:28 -0700335 // The id (int) of the sensor.
336 optional int32 sensor_id = 2;
337
338 enum State {
339 OFF = 0;
340 ON = 1;
341 }
342 optional State state = 3;
343}
344
345
346/**
347 * Logs when GPS state changes.
348 *
349 * Logged from:
350 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
351 */
352message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800353 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700354
355 enum State {
356 OFF = 0;
357 ON = 1;
358 }
359 optional State state = 2;
360}
361
362
363/**
364 * Logs when a sync manager sync state changes.
365 *
366 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700367 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700368 */
369message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800370 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700371
David Chen0b5c90c2018-01-25 16:51:49 -0800372 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800373 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700374
375 enum State {
376 OFF = 0;
377 ON = 1;
378 }
379 optional State state = 3;
380}
381
382/**
383 * Logs when a job scheduler job state changes.
384 *
385 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700386 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700387 */
388message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800389 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700390
391 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800392 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700393
394 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800395 FINISHED = 0;
396 STARTED = 1;
397 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700398 }
399 optional State state = 3;
400
Tej Singh33a412b2018-03-16 18:43:59 -0700401 // The reason a job has stopped.
402 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700403 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700404 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700405}
406
407/**
408 * Logs when the audio state changes.
409 *
410 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700411 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700412 */
413message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800414 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700415
416 enum State {
417 OFF = 0;
418 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700419 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
420 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700421 }
422 optional State state = 2;
423}
424
425/**
426 * Logs when the video codec state changes.
427 *
428 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700429 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700430 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800431message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800432 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700433
434 enum State {
435 OFF = 0;
436 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700437 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
438 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700439 }
440 optional State state = 2;
441}
442
443/**
444 * Logs when the flashlight state changes.
445 *
446 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700447 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700448 */
449message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800450 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700451
452 enum State {
453 OFF = 0;
454 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700455 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
456 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700457 }
458 optional State state = 2;
459}
460
461/**
462 * Logs when the camera state changes.
463 *
464 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700465 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700466 */
467message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800468 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700469
470 enum State {
471 OFF = 0;
472 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700473 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
474 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700475 }
476 optional State state = 2;
477}
478
479/**
480 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000481 *
482 * Logged from:
483 * TODO
484 */
Bookatzd6746242017-10-24 18:39:35 -0700485message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800486 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000487
Bookatz1a1b0462018-01-12 11:47:03 -0800488 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
489 // From frameworks/base/core/proto/android/os/enums.proto.
490 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700491
492 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
493 optional string tag = 3;
494
495 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800496 RELEASE = 0;
497 ACQUIRE = 1;
498 CHANGE_RELEASE = 2;
499 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700500 }
501 optional State state = 4;
502}
503
504/**
Bookatzc1a050a2017-10-10 15:49:28 -0700505 * Logs when a partial wakelock is considered 'long' (over 1 min).
506 *
507 * Logged from:
508 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
509 */
510message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800511 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700512
Yao Chend54f9dd2017-10-17 17:37:48 +0000513 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
514 optional string tag = 2;
515
Bookatzc1a050a2017-10-10 15:49:28 -0700516 // TODO: I have no idea what this is.
517 optional string history_tag = 3;
518
519 enum State {
520 OFF = 0;
521 ON = 1;
522 }
523 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000524}
525
Bookatzc1a050a2017-10-10 15:49:28 -0700526/**
527 * Logs Battery Saver state change.
528 *
529 * Logged from:
530 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
531 */
532message BatterySaverModeStateChanged {
533 enum State {
534 OFF = 0;
535 ON = 1;
536 }
537 optional State state = 1;
538}
539
540/**
541 * Logs Doze mode state change.
542 *
543 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800544 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700545 */
546message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800547 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800548}
549
550
551/**
552 * Logs state change of Doze mode including maintenance windows.
553 *
554 * Logged from:
555 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
556 */
557message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800558 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700559}
560
561/**
562 * Logs screen brightness level.
563 *
564 * Logged from:
565 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
566 */
567message ScreenBrightnessChanged {
568 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
569 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700570}
571
572/**
573 * Logs battery level (percent full, from 0 to 100).
574 *
575 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700576 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700577 */
578message BatteryLevelChanged {
579 // Battery level. Should be in [0, 100].
580 optional int32 battery_level = 1;
581}
582
583/**
584 * Logs change in charging status of the device.
585 *
586 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700587 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700588 */
589message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800590 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
591 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700592}
593
594/**
595 * Logs whether the device is plugged in, and what power source it is using.
596 *
597 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700598 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700599 */
600message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800601 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
602 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700603}
604
Bookatz8c6571b2017-10-24 15:04:41 -0700605/**
606 * Logs when an app's wakeup alarm fires.
607 *
608 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700609 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700610 */
611message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800612 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800613
614 // Name of the wakeup alarm.
615 optional string tag = 2;
616}
617
618/**
619 * Logs when an an app causes the mobile radio to change state.
620 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
621 *
622 * Logged from:
623 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
624 */
625message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800626 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800627
Bookatz1a1b0462018-01-12 11:47:03 -0800628 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
629 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800630}
631
632/**
633 * Logs when an an app causes the wifi radio to change state.
634 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
635 *
636 * Logged from:
637 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
638 */
639message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800640 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800641
Bookatz1a1b0462018-01-12 11:47:03 -0800642 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
643 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700644}
645
646/**
647 * Logs kernel wakeup reasons and aborts.
648 *
649 * Logged from:
650 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
651 */
652message KernelWakeupReported {
653 // Name of the kernel wakeup reason (or abort).
654 optional string wakeup_reason_name = 1;
655
656 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800657 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700658}
659
660/**
661 * Logs wifi locks held by an app.
662 *
663 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700664 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700665 */
666message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800667 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700668
669 enum State {
670 OFF = 0;
671 ON = 1;
672 }
673 optional State state = 2;
674}
675
676/**
677 * Logs wifi signal strength changes.
678 *
679 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700680 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700681 */
682message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800683 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
684 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700685}
686
687/**
688 * Logs wifi scans performed by an app.
689 *
690 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700691 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700692 */
693message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800694 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700695
696 enum State {
697 OFF = 0;
698 ON = 1;
699 }
700 optional State state = 2;
701}
702
703/**
Tej Singh4503e102018-01-04 14:35:01 -0800704 * Logs wifi multicast locks held by an app
705 *
706 * Logged from:
707 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
708 */
709message WifiMulticastLockStateChanged {
710 repeated AttributionNode attribution_node = 1;
711
712 enum State {
713 OFF = 0;
714 ON = 1;
715 }
716 optional State state = 2;
717}
718
719/**
Tej Singh1ea42892018-01-19 09:27:00 -0800720 * Logs shutdown reason and duration on next boot.
721 *
722 * Logged from:
723 * frameworks/base/core/java/com/android/server/BootReceiver.java
724 */
725message ShutdownSequenceReported {
726 // True if shutdown is for a reboot. Default: false if we do not know.
727 optional bool reboot = 1;
728
729 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
730 optional string reason = 2;
731
732 // Beginning of shutdown time in ms using wall clock time since unix epoch.
733 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800734 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800735
736 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800737 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800738}
739
Tej Singh6483ea42018-01-25 17:45:49 -0800740
741/**
742 * Logs boot reason and duration.
743 *
744 * Logged from:
745 * system/core/bootstat/bootstat.cpp
746 */
747message BootSequenceReported {
748 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
749 // Default: "<EMPTY>" if not available.
750 optional string bootloader_reason = 1;
751
752 // Reason for system boot. Eg. bootloader, reboot,userrequested
753 // Default: "<EMPTY>" if not available.
754 optional string system_reason = 2;
755
756 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800757 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800758
759 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800760 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800761
762 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800763 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800764
765 // Time since last boot in ms. Default: 0 if not available.
766 optional int64 time_since_last_boot = 6;
767}
768
Tej Singhc477d9c2018-02-05 18:31:39 -0800769
770/**
771 * Logs call state and disconnect cause (if applicable).
772 *
773 * Logged from:
774 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
775 */
776message CallStateChanged {
777 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
778 // From frameworks/base/core/proto/android/telecomm/enums.proto.
779 optional android.telecom.CallStateEnum call_state = 1;
780
781 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
782 // This value is only applicable when the call_state is DISCONNECTED, and
783 // should always be UNKNOWN if the call_state is not DISCONNECTED.
784 // From frameworks/base/core/proto/android/telecomm/enums.proto.
785 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
786
787 // True if the call is self-managed, which are apps that use the
788 // telecom infrastructure to make their own calls.
789 optional bool self_managed = 3;
790
791 // True if call is external. External calls are calls on connected Wear
792 // devices but show up in Telecom so the user can pull them onto the device.
793 optional bool external_call = 4;
794}
795
Tej Singh1ea42892018-01-19 09:27:00 -0800796/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800797 * Logs keyguard state. The keyguard is the lock screen.
798 *
799 * Logged from:
800 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
801 */
802message KeyguardStateChanged {
803 enum State {
804 UNKNOWN = 0;
805 // The keyguard is hidden when the phone is unlocked.
806 HIDDEN = 1;
807 // The keyguard is shown when the phone is locked (screen turns off).
808 SHOWN= 2;
809 // The keyguard is occluded when something is overlaying the keyguard.
810 // Eg. Opening the camera while on the lock screen.
811 OCCLUDED = 3;
812 }
813 optional State state = 1;
814}
815
816/**
817 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
818 * prompts the user to enter a password (pattern, pin, etc).
819 *
820 * Logged from:
821 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
822 */
823
824message KeyguardBouncerStateChanged {
825 enum State {
826 UNKNOWN = 0;
827 // Bouncer is hidden, either as a result of successfully entering the
828 // password, screen timing out, or user going back to lock screen.
829 HIDDEN = 1;
830 // This is when the user is being prompted to enter the password.
831 SHOWN = 2;
832 }
833 optional State state = 1;
834}
835
836/**
837 * Logs the result of entering a password into the keyguard bouncer.
838 *
839 * Logged from:
840 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
841 */
842message KeyguardBouncerPasswordEntered {
843 enum BouncerResult {
844 UNKNOWN = 0;
845 // The password entered was incorrect.
846 FAILURE = 1;
847 // The password entered was correct.
848 SUCCESS = 2;
849 }
850 optional BouncerResult result = 1;
851}
852
Tej Singha883b372018-02-15 11:30:01 -0800853/*
854 * Logs changes to the configuration of the device. The configuration is defined
855 * in frameworks/base/core/java/android/content/res/Configuration.java
856 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
857 * Please go there to interpret the possible values each field can be.
858 *
859 * Logged from:
860 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
861 */
862message ResourceConfigurationChanged {
863 // Bit mask of color capabilities of the screen.
864 // Contains information about the color gamut and hdr mode of the screen.
865 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
866 optional int32 colorMode = 1;
867
868 // The target screen density being rendered to.
869 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
870 optional int32 densityDpi = 2;
871
872 // Current user preference for the scaling factor for fonts,
873 // relative to the base density scaling.
874 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
875 optional float fontScale = 3;
876
877 // Flag indicating whether the hard keyboard is hidden.
878 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
879 optional int32 hardKeyboardHidden = 4;
880
881 // The type of keyboard attached to the device.
882 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
883 optional int32 keyboard = 5;
884
885 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
886 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
887 optional int32 keyboardHideen = 6;
888
889 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
890 // 0 if undefined.
891 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
892 optional int32 mcc = 7;
893
894 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
895 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
896 // MNC_ZERO symbol defined in Configuration.java.
897 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
898 optional int32 mnc = 8;
899
900 // The kind of navigation available on the device.
901 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
902 optional int32 navigation = 9;
903
904 // Flag indicating whether the navigation is available.
905 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
906 optional int32 navigationHidden = 10;
907
908 // Overall orientation of the screen.
909 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
910 optional int32 orientation = 11;
911
912 // The current height of the available screen space, in dp units.
913 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
914 optional int32 screenHeightDp = 12;
915
916 // Bit mask of overall layout of the screen.
917 // Contains information about screen size, whether the screen is wider/taller
918 // than normal, whether the screen layout is right-tl-left or left-to-right,
919 // and whether the screen has a rounded shape.
920 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
921 optional int32 screenLayout = 13;
922
923 // Current width of the available screen space, in dp units.
924 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
925 optional int32 screenWidthDp = 14;
926
927 // The smallest screen size an application will see in normal operation.
928 // This is the smallest value of both screenWidthDp and screenHeightDp
929 // in portrait and landscape.
930 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
931 optional int32 smallestScreenWidthDp = 15;
932
933 // The type of touch screen attached to the device.
934 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
935 optional int32 touchscreen = 16;
936
937 // Bit mask of the ui mode.
938 // Contains information about the overall ui mode of the device.
939 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
940 // Also contains information about whether the device is in night mode.
941 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
942 optional int32 uiMode = 17;
943}
944
Tej Singheee317b2018-03-07 19:28:05 -0800945
946/**
947 * Logs changes in the connection state of the mobile radio.
948 *
949 * Logged from:
950 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
951 */
952message MobileConnectionStateChanged {
953 // States are from the state machine DataConnection.java.
954 enum State {
955 UNKNOWN = 0;
956 // The connection is inactive, or disconnected.
957 INACTIVE = 1;
958 // The connection is being activated, or connecting.
959 ACTIVATING = 2;
960 // The connection is active, or connected.
961 ACTIVE = 3;
962 // The connection is disconnecting.
963 DISCONNECTING = 4;
964 // The connection is disconnecting after creating a connection.
965 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
966 }
967 optional State state = 1;
968 // For multi-sim phones, this distinguishes between the sim cards.
969 optional int32 sim_slot_index = 2;
970 // Used to identify the connection. Starts at 0 and increments by 1 for
971 // every new network created. Resets whenever the device reboots.
972 optional int32 data_connection_id = 3;
973 // A bitmask for the capabilities of this connection.
974 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
975 // Default value (if we have no information): 0
976 optional int64 capabilities = 4;
977 // If this connection has internet.
978 // This just checks if the DEFAULT bit of capabilities is set.
979 optional bool has_internet = 5;
980}
981
982/**
983 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
984 *
985 * Logged from:
986 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
987 */
988message MobileRadioTechnologyChanged {
989 optional android.telephony.NetworkTypeEnum state = 1;
990 // For multi-sim phones, this distinguishes between the sim cards.
991 optional int32 sim_slot_index = 2;
992}
993
Andrew Chantb56388b2018-03-22 21:07:33 -0700994/**
995 * Logs the VID and PID of any connected USB devices.
996 *
997 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
998 *
999 * Logged by Vendor.
1000 */
1001message UsbDeviceAttached {
1002 optional int32 vid = 1;
1003 optional int32 pid = 2;
1004 optional bool has_audio = 3;
1005 optional bool has_hid = 4;
1006 optional bool has_storage = 5;
1007}
1008
Tej Singheee317b2018-03-07 19:28:05 -08001009
Tej Singhdd7bd352018-02-09 19:33:15 -08001010/**
Tej Singh5d991e12018-03-09 19:48:11 -08001011 * Logs when Bluetooth is enabled and disabled.
1012 *
1013 * Logged from:
1014 * services/core/java/com/android/server/BluetoothManagerService.java
1015 */
1016message BluetoothEnabledStateChanged {
1017 repeated AttributionNode attribution_node = 1;
1018 // Whether or not bluetooth is enabled on the device.
1019 enum State {
1020 UNKNOWN = 0;
1021 ENABLED = 1;
1022 DISABLED = 2;
1023 }
1024 optional State state = 2;
1025 // The reason for being enabled/disabled.
1026 // Eg. Airplane mode, crash, application request.
1027 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1028 // If the reason is an application request, this will be the package name.
1029 optional string pkgName = 4;
1030}
1031
1032/**
Jack He22e4a1d2019-01-09 01:19:13 -08001033 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001034 *
1035 * Logged from:
Jack He22e4a1d2019-01-09 01:19:13 -08001036 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1037 *
1038 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001039 */
1040message BluetoothConnectionStateChanged {
1041 // The state of the connection.
1042 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1043 optional android.bluetooth.ConnectionStateEnum state = 1;
1044 // An identifier that can be used to match connect and disconnect events.
1045 // Currently is last two bytes of a hash of a device level ID and
1046 // the mac address of the bluetooth device that is connected.
Jack He22e4a1d2019-01-09 01:19:13 -08001047 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1048 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001049 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1050 // From android.bluetooth.BluetoothAdapter.java
Jack He22e4a1d2019-01-09 01:19:13 -08001051 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001052 optional int32 bt_profile = 3;
Jack He22e4a1d2019-01-09 01:19:13 -08001053 // An identifier that can be used to match events for this device.
1054 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1055 // Salt: Randomly generated 256 bit value
1056 // Hash algorithm: HMAC-SHA256
1057 // Size: 32 byte
1058 // Default: null or empty if the device identifier is not known
1059 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1060}
1061
1062/**
1063 * Logs when a Bluetooth device connects and disconnects over ACL
1064 *
1065 * Logged from:
1066 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1067 *
1068 * Next Tag: 3
1069 */
1070message BluetoothAclConnectionStateChanged {
1071 // An identifier that can be used to match events for this device.
1072 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1073 // Salt: Randomly generated 256 bit value
1074 // Hash algorithm: HMAC-SHA256
1075 // Size: 32 byte
1076 // Default: null or empty if the device identifier is not known
1077 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1078 // The state of the connection.
1079 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1080 optional android.bluetooth.ConnectionStateEnum state = 2;
1081}
1082
1083/**
1084 * Logs when a Bluetooth device connects and disconnects over SCO
1085 *
1086 * Logged from:
1087 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1088 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1089 *
1090 * Next Tag: 4
1091 */
1092message BluetoothScoConnectionStateChanged {
1093 // An identifier that can be used to match events for this device.
1094 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1095 // Salt: Randomly generated 256 bit value
1096 // Hash algorithm: HMAC-SHA256
1097 // Size: 32 byte
1098 // Default: null or empty if the device identifier is not known
1099 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1100 // The state of the connection.
1101 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1102 optional android.bluetooth.ConnectionStateEnum state = 2;
1103 // Codec used for this SCO connection
1104 // Default: UNKNOWN
1105 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001106}
1107
Jack He924f3462019-01-09 20:54:41 -08001108/**
1109 * Logged when active device of a profile changes
1110 *
1111 * Logged from:
1112 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1113 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1114 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1115 */
1116message BluetoothActiveDeviceChanged {
1117 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1118 // From android.bluetooth.BluetoothProfile
1119 optional int32 bt_profile = 1;
1120 // An identifier that can be used to match events for this new active device.
1121 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1122 // Salt: Randomly generated 256 bit value
1123 // Hash algorithm: HMAC-SHA256
1124 // Size: 32 byte
1125 // Default: null or empty if there is no active device for this profile
1126 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1127}
1128
Jack He52260142018-12-18 15:43:27 -08001129// Logs when there is an event affecting Bluetooth device's link layer connection.
1130// - This event is triggered when there is a related HCI command or event
1131// - Users of this metrics can deduce Bluetooth device's connection state from these events
1132// - HCI commands are logged before the command is sent, after receiving command status, and after
1133// receiving command complete
1134// - HCI events are logged when they arrive
1135//
1136// Low level log from system/bt
1137//
1138// Bluetooth classic commands:
1139// - CMD_CREATE_CONNECTION
1140// - CMD_DISCONNECT
1141// - CMD_CREATE_CONNECTION_CANCEL
1142// - CMD_ACCEPT_CONNECTION_REQUEST
1143// - CMD_REJECT_CONNECTION_REQUEST
1144// - CMD_SETUP_ESCO_CONNECTION
1145// - CMD_ACCEPT_ESCO_CONNECTION
1146// - CMD_REJECT_ESCO_CONNECTION
1147// - CMD_ENH_SETUP_ESCO_CONNECTION
1148// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1149//
1150// Bluetooth low energy commands:
1151// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1152// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1153// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1154// - CMD_BLE_CLEAR_WHITE_LIST
1155// - CMD_BLE_ADD_WHITE_LIST
1156// - CMD_BLE_REMOVE_WHITE_LIST
1157//
1158// Bluetooth classic events:
1159// - EVT_CONNECTION_COMP
1160// - EVT_CONNECTION_REQUEST
1161// - EVT_DISCONNECTION_COMP
1162// - EVT_ESCO_CONNECTION_COMP
1163// - EVT_ESCO_CONNECTION_CHANGED
1164//
1165// Bluetooth low energy meta events:
1166// - BLE_EVT_CONN_COMPLETE_EVT
1167// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1168//
1169// Next tag: 10
1170message BluetoothLinkLayerConnectionEvent {
1171 // An identifier that can be used to match events for this device.
1172 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1173 // Salt: Randomly generated 256 bit value
1174 // Hash algorithm: HMAC-SHA256
1175 // Size: 32 byte
1176 // Default: null or empty if the device identifier is not known
1177 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1178 // Connection handle of this connection if available
1179 // Range: 0x0000 - 0x0EFF (12 bits)
1180 // Default: 0xFFFF if the handle is unknown
1181 optional int32 connection_handle = 2;
1182 // Direction of the link
1183 // Default: DIRECTION_UNKNOWN
1184 optional android.bluetooth.DirectionEnum direction = 3;
1185 // Type of this link
1186 // Default: LINK_TYPE_UNKNOWN
1187 optional android.bluetooth.LinkTypeEnum type = 4;
1188
1189 // Reason metadata for this link layer connection event, rules for interpretation:
1190 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1191 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1192 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1193 // set and valid, ignore hci_ble_event
1194
1195 // HCI command associated with this event
1196 // Default: CMD_UNKNOWN
1197 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1198 // HCI event associated with this event
1199 // Default: EVT_UNKNOWN
1200 optional android.bluetooth.hci.EventEnum hci_event = 6;
1201 // HCI BLE meta event associated with this event
1202 // Default: BLE_EVT_UNKNOWN
1203 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1204 // HCI command status code if this is triggerred by hci_cmd
1205 // Default: STATUS_UNKNOWN
1206 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1207 // HCI reason code associated with this event
1208 // Default: STATUS_UNKNOWN
1209 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1210}
1211
Jack He924f3462019-01-09 20:54:41 -08001212/**
1213 * Logs when there is a change in Bluetooth A2DP playback state
1214 *
1215 * Logged from:
1216 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1217 */
1218message BluetoothA2dpPlaybackStateChanged {
1219 // An identifier that can be used to match events for this device.
1220 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1221 // Salt: Randomly generated 256 bit value
1222 // Hash algorithm: HMAC-SHA256
1223 // Size: 32 byte
1224 // Default: null or empty if the device identifier is not known
1225 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1226 // Current playback state
1227 // Default: PLAYBACK_STATE_UNKNOWN
1228 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1229 // Current audio coding mode
1230 // Default: AUDIO_CODING_MODE_UNKNOWN
1231 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1232}
1233
1234/**
1235 * Logs when there is a change in A2DP codec config for a particular remote device
1236 *
1237 * Logged from:
1238 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1239 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1240 */
1241message BluetoothA2dpCodecConfigChanged {
1242 // An identifier that can be used to match events for this device.
1243 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1244 // Salt: Randomly generated 256 bit value
1245 // Hash algorithm: HMAC-SHA256
1246 // Size: 32 byte
1247 // Default: null or empty if the device identifier is not known
1248 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1249 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1250 // Default SOURCE_CODEC_TYPE_INVALID
1251 optional int32 codec_type = 2;
1252 // Codec priroity, the higher the more preferred, -1 for disabled
1253 // Default: CODEC_PRIORITY_DEFAULT
1254 optional int32 codec_priority = 3;
1255 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1256 // Default: SAMPLE_RATE_NONE
1257 optional int32 sample_rate = 4;
1258 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1259 // Default: BITS_PER_SAMPLE_NONE
1260 optional int32 bits_per_sample = 5;
1261 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1262 // Default: CHANNEL_MODE_NONE
1263 optional int32 channel_mode = 6;
1264 // Codec specific values
1265 // Default 0
1266 optional int64 codec_specific_1 = 7;
1267 optional int64 codec_specific_2 = 8;
1268 optional int64 codec_specific_3 = 9;
1269 optional int64 codec_specific_4 = 10;
1270}
1271
1272/**
1273 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1274 * Each codec's capability is logged separately due to statsd restriction
1275 *
1276 * Logged from:
1277 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1278 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1279 */
1280message BluetoothA2dpCodecCapabilityChanged {
1281 // An identifier that can be used to match events for this device.
1282 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1283 // Salt: Randomly generated 256 bit value
1284 // Hash algorithm: HMAC-SHA256
1285 // Size: 32 byte
1286 // Default: null or empty if the device identifier is not known
1287 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1288 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1289 // Default SOURCE_CODEC_TYPE_INVALID
1290 optional int32 codec_type = 2;
1291 // Codec priroity, the higher the more preferred, -1 for disabled
1292 // Default: CODEC_PRIORITY_DEFAULT
1293 optional int32 codec_priority = 3;
1294 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1295 // in BluetoothCodecConfig
1296 // Default: empty and SAMPLE_RATE_NONE for individual item
1297 optional int32 sample_rate = 4;
1298 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1299 // in BluetoothCodecConfig
1300 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1301 optional int32 bits_per_sample = 5;
1302 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1303 // BluetoothCodecConfig
1304 // Default: empty and CHANNEL_MODE_NONE for individual item
1305 optional int32 channel_mode = 6;
1306 // Codec specific values
1307 // Default 0
1308 optional int64 codec_specific_1 = 7;
1309 optional int64 codec_specific_2 = 8;
1310 optional int64 codec_specific_3 = 9;
1311 optional int64 codec_specific_4 = 10;
1312}
1313
1314/**
1315 * Logs when A2DP failed to read from PCM source.
1316 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1317 *
1318 * Logged from:
1319 * system/bt
1320 */
1321message BluetoothA2dpAudioUnderrunReported {
1322 // An identifier that can be used to match events for this device.
1323 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1324 // Salt: Randomly generated 256 bit value
1325 // Hash algorithm: HMAC-SHA256
1326 // Size: 32 byte
1327 // Default: null or empty if the device identifier is not known
1328 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1329 // Encoding interval in nanoseconds
1330 // Default: 0
1331 optional int64 encoding_interval_nanos = 2;
1332 // Number of bytes of PCM data that could not be read from the source
1333 // Default: 0
1334 optional int32 num_missing_pcm_bytes = 3;
1335}
1336
1337/**
1338 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1339 * buffer queue is full and we have to drop data
1340 *
1341 * Logged from:
1342 * system/bt
1343 */
1344message BluetoothA2dpAudioOverrunReported {
1345 // An identifier that can be used to match events for this device.
1346 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1347 // Salt: Randomly generated 256 bit value
1348 // Hash algorithm: HMAC-SHA256
1349 // Size: 32 byte
1350 // Default: null or empty if the device identifier is not known
1351 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1352 // Encoding interval in nanoseconds
1353 // Default: 0
1354 optional int64 encoding_interval_nanos = 2;
1355 // Number of buffers dropped in this event
1356 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1357 // Default: 0
1358 optional int32 num_dropped_buffers = 3;
1359 // Number of encoded buffers dropped in this event
1360 // Default 0
1361 optional int32 num_dropped_encoded_frames = 4;
1362 // Number of encoded bytes dropped in this event
1363 // Default: 0
1364 optional int32 num_dropped_encoded_bytes = 5;
1365}
1366
1367/**
1368 * Logs when we receive reports regarding a device's RSSI value
1369 *
1370 * Logged from:
1371 * system/bt
1372 */
1373message BluetoothDeviceRssiReported {
1374 // An identifier that can be used to match events for this device.
1375 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1376 // Salt: Randomly generated 256 bit value
1377 // Hash algorithm: HMAC-SHA256
1378 // Size: 32 byte
1379 // Default: null or empty if the device identifier is not known
1380 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1381 // Connection handle of this connection if available
1382 // Range: 0x0000 - 0x0EFF (12 bits)
1383 // Default: 0xFFFF if the handle is unknown
1384 optional int32 connection_handle = 2;
1385 // HCI command status code if this is triggerred by hci_cmd
1386 // Default: STATUS_UNKNOWN
1387 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1388 // BR/EDR
1389 // Range: -128 ≤ N ≤ 127 (signed integer)
1390 // Units: dB
1391 // LE:
1392 // Range: -127 to 20, 127 (signed integer)
1393 // Units: dBm
1394 // Invalid when an out of range value is reported
1395 optional int32 rssi = 4;
1396}
1397
1398/**
1399 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1400 *
1401 * Logged from:
1402 * system/bt
1403 */
1404message BluetoothDeviceFailedContactCounterReported {
1405 // An identifier that can be used to match events for this device.
1406 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1407 // Salt: Randomly generated 256 bit value
1408 // Hash algorithm: HMAC-SHA256
1409 // Size: 32 byte
1410 // Default: null or empty if the device identifier is not known
1411 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1412 // Connection handle of this connection if available
1413 // Range: 0x0000 - 0x0EFF (12 bits)
1414 // Default: 0xFFFF if the handle is unknown
1415 optional int32 connection_handle = 2;
1416 // HCI command status code if this is triggerred by hci_cmd
1417 // Default: STATUS_UNKNOWN
1418 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1419 // Number of consecutive failed contacts for a connection corresponding to the Handle
1420 // Range: uint16_t, 0-0xFFFF
1421 // Default: 0xFFFFF
1422 optional int32 failed_contact_counter = 4;
1423}
1424
1425/**
1426 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1427 *
1428 * Logged from:
1429 * system/bt
1430 */
1431message BluetoothDeviceTxPowerLevelReported {
1432 // An identifier that can be used to match events for this device.
1433 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1434 // Salt: Randomly generated 256 bit value
1435 // Hash algorithm: HMAC-SHA256
1436 // Size: 32 byte
1437 // Default: null or empty if the device identifier is not known
1438 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1439 // Connection handle of this connection if available
1440 // Range: 0x0000 - 0x0EFF (12 bits)
1441 // Default: 0xFFFF if the handle is unknown
1442 optional int32 connection_handle = 2;
Jack He4d6abe62019-01-20 21:22:46 -08001443 // HCI command status code if this is triggered by hci_cmd
Jack He924f3462019-01-09 20:54:41 -08001444 // Default: STATUS_UNKNOWN
1445 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1446 // Range: -30 ≤ N ≤ 20
1447 // Units: dBm
1448 // Invalid when an out of range value is reported
1449 optional int32 transmit_power_level = 4;
1450}
Jack He52260142018-12-18 15:43:27 -08001451
Tej Singh5d991e12018-03-09 19:48:11 -08001452/**
Jack He4d6abe62019-01-20 21:22:46 -08001453 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1454 * receiving an HCI command from the host
1455 *
1456 * Logged from: system/bt
1457 */
1458message BluetoothHciTimeoutReported {
1459 // HCI command associated with this event
1460 // Default: CMD_UNKNOWN
1461 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1462}
1463
1464/**
1465 * Logs when we receive Bluetooth Link Quality Report event from the controller
1466 * See Android Bluetooth HCI specification for more details
1467 *
1468 * Note: all count and bytes field are counted since last event
1469 *
1470 * Logged from: system/bt
1471 */
1472message BluetoothQualityReportReported {
1473 // Quality report ID
1474 // Original type: uint8_t
1475 // Default: BQR_ID_UNKNOWN
1476 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1477 // Packet type of the connection
1478 // Original type: uint8_t
1479 // Default: BQR_PACKET_TYPE_UNKNOWN
1480 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1481 // Connection handle of the connection
1482 // Original type: uint16_t
1483 optional int32 connection_handle = 3;
1484 // Performing Role for the connection
1485 // Original type: uint8_t
1486 optional int32 connection_role = 4;
1487 // Current Transmit Power Level for the connection. This value is the same as the controller's
1488 // response to the HCI_Read_Transmit_Power_Level HCI command
1489 // Original type: uint8_t
1490 optional int32 tx_power_level = 5;
1491 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1492 // absolute receiver signal strength value
1493 // Original type: int8_t
1494 optional int32 rssi = 6;
1495 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1496 // channels used by the link currently
1497 // Original type: uint8_t
1498 optional int32 snr = 7;
1499 // Indicates the number of unused channels in AFH_channel_map
1500 // Original type: uint8_t
1501 optional int32 unused_afh_channel_count = 8;
1502 // Indicates the number of the channels which are interfered and quality is bad but are still
1503 // selected for AFH
1504 // Original type: uint8_t
1505 optional int32 afh_select_unideal_channel_count = 9;
1506 // Current Link Supervision Timeout Setting
1507 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1508 // Original type: uint16_t
1509 optional int32 lsto = 10;
1510 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1511 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1512 // 0x01 (Piconet Clock)
1513 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1514 // Original type: uint32_t
1515 optional int64 connection_piconet_clock = 11;
1516 // The count of retransmission
1517 // Original type: uint32_t
1518 optional int64 retransmission_count = 12;
1519 // The count of no RX
1520 // Original type: uint32_t
1521 optional int64 no_rx_count = 13;
1522 // The count of NAK (Negative Acknowledge)
1523 // Original type: uint32_t
1524 optional int64 nak_count = 14;
1525 // Controller timestamp of last TX ACK
1526 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1527 // Original type: uint32_t
1528 optional int64 last_tx_ack_timestamp = 15;
1529 // The count of Flow-off (STOP)
1530 // Original type: uint32_t
1531 optional int64 flow_off_count = 16;
1532 // Controller timestamp of last Flow-on (GO)
1533 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1534 // Original type: uint32_t
1535 optional int64 last_flow_on_timestamp = 17;
1536 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1537 // Original type: uint32_t
1538 optional int64 buffer_overflow_bytes = 18;
1539 // Buffer underflow count (in byte) since last event
1540 // Original type: uint32_t
1541 optional int64 buffer_underflow_bytes = 19;
1542}
1543
1544/**
1545 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1546 *
1547 * Notes:
1548 * - Each event can be partially filled as we might learn different pieces of device
1549 * information at different time
1550 * - Multiple device info events can be combined to give more complete picture
1551 * - When multiple device info events tries to describe the same information, the
1552 * later one wins
1553 *
1554 * Logged from:
1555 * packages/apps/Bluetooth
1556 */
1557message BluetoothManufacturerInfoReported {
1558 // An identifier that can be used to match events for this device.
1559 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1560 // Salt: Randomly generated 256 bit value
1561 // Hash algorithm: HMAC-SHA256
1562 // Size: 32 byte
1563 // Default: null or empty if the device identifier is not known
1564 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1565 // Where is this device info obtained from
1566 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1567 // Name of the data source
1568 // For EXTERNAL: package name of the data source
1569 // For INTERNAL: null for general case, component name otherwise
1570 optional string source_name = 3;
1571 // Name of the manufacturer of this device
1572 optional string manufacturer = 4;
1573 // Model of this device
1574 optional string model = 5;
1575 // Hardware version of this device
1576 optional string hardware_version = 6;
1577 // Software version of this device
1578 optional string software_version = 7;
1579}
1580
1581/**
1582 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1583 * device, as documented by the Bluetooth Core HCI specification
1584 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1585 * Vol 2, Part E, Page 1118
1586 *
1587 * Logged from:
1588 * system/bt
1589 */
1590message BluetoothRemoteVersionInfoReported {
1591 // Connection handle of the connection
1592 // Original type: uint16_t
1593 optional int32 connection_handle = 1;
1594 // HCI command status code
1595 // Default: STATUS_UNKNOWN
1596 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1597 // 1 byte Version of current LMP in the remote controller
1598 optional int32 lmp_version = 3;
1599 // 2 bytes LMP manufacturer code of the remote controller
1600 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1601 optional int32 lmp_manufacturer_code = 4;
1602 // 4 bytes subversion of the LMP in the remote controller
1603 optional int32 lmp_subversion = 5;
1604}
1605
1606/**
1607 * Logs when certain Bluetooth SDP attributes are discovered
1608 * Constant definitions are from:
1609 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1610 *
1611 * Current logged attributes:
1612 * - BluetoothProfileDescriptorList
1613 * - Supported Features Bitmask
1614 *
1615 * Logged from:
1616 * system/bt
1617 */
1618message BluetoothSdpAttributeReported {
1619 // An identifier that can be used to match events for this device.
1620 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1621 // Salt: Randomly generated 256 bit value
1622 // Hash algorithm: HMAC-SHA256
1623 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1624 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1625 // Original type: uint16_t
1626 optional int32 protocol_uuid = 2;
1627 // Short form UUIDs used to identify Bluetooth SDP attribute types
1628 // Original type: uint16_t
1629 optional int32 attribute_id = 3;
1630 // Attribute value for the particular attribute
1631 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1632}
1633
1634/**
1635 * Logs when bond state of a Bluetooth device changes
1636 *
1637 * Logged from:
1638 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1639 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1640 */
1641message BluetoothBondStateChanged {
1642 // An identifier that can be used to match events for this device.
1643 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1644 // Salt: Randomly generated 256 bit value
1645 // Hash algorithm: HMAC-SHA256
1646 // Size: 32 byte
1647 // Default: null or empty if the device identifier is not known
1648 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1649 // Preferred transport type to remote dual mode device
1650 // Default: TRANSPORT_AUTO means no preference
1651 optional android.bluetooth.TransportTypeEnum transport = 2;
1652 // The type of this Bluetooth device (Classic, LE, or Dual mode)
1653 // Default: UNKNOWN
1654 optional android.bluetooth.DeviceTypeEnum type = 3;
1655 // Current bond state (NONE, BONDING, BONDED)
1656 // Default: BOND_STATE_UNKNOWN
1657 optional android.bluetooth.BondStateEnum bond_state = 4;
1658 // Bonding sub state
1659 // Default: BOND_SUB_STATE_UNKNOWN
1660 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
1661 // Unbond Reason
1662 // Default: UNBOND_REASON_UNKNOWN
1663 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
1664}
1665
1666/**
1667 * Logs there is an event related Bluetooth classic pairing
1668 *
1669 * Logged from:
1670 * system/bt
1671 */
1672message BluetoothClassicPairingEventReported {
1673 // An identifier that can be used to match events for this device.
1674 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1675 // Salt: Randomly generated 256 bit value
1676 // Hash algorithm: HMAC-SHA256
1677 // Size: 32 byte
1678 // Default: null or empty if the device identifier is not known
1679 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1680 // Connection handle of this connection if available
1681 // Range: 0x0000 - 0x0EFF (12 bits)
1682 // Default: 0xFFFF if the handle is unknown
1683 optional int32 connection_handle = 2;
1684 // HCI command associated with this event
1685 // Default: CMD_UNKNOWN
1686 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
1687 // HCI event associated with this event
1688 // Default: EVT_UNKNOWN
1689 optional android.bluetooth.hci.EventEnum hci_event = 4;
1690 // HCI command status code if this is triggerred by hci_cmd
1691 // Default: STATUS_UNKNOWN
1692 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
1693 // HCI reason code associated with this event
1694 // Default: STATUS_UNKNOWN
1695 optional android.bluetooth.hci.StatusEnum reason_code = 6;
1696}
1697
1698/**
1699 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
1700 *
1701 * Logged from:
1702 * system/bt
1703 */
1704message BluetoothSmpPairingEventReported {
1705 // An identifier that can be used to match events for this device.
1706 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1707 // Salt: Randomly generated 256 bit value
1708 // Hash algorithm: HMAC-SHA256
1709 // Size: 32 byte
1710 // Default: null or empty if the device identifier is not known
1711 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1712 // SMP command sent or received over L2CAP
1713 // Default: CMD_UNKNOWN
1714 optional android.bluetooth.smp.CommandEnum smp_command = 2;
1715 // Whether this command is sent or received
1716 // Default: DIRECTION_UNKNOWN
1717 optional android.bluetooth.DirectionEnum direction = 3;
1718 // SMP failure reason code
1719 // Default: PAIRING_FAIL_REASON_DEFAULT
1720 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
1721}
1722
1723/**
Jack He9c30c7c6b2019-01-30 17:24:55 -08001724 * Logs when a Bluetooth socket’s connection state changed
1725 *
1726 * Logged from:
1727 * system/bt
1728 */
1729message BluetoothSocketConnectionStateChanged {
1730 // An identifier that can be used to match events for this device.
1731 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1732 // Salt: Randomly generated 256 bit value
1733 // Hash algorithm: HMAC-SHA256
1734 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08001735 // Default: null or empty if this is a server listener socket
Jack He9c30c7c6b2019-01-30 17:24:55 -08001736 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08001737 // Temporary port of this socket for the current connection or session only
Jack He9c30c7c6b2019-01-30 17:24:55 -08001738 // Default 0 when unknown or don't care
1739 optional int32 port = 2;
1740 // Socket type as mentioned in
1741 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
1742 // Default: SOCKET_TYPE_UNKNOWN
1743 optional android.bluetooth.SocketTypeEnum type = 3;
1744 // Socket connection state
1745 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
1746 optional android.bluetooth.SocketConnectionstateEnum state = 4;
1747 // Number of bytes sent to remote device during this connection
1748 optional int64 tx_bytes = 5;
1749 // Number of bytes received from remote device during this connection
1750 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08001751 // Socket owner's UID
1752 optional int32 uid = 7 [(is_uid) = true];
1753 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
1754 // |port| must be spawned by |server_port|
1755 // Default 0 when unknown or don't care
1756 optional int32 server_port = 8;
1757 // Whether this is a server listener socket
1758 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He9c30c7c6b2019-01-30 17:24:55 -08001759}
1760
1761/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001762 * Logs when something is plugged into or removed from the USB-C connector.
1763 *
1764 * Logged from:
1765 * Vendor USB HAL.
1766 */
1767message UsbConnectorStateChanged {
1768 enum State {
1769 DISCONNECTED = 0;
1770 CONNECTED = 1;
1771 }
1772 optional State state = 1;
1773}
1774
1775/**
1776 * Logs the reported speaker impedance.
1777 *
1778 * Logged from:
1779 * Vendor audio implementation.
1780 */
1781message SpeakerImpedanceReported {
1782 optional int32 speaker_location = 1;
1783 optional int32 impedance = 2;
1784}
1785
1786/**
1787 * Logs the report of a failed hardware.
1788 *
1789 * Logged from:
1790 * Vendor HALs.
1791 *
1792 */
1793message HardwareFailed {
1794 enum HardwareType {
1795 HARDWARE_FAILED_UNKNOWN = 0;
1796 HARDWARE_FAILED_MICROPHONE = 1;
1797 HARDWARE_FAILED_CODEC = 2;
1798 HARDWARE_FAILED_SPEAKER = 3;
1799 HARDWARE_FAILED_FINGERPRINT = 4;
1800 }
1801 optional HardwareType hardware_type = 1;
1802
1803 /* hardware_location allows vendors to differentiate between multiple instances of
1804 * the same hardware_type. The specific locations are vendor defined integers,
1805 * referring to board-specific numbering schemes.
1806 */
1807 optional int32 hardware_location = 2;
1808
1809 /* failure_code is specific to the HardwareType of the failed hardware.
1810 * It should use the enum values defined below.
1811 */
1812 enum MicrophoneFailureCode {
1813 MICROPHONE_FAILURE_COMPLETE = 0;
1814 }
1815 enum CodecFailureCode {
1816 CODEC_FAILURE_COMPLETE = 0;
1817 }
1818 enum SpeakerFailureCode {
1819 SPEAKER_FAILURE_COMPLETE = 0;
1820 SPEAKER_FAILURE_HIGH_Z = 1;
1821 SPEAKER_FAILURE_SHORT = 2;
1822 }
1823 enum FingerprintFailureCode {
1824 FINGERPRINT_FAILURE_COMPLETE = 0;
1825 FINGERPRINT_SENSOR_BROKEN = 1;
1826 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1827 }
1828 optional int32 failure_code = 3;
1829}
1830
1831/**
1832 * Log an event when the device has been physically dropped.
1833 * Reported from the /vendor partition.
1834 */
1835message PhysicalDropDetected {
1836 // Confidence that the event was actually a drop, 0 -> 100
1837 optional int32 confidence_pctg = 1;
1838 // Peak acceleration of the drop, in 1/1000s of a g.
1839 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001840 // Duration of freefall in ms
1841 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001842}
1843
1844/**
1845 * Log bucketed battery charge cycles.
1846 *
1847 * Each bucket represents cycles of the battery past
1848 * a given charge point. For example, bucket 1 is the
1849 * lowest 1/8th of the battery, and bucket 8 is 100%.
1850 *
1851 * Logged from:
1852 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1853 */
1854message ChargeCyclesReported {
1855 optional int32 cycle_bucket_1 = 1;
1856 optional int32 cycle_bucket_2 = 2;
1857 optional int32 cycle_bucket_3 = 3;
1858 optional int32 cycle_bucket_4 = 4;
1859 optional int32 cycle_bucket_5 = 5;
1860 optional int32 cycle_bucket_6 = 6;
1861 optional int32 cycle_bucket_7 = 7;
1862 optional int32 cycle_bucket_8 = 8;
1863}
1864
1865/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001866 * Logs the duration of a davey (jank of >=700ms) when it occurs
1867 *
1868 * Logged from:
1869 * frameworks/base/libs/hwui/JankTracker.cpp
1870 */
1871message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001872 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001873 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001874
Tej Singhbb8554a2018-01-26 11:59:14 -08001875 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001876 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001877}
1878
1879/**
Bookatze5885242017-10-24 20:10:31 -07001880 * Logs phone signal strength changes.
1881 *
1882 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001883 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001884 */
1885message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001886 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1887 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001888}
1889
Yangster4ccebea2018-10-09 17:09:02 -07001890
1891/**
1892 * Logs when the phone state, sim state or signal strength changes
1893 *
1894 * Logged from:
1895 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1896 */
1897message PhoneServiceStateChanged {
1898 optional android.telephony.ServiceStateEnum state = 1;
1899 optional android.telephony.SimStateEnum sim_state = 2;
1900 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1901}
1902
1903/**
1904 * Logs when the phone becomes on or off.
1905 *
1906 * Logged from:
1907 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1908 */
1909message PhoneStateChanged {
1910 enum State {
1911 OFF = 0;
1912 ON = 1;
1913 }
1914 optional State state = 1;
1915}
1916
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001917message LauncherUIChanged {
Yao Chen046b5122018-10-24 14:09:20 -07001918 optional android.stats.launcher.LauncherAction action = 1;
1919 optional android.stats.launcher.LauncherState src_state = 2;
1920 optional android.stats.launcher.LauncherState dst_state = 3;
1921 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001922 optional bool is_swipe_up_enabled = 5;
1923}
1924
David Chenc28b2bb2017-10-24 12:52:52 -07001925/**
1926 * Logs that a setting was updated.
1927 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001928 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001929 * The tag and is_default allow resetting of settings to default values based on the specified
1930 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1931 */
1932message SettingChanged {
1933 // The name of the setting.
1934 optional string setting = 1;
1935
1936 // The change being imposed on this setting. May represent a number, eg "3".
1937 optional string value = 2;
1938
1939 // The new value of this setting. For most settings, this is same as value. For some settings,
1940 // value is +X or -X where X represents an element in a set. For example, if the previous value
1941 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1942 // The +/- feature is currently only used for location_providers_allowed.
1943 optional string new_value = 3;
1944
1945 // The previous value of this setting.
1946 optional string prev_value = 4;
1947
1948 // The tag used with the is_default for resetting sets of settings. This is generally null.
1949 optional string tag = 5;
1950
Bookatz90867622018-01-31 15:05:57 -08001951 // True if this setting with tag should be resettable.
1952 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001953
David Chenbd789912018-03-16 17:19:55 -07001954 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001955 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001956
1957 enum ChangeReason {
1958 UPDATED = 1; // Updated can be an insertion or an update.
1959 DELETED = 2;
1960 }
1961 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001962}
Chenjie Yub3dda412017-10-24 13:41:59 -07001963
Chenjie Yu05013b32017-11-21 10:21:41 -08001964/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001965 * Logs activity going to foreground or background
1966 *
1967 * Logged from:
1968 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1969 */
1970message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001971 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001972 optional string pkg_name = 2;
1973 optional string class_name = 3;
1974
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001975 enum State {
1976 BACKGROUND = 0;
1977 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001978 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001979 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001980}
David Chenc8a43242017-10-17 16:23:28 -07001981
1982/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001983 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001984 * Logged from:
1985 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1986 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001987message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001988 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001989
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001990 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001991
1992 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001993 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001994 optional string process_name = 3;
1995
1996 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001997 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001998
1999 optional string package_name = 5;
2000
2001 enum InstantApp {
2002 UNAVAILABLE = 0;
2003 FALSE = 1;
2004 TRUE = 2;
2005 }
2006 optional InstantApp is_instant_app = 6;
2007
2008 enum ForegroundState {
2009 UNKNOWN = 0;
2010 BACKGROUND = 1;
2011 FOREGROUND = 2;
2012 }
2013 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002014}
David Chen9e3808c2017-11-20 17:25:34 -08002015
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002016/**
2017 * Logs when a WTF (What a Terrible Failure) happened.
2018 * Logged from:
2019 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2020 */
2021message WTFOccurred {
2022 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002023
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002024 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002025
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002026 // The name of the process.
2027 // system_server if it is not by an app
2028 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002029
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002030 // The pid if available. -1 means not available.
2031 optional sint32 pid = 4;
2032}
2033
2034/**
2035 * Logs when system server reports low memory.
2036 * Logged from:
2037 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2038 */
2039message LowMemReported {
2040}
2041
2042/**
2043 * Logs when an app ANR (App Not Responding) occurs.
2044 * Logged from:
2045 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2046 */
2047message ANROccurred {
2048 optional int32 uid = 1 [(is_uid) = true];
2049
2050 optional string process_name = 2;
2051
2052 optional string short_component_name = 3;
2053
2054 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002055
2056 enum InstantApp {
2057 UNAVAILABLE = 0;
2058 FALSE = 1;
2059 TRUE = 2;
2060 }
2061 optional InstantApp is_instant_app = 5;
2062
2063 enum ForegroundState {
2064 UNKNOWN = 0;
2065 BACKGROUND = 1;
2066 FOREGROUND = 2;
2067 }
2068 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08002069}
2070
David Chen0a368b22017-12-06 16:28:16 -08002071/*
2072 * Allows other apps to push events into statsd.
2073 * Logged from:
2074 * frameworks/base/core/java/android/util/StatsLog.java
2075 */
David Chen0b5c90c2018-01-25 16:51:49 -08002076message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002077 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002078 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002079
2080 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2081 optional int32 label = 2;
2082
2083 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2084 // predicates for the metrics).
2085 enum State {
2086 UNKNOWN = 0;
2087 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2088 STOP = 2;
2089 START = 3;
2090 }
2091 optional State state = 3;
2092}
2093
David Chen9e3808c2017-11-20 17:25:34 -08002094/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002095 * Logs when statsd detects an anomaly.
2096 *
2097 * Logged from:
2098 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2099 */
2100message AnomalyDetected {
2101 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002102 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002103
Yangster-mac94e197c2018-01-02 16:03:03 -08002104 // Id of the config whose anomaly detection alert fired.
2105 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002106
Yangster-mac94e197c2018-01-02 16:03:03 -08002107 // Id of the alert (i.e. name of the anomaly that was detected).
2108 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002109}
2110
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002111message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002112 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002113 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002114
2115 // The app package name.
2116 optional string pkg_name = 2;
2117
2118 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002119 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002120 WARM = 1;
2121 HOT = 2;
2122 COLD = 3;
2123 }
2124 // The transition type.
2125 optional TransitionType type = 3;
2126
2127 // The activity name.
2128 optional string activity_name = 4;
2129
2130 // The name of the calling app. Empty if not set.
2131 optional string calling_pkg_name = 5;
2132
2133 // Whether the app is an instant app.
2134 optional bool is_instant_app = 6;
2135
2136 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002137 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002138
Bookatz80d11a02018-01-16 10:46:35 -08002139 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002140
David Chen0b5c90c2018-01-25 16:51:49 -08002141 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002142 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002143 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002144 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002145 optional int32 bind_application_delay_millis = 11;
2146 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002147
2148 // Empty if not set.
2149 optional string launch_token = 13;
2150
Calin Juravle759fbda2018-02-20 19:52:30 +00002151 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002152 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002153
2154 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002155 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002156}
2157
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002158message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002159 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002160 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002161
2162 // The app package name.
2163 optional string pkg_name = 2;
2164
2165 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002166 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002167 WARM = 1;
2168 HOT = 2;
2169 COLD = 3;
2170 }
2171 // The transition type.
2172 optional TransitionType type = 3;
2173
2174 // The activity name.
2175 optional string activity_name = 4;
2176}
2177
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002178message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002179 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002180 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002181
2182 // The app package name.
2183 optional string pkg_name = 2;
2184
2185 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002186 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002187 WITH_BUNDLE = 1;
2188 WITHOUT_BUNDLE = 2;
2189 }
2190 // The transition type.
2191 optional TransitionType type = 3;
2192
2193 // The activity name.
2194 optional string activity_name = 4;
2195
2196 optional bool transition_process_running = 5;
2197
2198 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002199 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002200}
2201
Bookatz8fcd09a2017-12-18 13:01:10 -08002202/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002203 * Logs a picture-in-picture action
2204 * Logged from:
2205 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2206 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2207 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2208 */
2209message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002210 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002211 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002212
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002213 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002214
Chenjie Yu52cacc62017-12-08 18:11:45 -08002215 enum State {
2216 ENTERED = 1;
2217 EXPANDED_TO_FULL_SCREEN = 2;
2218 MINIMIZED = 3;
2219 DISMISSED = 4;
2220 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002221 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002222}
2223
2224/**
Chenjie Yue8904192017-12-08 19:12:57 -08002225 * Logs overlay action
2226 * Logged from:
2227 * services/core/java/com/android/server/wm/Session.java
2228 */
2229message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002230 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002231
2232 optional string package_name = 2;
2233
2234 optional bool using_alert_window = 3;
2235
2236 enum State {
2237 ENTERED = 1;
2238 EXITED = 2;
2239 }
2240 optional State state = 4;
2241}
2242
Chenjie Yuccfe6452018-01-30 11:33:21 -08002243/*
2244 * Logs foreground service starts and stops.
2245 * Note that this is not when a service starts or stops, but when it is
2246 * considered foreground.
2247 * Logged from
2248 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2249 */
2250message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002251 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002252 // package_name + "/" + class_name
2253 optional string short_name = 2;
2254
2255 enum State {
2256 ENTER = 1;
2257 EXIT = 2;
2258 }
2259 optional State state = 3;
2260}
2261
Chenjie Yue8904192017-12-08 19:12:57 -08002262/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002263 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2264 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2265 * attributed back to the parent (host) uid. One example is Chrome.
2266 *
2267 * Logged from:
2268 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2269 */
2270message IsolatedUidChanged {
2271 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002272 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002273 optional int32 parent_uid = 1;
2274
2275 optional int32 isolated_uid = 2;
2276
2277 // We expect an isolated uid to be removed before if it's used for another parent uid.
2278 enum Event {
2279 REMOVED = 0;
2280 CREATED = 1;
2281 }
2282 optional Event event = 3;
2283}
2284
2285/*
2286 * Logs the reception of an incoming network packet causing the main system to wake up for
2287 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2288 * and processed by WakeupController.cpp.
2289 */
2290message PacketWakeupOccurred {
2291 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2292 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002293 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002294 // The interface name on which the packet was received.
2295 optional string iface = 2;
2296 // The ethertype value of the packet.
2297 optional int32 ethertype = 3;
2298 // String representation of the destination MAC address of the packet.
2299 optional string destination_hardware_address = 4;
2300 // String representation of the source address of the packet if this was an IP packet.
2301 optional string source_ip = 5;
2302 // String representation of the destination address of the packet if this was an IP packet.
2303 optional string destination_ip = 6;
2304 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2305 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2306 // families.
2307 optional int32 ip_next_header = 7;
2308 // The source port if this was a TCP or UDP packet.
2309 optional int32 source_port = 8;
2310 // The destination port if this was a TCP or UDP packet.
2311 optional int32 destination_port = 9;
2312}
2313
2314/*
2315 * Logs the memory stats for an app on startup.
2316 * Logged from:
2317 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2318 */
2319message AppStartMemoryStateCaptured {
2320 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002321 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002322
2323 // The process name.
2324 optional string process_name = 2;
2325
2326 // The activity name.
2327 optional string activity_name = 3;
2328
2329 // # of page-faults
2330 optional int64 pgfault = 4;
2331
2332 // # of major page-faults
2333 optional int64 pgmajfault = 5;
2334
2335 // RSS
2336 optional int64 rss_in_bytes = 6;
2337
2338 // CACHE
2339 optional int64 cache_in_bytes = 7;
2340
2341 // SWAP
2342 optional int64 swap_in_bytes = 8;
2343}
2344
2345/*
2346 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2347 * for LMK event.
2348 * Logged from:
2349 * system/core/lmkd/lmkd.c
2350 */
2351message LmkStateChanged {
2352 enum State {
2353 UNKNOWN = 0;
2354 START = 1;
2355 STOP = 2;
2356 }
2357 optional State state = 1;
2358}
2359
2360/*
2361 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2362 * Logged from:
2363 * system/core/lmkd/lmkd.c
2364 */
2365message LmkKillOccurred {
2366 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002367 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002368
2369 // The process name.
2370 optional string process_name = 2;
2371
2372 // oom adj score.
2373 optional int32 oom_score = 3;
2374
2375 // # of page-faults
2376 optional int64 pgfault = 4;
2377
2378 // # of major page-faults
2379 optional int64 pgmajfault = 5;
2380
2381 // RSS
2382 optional int64 rss_in_bytes = 6;
2383
2384 // CACHE
2385 optional int64 cache_in_bytes = 7;
2386
2387 // SWAP
2388 optional int64 swap_in_bytes = 8;
Jim Blackler972a5c52018-11-21 15:24:48 +00002389
2390 // The elapsed real time of start of the process.
2391 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002392}
2393
Rajeev Kumar51b54602018-03-01 12:18:26 -08002394/*
2395 * Logs when the ActivityManagerService detects that an app died.
2396 *
2397 * Logged from:
2398 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2399 */
2400message AppDied {
2401 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07002402 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002403}
2404
Chenjie Yubbcbc602018-02-05 16:51:52 -08002405//////////////////////////////////////////////////////////////////////
2406// Pulled atoms below this line //
2407//////////////////////////////////////////////////////////////////////
2408
2409/**
David Chenc8a43242017-10-17 16:23:28 -07002410 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2411 *
2412 * Pulled from:
2413 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2414 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002415message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002416 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002417
2418 optional int64 rx_bytes = 2;
2419
2420 optional int64 rx_packets = 3;
2421
2422 optional int64 tx_bytes = 4;
2423
2424 optional int64 tx_packets = 5;
2425}
2426
2427/**
2428 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2429 *
2430 * Pulled from:
2431 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2432 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002433message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002434 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002435
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002436 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2437 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/**
2449 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2450 *
2451 * Pulled from:
2452 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2453 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002454message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002455 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002456
2457 optional int64 rx_bytes = 2;
2458
2459 optional int64 rx_packets = 3;
2460
2461 optional int64 tx_bytes = 4;
2462
2463 optional int64 tx_packets = 5;
2464}
2465
2466/**
2467 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2468 *
2469 * Pulled from:
2470 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2471 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002472message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002473 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002474
Yao Chenc40a19d2018-03-15 16:48:25 -07002475 // 1 denotes foreground and 0 denotes background. This is called Set in
2476 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002477 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002478
2479 optional int64 rx_bytes = 3;
2480
2481 optional int64 rx_packets = 4;
2482
2483 optional int64 tx_bytes = 5;
2484
2485 optional int64 tx_packets = 6;
2486}
2487
2488/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002489 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2490 *
2491 * Pulled from:
2492 * StatsCompanionService
2493 */
2494message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002495 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002496
2497 optional int64 rx_bytes = 2;
2498
2499 optional int64 tx_bytes = 3;
2500}
2501
2502/**
David Chenc8a43242017-10-17 16:23:28 -07002503 * Pulls the kernel wakelock durations. This atom is adapted from
2504 * android/internal/os/KernelWakelockStats.java
2505 *
2506 * Pulled from:
2507 * StatsCompanionService using KernelWakelockReader.
2508 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002509message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002510 optional string name = 1;
2511
2512 optional int32 count = 2;
2513
2514 optional int32 version = 3;
2515
2516 optional int64 time = 4;
2517}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002518
Chenjie Yu05013b32017-11-21 10:21:41 -08002519/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002520 * Pulls low power state information. This includes platform and subsystem sleep state information,
2521 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002522 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002523 * hardware/interfaces/power/1.1/types.hal
2524 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002525message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002526 // Subsystem name
2527 optional string subsystem_name = 1;
2528 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2529 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2530 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002531 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002532 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002533 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002534 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002535}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002536
Chenjie Yu05013b32017-11-21 10:21:41 -08002537/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002538 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002539 * Pulls the time the cpu spend on the frequency index. Frequency index
2540 * starts from highest to lowest. The value should be monotonically
2541 * increasing since boot. However, if there is a cpu
2542 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002543 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002544message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002545 optional uint32 cluster = 1;
2546 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002547 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002548}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002549
Chenjie Yu05013b32017-11-21 10:21:41 -08002550/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002551 * Pulls Cpu Time Per Uid.
2552 * Note that isolated process uid time should be attributed to host uids.
2553 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002554message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002555 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002556 optional uint64 user_time_micros = 2;
2557 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002558}
2559
2560/**
2561 * Pulls Cpu Time Per Uid per frequency.
2562 * Note that isolated process uid time should be attributed to host uids.
2563 * For each uid, we order the time by descending frequencies.
2564 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002565message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002566 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002567 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002568 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002569}
Hugo Benichi884970e2017-11-14 22:42:46 +09002570
Chenjie Yu05013b32017-11-21 10:21:41 -08002571/**
2572 * Pulls Wifi Controller Activity Energy Info
2573 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002574message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002575 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002576 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002577 // stack reported state
2578 // TODO: replace this with proto enum
2579 optional int32 stack_state = 2;
2580 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002581 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002582 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002583 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002584 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002585 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002586 // product of current(mA), voltage(V) and time(ms)
2587 optional uint64 controller_energy_used = 6;
2588}
2589
2590/**
2591 * Pulls Modem Activity Energy Info
2592 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002593message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002594 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002595 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002596 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08002597 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08002598 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002599 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002600 /**
2601 * Tx power index
2602 * index 0 = tx_power < 0dBm
2603 * index 1 = 0dBm < tx_power < 5dBm
2604 * index 2 = 5dBm < tx_power < 15dBm
2605 * index 3 = 15dBm < tx_power < 20dBm
2606 * index 4 = tx_power > 20dBm
2607 */
2608 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002609 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002610 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002611 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002612 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002613 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002614 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002615 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002616 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002617 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002618 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002619 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002620 // product of current(mA), voltage(V) and time(ms)
2621 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002622}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002623
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002624/**
2625 * Pulls Bluetooth Activity Energy Info
2626 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2627 */
2628message BluetoothActivityInfo {
2629 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002630 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002631 // bluetooth stack state
2632 optional int32 bluetooth_stack_state = 2;
2633 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002634 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002635 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002636 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002637 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002638 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002639 // product of current(mA), voltage(V) and time(ms)
2640 optional uint64 energy_used = 6;
2641}
2642
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002643/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002644 * Logs the memory stats for a process.
2645 */
2646message ProcessMemoryState {
2647 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002648 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002649
2650 // The process name.
2651 optional string process_name = 2;
2652
2653 // oom adj score.
2654 optional int32 oom_score = 3;
2655
2656 // # of page-faults
2657 optional int64 pgfault = 4;
2658
2659 // # of major page-faults
2660 optional int64 pgmajfault = 5;
2661
Rajeev Kumar90235992018-01-29 11:06:48 -08002662 // RSS
2663 optional int64 rss_in_bytes = 6;
2664
2665 // CACHE
2666 optional int64 cache_in_bytes = 7;
2667
2668 // SWAP
2669 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002670}
2671
2672/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002673 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002674 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002675message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002676 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002677}
2678
2679/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002680 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002681 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002682message SystemUptime {
2683 // Milliseconds since the system was booted.
2684 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2685 // for external input).
2686 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002687 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002688}
2689
2690/*
2691 * Reads from /proc/uid_concurrent_active_time which has the format:
2692 * active: X (X is # cores)
2693 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2694 * [uid1]: [time-0] [time-1] [time-2] ... ...
2695 * ...
2696 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2697 * The file contains a monotonically increasing count of time for a single boot.
2698 */
2699message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002700 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002701 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002702}
2703
2704/**
2705 * Reads from /proc/uid_concurrent_policy_time which has the format:
2706 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2707 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2708 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2709 * ...
2710 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2711 * The file contains a monotonically increasing count of time for a single boot.
2712 */
2713message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002714 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002715 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002716 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002717}
2718
2719/*
2720 * Pulls free disk space, for data, system partition and temporary directory.
2721 */
2722message DiskSpace {
2723 // available bytes in data partition
2724 optional uint64 data_available_bytes = 1;
2725 // available bytes in system partition
2726 optional uint64 system_available_bytes = 2;
2727 // available bytes in download cache or temp directories
2728 optional uint64 temp_available_bytes = 3;
2729}
Tej Singhbf972d92018-01-10 20:51:13 -08002730
2731/**
2732 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002733 * Pulled from:
2734 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002735 */
2736message RemainingBatteryCapacity {
2737 optional int32 charge_uAh = 1;
2738}
2739
2740/**
2741 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002742 * Pulled from:
2743 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002744 */
2745message FullBatteryCapacity {
2746 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08002747}
2748
2749/**
Tej Singhd89137e2018-03-26 14:51:40 -07002750 * Pulls the temperature of various parts of the device.
2751 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002752 *
2753 * Pulled from:
2754 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2755 */
2756message Temperature {
2757 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2758 optional android.os.TemperatureTypeEnum sensor_location = 1;
2759
2760 // The name of the temperature source. Eg. CPU0
2761 optional string sensor_name = 2;
2762
Tej Singhd89137e2018-03-26 14:51:40 -07002763 // Temperature in tenths of a degree C.
2764 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08002765}
lifr35a7cf02018-12-12 16:38:04 +08002766
2767/**
2768 * Logs the latency period(in microseconds) and the return code of
2769 * the DNS(Domain Name System) lookups.
2770 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
2771 * to get info(address or hostname) from DNS server(or DNS cache).
2772 * Logged from:
2773 * /system/netd/server/DnsProxyListener.cpp
2774 */
2775message NetworkDnsEventReported {
2776 // The types of the DNS lookups, as defined in
2777 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
2778 enum EventType {
2779 EVENT_UNKNOWN = 0;
2780 EVENT_GETADDRINFO = 1;
2781 EVENT_GETHOSTBYNAME = 2;
2782 EVENT_GETHOSTBYADDR = 3;
2783 EVENT_RES_NSEND = 4;
2784 }
2785 optional EventType event_type = 1;
2786
2787 // The return value of the DNS resolver for each DNS lookups.
2788 //bionic/libc/include/netdb.h
2789 //system/netd/resolv/include/netd_resolv/resolv.h
2790 enum ReturnCode {
2791 EAI_NO_ERROR = 0;
2792 EAI_ADDRFAMILY = 1;
2793 EAI_AGAIN = 2;
2794 EAI_BADFLAGS = 3;
2795 EAI_FAIL = 4;
2796 EAI_FAMILY = 5;
2797 EAI_MEMORY = 6;
2798 EAI_NODATA = 7;
2799 EAI_NONAME = 8;
2800 EAI_SERVICE = 9;
2801 EAI_SOCKTYPE = 10;
2802 EAI_SYSTEM = 11;
2803 EAI_BADHINTS = 12;
2804 EAI_PROTOCOL = 13;
2805 EAI_OVERFLOW = 14;
2806 RESOLV_TIMEOUT = 255;
2807 EAI_MAX = 256;
2808 }
2809 optional ReturnCode return_code = 2;
2810
2811 // The latency period(in microseconds) it took for this DNS lookup to complete.
2812 optional int32 latency_micros = 3;
2813}
2814
Chiachang Wang67f24472019-01-15 15:14:00 +08002815/**
2816 * Logs when a data stall event occurs.
2817 *
2818 * Log from:
2819 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2820 */
2821message DataStallEvent {
2822 // Data stall evaluation type.
2823 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2824 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
2825 optional int32 evaluation_type = 1;
2826 // See definition in data_stall_event.proto.
2827 optional com.android.server.connectivity.ProbeResult validation_result = 2;
2828 // See definition in data_stall_event.proto.
2829 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
2830 // See definition in data_stall_event.proto.
2831 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
2832 // See definition in data_stall_event.proto.
2833 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
2834 // See definition in data_stall_event.proto.
2835 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
2836}
Jack Yu6d421bc2019-01-23 17:42:54 +08002837
2838/**
2839 * Logs when a NFC device's error occurred.
2840 * Logged from:
2841 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2842 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
2843 */
2844message NfcErrorOccurred {
2845 enum Type {
2846 UNKNOWN = 0;
2847 CMD_TIMEOUT = 1;
2848 ERROR_NOTIFICATION = 2;
2849 AID_OVERFLOW = 3;
2850 }
2851 optional Type type = 1;
2852 // If it's nci cmd timeout, log the timeout command.
2853 optional uint32 nci_cmd = 2;
2854
2855 optional uint32 error_ntf_status_code = 3;
2856}
2857
2858/**
2859 * Logs when a NFC device's state changed event
2860 * Logged from:
2861 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
2862 */
2863message NfcStateChanged {
2864 enum State {
2865 UNKNOWN = 0;
2866 OFF = 1;
2867 ON = 2;
2868 ON_LOCKED = 3; // Secure Nfc enabled.
2869 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
2870 }
2871 optional State state = 1;
2872}
2873
2874/**
2875 * Logs when a NFC Beam Transaction occurred.
2876 * Logged from:
2877 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
2878 */
2879message NfcBeamOccurred {
2880 enum Operation {
2881 UNKNOWN = 0;
2882 SEND = 1;
2883 RECEIVE = 2;
2884 }
2885 optional Operation operation = 1;
2886}
2887
2888/**
2889 * Logs when a NFC Card Emulation Transaction occurred.
2890 * Logged from:
2891 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
2892 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
2893 */
2894message NfcCardemulationOccurred {
2895 enum Category {
2896 UNKNOWN = 0;
2897 HCE_PAYMENT = 1;
2898 HCE_OTHER = 2;
2899 OFFHOST = 3;
2900 }
2901 // Transaction belongs to HCE payment or HCE other category, or offhost.
2902 optional Category category = 1;
2903 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
2904 optional string se_name = 2;
2905}
2906
2907/**
2908 * Logs when a NFC Tag event occurred.
2909 * Logged from:
2910 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
2911 */
2912message NfcTagOccurred {
2913 enum Type {
2914 UNKNOWN = 0;
2915 URL = 1;
2916 BT_PAIRING = 2;
2917 PROVISION = 3;
2918 WIFI_CONNECT = 4;
2919 APP_LAUNCH = 5;
2920 OTHERS = 6;
2921 }
2922 optional Type type = 1;
2923}
2924
2925/**
2926 * Logs when Hce transaction triggered
2927 * Logged from:
2928 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2929 */
2930message NfcHceTransactionOccurred {
2931 // The latency period(in microseconds) it took for the first HCE data
2932 // exchange.
2933 optional uint32 latency_micros = 1;
2934}
2935
2936/**
2937 * Logs when SecureElement state event changed
2938 * Logged from:
2939 * packages/apps/SecureElement/src/com/android/se/Terminal.java
2940 */
2941message SeStateChanged {
2942 enum State {
2943 UNKNOWN = 0;
2944 INITIALIZED = 1;
2945 DISCONNECTED = 2;
2946 CONNECTED = 3;
2947 HALCRASH = 4;
2948 }
2949 optional State state = 1;
2950
2951 optional string state_change_reason = 2;
2952 // SIMx or eSEx.
2953 optional string terminal = 3;
2954}
2955
2956/**
2957 * Logs when Omapi API used
2958 * Logged from:
2959 * packages/apps/SecureElement/src/com/android/se/Terminal.java
2960 */
2961message SeOmapiReported {
2962 enum Operation {
2963 UNKNOWN = 0;
2964 OPEN_CHANNEL = 1;
2965 }
2966 optional Operation operation = 1;
2967 // SIMx or eSEx.
2968 optional string terminal = 2;
2969
2970 optional string package_name = 3;
2971}
Hui Yuf57e4012019-02-13 12:29:38 -08002972
2973/*
2974* Logs number of milliseconds it takes to start a process.
2975* The definition of app process start time is from the app launch time to
2976* the time that Zygote finished forking the app process and loaded the
2977* application package's java classes.
2978
2979* This metric is different from AppStartOccurred which is for foreground
2980* activity only.
2981
2982* ProcessStartTime can report all processes (both foreground and background)
2983* start time.
2984*
2985* Logged from:
2986* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2987*/
2988message ProcessStartTime {
2989 // The uid of the ProcessRecord.
2990 optional int32 uid = 1 [(is_uid) = true];
2991
2992 // The process pid.
2993 optional int32 pid = 2;
2994
2995 // The process name.
2996 // Usually package name, "system" for system server.
2997 // Provided by ActivityManagerService.
2998 optional string process_name = 3;
2999
3000 enum StartType {
3001 UNKNOWN = 0;
3002 WARM = 1;
3003 HOT = 2;
3004 COLD = 3;
3005 }
3006
3007 // The start type.
3008 optional StartType type = 4;
3009
3010 // The elapsed realtime at the start of the process.
3011 optional int64 process_start_time_millis = 5;
3012
3013 // Number of milliseconds it takes to reach bind application.
3014 optional int32 bind_application_delay_millis = 6;
3015
3016 // Number of milliseconds it takes to finish start of the process.
3017 optional int32 process_start_delay_millis = 7;
3018
3019 // hostingType field in ProcessRecord, the component type such as "activity",
3020 // "service", "content provider", "broadcast" or other strings.
3021 optional string hosting_type = 8;
3022
3023 // hostingNameStr field in ProcessRecord. The component class name that runs
3024 // in this process.
3025 optional string hosting_name = 9;
3026}
3027