Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | syntax = "proto2"; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 18 | |
| 19 | package android.os.statsd; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 20 | option java_package = "com.android.os"; |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 21 | option java_outer_classname = "AtomsProto"; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 22 | |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 23 | import "frameworks/base/cmds/statsd/src/atom_field_options.proto"; |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 24 | import "frameworks/base/core/proto/android/app/enums.proto"; |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 25 | import "frameworks/base/core/proto/android/app/job/enums.proto"; |
Jack He | 924f346 | 2019-01-09 20:54:41 -0800 | [diff] [blame] | 26 | import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto"; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 27 | import "frameworks/base/core/proto/android/bluetooth/enums.proto"; |
Jack He | 5226014 | 2018-12-18 15:43:27 -0800 | [diff] [blame] | 28 | import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto"; |
Jack He | 22e4a1d | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 29 | import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto"; |
Jack He | 4d6abe6 | 2019-01-20 21:22:46 -0800 | [diff] [blame] | 30 | import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto"; |
Chiachang Wang | 67f2447 | 2019-01-15 15:14:00 +0800 | [diff] [blame] | 31 | import "frameworks/base/core/proto/android/net/networkcapabilities.proto"; |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 32 | import "frameworks/base/core/proto/android/os/enums.proto"; |
Chiachang Wang | 67f2447 | 2019-01-15 15:14:00 +0800 | [diff] [blame] | 33 | import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto"; |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 34 | import "frameworks/base/core/proto/android/server/enums.proto"; |
Yao Chen | 046b512 | 2018-10-24 14:09:20 -0700 | [diff] [blame] | 35 | import "frameworks/base/core/proto/android/stats/launcher/launcher.proto"; |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 36 | import "frameworks/base/core/proto/android/telecomm/enums.proto"; |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 37 | import "frameworks/base/core/proto/android/telephony/enums.proto"; |
| 38 | import "frameworks/base/core/proto/android/view/enums.proto"; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 39 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 40 | /** |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 41 | * The master atom class. This message defines all of the available |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 42 | * 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 Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 49 | * This Atom class is not actually built into the Android system. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 50 | * Instead, statsd on Android constructs these messages synthetically, |
| 51 | * in the format defined here and in stats_log.proto. |
| 52 | */ |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 53 | message Atom { |
| 54 | // Pushed atoms start at 2. |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 55 | oneof pushed { |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 56 | // For StatsLog reasons, 1 is illegal and will not work. Must start at 2. |
| 57 | BleScanStateChanged ble_scan_state_changed = 2; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 58 | // 3 is available for use |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 59 | BleScanResultReceived ble_scan_result_received = 4; |
| 60 | SensorStateChanged sensor_state_changed = 5; |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 61 | GpsScanStateChanged gps_scan_state_changed = 6; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 62 | SyncStateChanged sync_state_changed = 7; |
| 63 | ScheduledJobStateChanged scheduled_job_state_changed = 8; |
| 64 | ScreenBrightnessChanged screen_brightness_changed = 9; |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 65 | WakelockStateChanged wakelock_state_changed = 10; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 66 | LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11; |
| 67 | MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12; |
| 68 | WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13; |
Hyunyoung Song | cc651c1 | 2018-10-17 13:35:32 -0700 | [diff] [blame] | 69 | // 14 - 18 are available |
| 70 | LauncherUIChanged launcher_event = 19; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 71 | BatterySaverModeStateChanged battery_saver_mode_state_changed = 20; |
| 72 | DeviceIdleModeStateChanged device_idle_mode_state_changed = 21; |
| 73 | DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 74 | AudioStateChanged audio_state_changed = 23; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 75 | MediaCodecStateChanged media_codec_state_changed = 24; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 76 | 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; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 81 | BatteryLevelChanged battery_level_changed = 30; |
| 82 | ChargingStateChanged charging_state_changed = 31; |
| 83 | PluggedStateChanged plugged_state_changed = 32; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 84 | // 33 - 34 are available |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 85 | WakeupAlarmOccurred wakeup_alarm_occurred = 35; |
| 86 | KernelWakeupReported kernel_wakeup_reported = 36; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 87 | 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 Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 91 | SettingChanged setting_changed = 41; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 92 | ActivityForegroundStateChanged activity_foreground_state_changed = 42; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 93 | IsolatedUidChanged isolated_uid_changed = 43; |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 94 | PacketWakeupOccurred packet_wakeup_occurred = 44; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 95 | // 45 is available |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 96 | AnomalyDetected anomaly_detected = 46; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 97 | AppBreadcrumbReported app_breadcrumb_reported = 47; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 98 | AppStartOccurred app_start_occurred = 48; |
| 99 | AppStartCanceled app_start_canceled = 49; |
| 100 | AppStartFullyDrawn app_start_fully_drawn = 50; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 101 | LmkKillOccurred lmk_kill_occurred = 51; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 102 | PictureInPictureStateChanged picture_in_picture_state_changed = 52; |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 103 | WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 104 | LmkStateChanged lmk_state_changed = 54; |
| 105 | AppStartMemoryStateCaptured app_start_memory_state_captured = 55; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 106 | ShutdownSequenceReported shutdown_sequence_reported = 56; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 107 | BootSequenceReported boot_sequence_reported = 57; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 108 | DaveyOccurred davey_occurred = 58; |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 109 | OverlayStateChanged overlay_state_changed = 59; |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 110 | ForegroundServiceStateChanged foreground_service_state_changed = 60; |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 111 | CallStateChanged call_state_changed = 61; |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 112 | KeyguardStateChanged keyguard_state_changed = 62; |
| 113 | KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63; |
| 114 | KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 115 | AppDied app_died = 65; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 116 | ResourceConfigurationChanged resource_configuration_changed = 66; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 117 | BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67; |
| 118 | BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68; |
Tej Singh | 02200f9 | 2018-04-02 19:37:59 -0700 | [diff] [blame] | 119 | // 69 is blank but need not be. |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 120 | UsbConnectorStateChanged usb_connector_state_changed = 70; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 121 | SpeakerImpedanceReported speaker_impedance_reported = 71; |
| 122 | HardwareFailed hardware_failed = 72; |
| 123 | PhysicalDropDetected physical_drop_detected = 73; |
| 124 | ChargeCyclesReported charge_cycles_reported = 74; |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 125 | MobileConnectionStateChanged mobile_connection_state_changed = 75; |
| 126 | MobileRadioTechnologyChanged mobile_radio_technology_changed = 76; |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 127 | UsbDeviceAttached usb_device_attached = 77; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 128 | AppCrashOccurred app_crash_occurred = 78; |
| 129 | ANROccurred anr_occurred = 79; |
| 130 | WTFOccurred wtf_occurred = 80; |
Yangster | 4ccebea | 2018-10-09 17:09:02 -0700 | [diff] [blame] | 131 | PhoneServiceStateChanged phone_service_state_changed = 94; |
| 132 | PhoneStateChanged phone_state_changed = 95; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 133 | LowMemReported low_mem_reported = 81; |
lifr | 35a7cf0 | 2018-12-12 16:38:04 +0800 | [diff] [blame] | 134 | NetworkDnsEventReported network_dns_event_reported = 116; |
Chiachang Wang | 67f2447 | 2019-01-15 15:14:00 +0800 | [diff] [blame] | 135 | DataStallEvent data_stall_event = 121; |
Jack He | 5226014 | 2018-12-18 15:43:27 -0800 | [diff] [blame] | 136 | BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125; |
Jack He | 22e4a1d | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 137 | BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126; |
| 138 | BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127; |
Jack Yu | 6d421bc | 2019-01-23 17:42:54 +0800 | [diff] [blame] | 139 | 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 He | 924f346 | 2019-01-09 20:54:41 -0800 | [diff] [blame] | 147 | 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 He | 4d6abe6 | 2019-01-20 21:22:46 -0800 | [diff] [blame] | 156 | 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; |
Jack He | 9c30c7c6b | 2019-01-30 17:24:55 -0800 | [diff] [blame] | 164 | BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 165 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 166 | |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 167 | // Pulled events will start at field 10000. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 168 | // Next: 10022 |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 169 | oneof pulled { |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 170 | WifiBytesTransfer wifi_bytes_transfer = 10000; |
| 171 | WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001; |
| 172 | MobileBytesTransfer mobile_bytes_transfer = 10002; |
| 173 | MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 174 | BluetoothBytesTransfer bluetooth_bytes_transfer = 10006; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 175 | KernelWakelock kernel_wakelock = 10004; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 176 | SubsystemSleepState subsystem_sleep_state = 10005; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 177 | CpuTimePerFreq cpu_time_per_freq = 10008; |
| 178 | CpuTimePerUid cpu_time_per_uid = 10009; |
| 179 | CpuTimePerUidFreq cpu_time_per_uid_freq = 10010; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 180 | WifiActivityInfo wifi_activity_info = 10011; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 181 | ModemActivityInfo modem_activity_info = 10012; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 182 | BluetoothActivityInfo bluetooth_activity_info = 10007; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 183 | ProcessMemoryState process_memory_state = 10013; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 184 | SystemElapsedRealtime system_elapsed_realtime = 10014; |
| 185 | SystemUptime system_uptime = 10015; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 186 | CpuActiveTime cpu_active_time = 10016; |
| 187 | CpuClusterTime cpu_cluster_time = 10017; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame] | 188 | DiskSpace disk_space = 10018; |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 189 | RemainingBatteryCapacity remaining_battery_capacity = 10019; |
| 190 | FullBatteryCapacity full_battery_capacity = 10020; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 191 | Temperature temperature = 10021; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 192 | } |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 193 | |
Bookatz | 76aafcf | 2018-09-17 16:17:10 -0700 | [diff] [blame] | 194 | // DO NOT USE field numbers above 100,000 in AOSP. |
| 195 | // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use. |
| 196 | // Field numbers 200,000 and above are reserved for future use; do not use them at all. |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 197 | } |
| 198 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 199 | /** |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 200 | * This proto represents a node of an attribution chain. |
| 201 | * Note: All attribution chains are represented as a repeated field of type |
| 202 | * AttributionNode. It is understood that in such arrays, the order is that |
| 203 | * of calls, that is [A, B, C] if A calls B that calls C. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 204 | */ |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 205 | message AttributionNode { |
| 206 | // The uid for a given element in the attribution chain. |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 207 | optional int32 uid = 1; |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 208 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 209 | // The (optional) string tag for an element in the attribution chain. If the |
| 210 | // element has no tag, it is encoded as an empty string. |
| 211 | optional string tag = 2; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 212 | } |
| 213 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 214 | /* |
| 215 | * ***************************************************************************** |
yro | de4ca10 | 2017-11-15 22:57:24 -0800 | [diff] [blame] | 216 | * Below are all of the individual atoms that are logged by Android via statsd. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 217 | * |
| 218 | * RULES: |
| 219 | * - The field ids for each atom must start at 1, and count upwards by 1. |
| 220 | * Skipping field ids is not allowed. |
| 221 | * - These form an API, so renaming, renumbering or removing fields is |
| 222 | * not allowed between android releases. (This is not currently enforced, |
| 223 | * but there will be a tool to enforce this restriction). |
| 224 | * - The types must be built-in protocol buffer types, namely, no sub-messages |
| 225 | * are allowed (yet). The bytes type is also not allowed. |
| 226 | * - The CamelCase name of the message type should match the |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 227 | * underscore_separated name as defined in Atom. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 228 | * - If an atom represents work that can be attributed to an app, there can |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 229 | * be exactly one AttributionChain field. It must be field number 1. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 230 | * - A field that is a uid should be a string field, tagged with the [xxx] |
| 231 | * annotation. The generated code on android will be represented by UIDs, |
| 232 | * and those UIDs will be translated in xxx to those strings. |
| 233 | * |
| 234 | * CONVENTIONS: |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 235 | * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 236 | * - If there is a UID, it goes first. Think in an object-oriented fashion. |
| 237 | * ***************************************************************************** |
| 238 | */ |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 239 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 240 | /** |
| 241 | * Logs when the screen state changes. |
| 242 | * |
| 243 | * Logged from: |
| 244 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 245 | */ |
| 246 | message ScreenStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 247 | // New screen state, from frameworks/base/core/proto/android/view/enums.proto. |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 248 | optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE]; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 249 | } |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 250 | |
| 251 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 252 | * Logs that the state of a process state, as per the activity manager, has changed. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 253 | * |
| 254 | * Logged from: |
| 255 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 256 | */ |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 257 | message UidProcessStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 258 | optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 259 | |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 260 | // The state, from frameworks/base/core/proto/android/app/enums.proto. |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 261 | optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 265 | * Logs that a process started, finished, crashed, or ANRed. |
| 266 | * |
| 267 | * Logged from: |
| 268 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 269 | */ |
| 270 | message ProcessLifeCycleStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 271 | optional int32 uid = 1 [(is_uid) = true]; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 272 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 273 | // The process name (usually same as the app name). |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 274 | optional string process_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 275 | |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 276 | // What lifecycle state the process changed to. |
| 277 | // This enum is specific to atoms.proto. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 278 | enum State { |
| 279 | FINISHED = 0; |
| 280 | STARTED = 1; |
| 281 | CRASHED = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 282 | } |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 283 | optional State state = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 284 | } |
| 285 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 286 | /** |
| 287 | * Logs when the ble scan state changes. |
| 288 | * |
| 289 | * Logged from: |
Bookatz | 17a879d | 2018-03-28 15:05:28 -0700 | [diff] [blame] | 290 | * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 291 | */ |
| 292 | message BleScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 293 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 294 | |
| 295 | enum State { |
| 296 | OFF = 0; |
| 297 | ON = 1; |
Bookatz | e5ec0b4 | 2018-03-26 13:34:56 -0700 | [diff] [blame] | 298 | // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes). |
| 299 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 300 | } |
| 301 | optional State state = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 302 | |
Bookatz | e5ec0b4 | 2018-03-26 13:34:56 -0700 | [diff] [blame] | 303 | // Does the scan have a filter. |
| 304 | optional bool is_filtered = 3; |
| 305 | // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally. |
| 306 | optional bool is_first_match = 4; |
| 307 | // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC). |
| 308 | optional bool is_opportunistic = 5; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 309 | } |
| 310 | |
| 311 | /** |
| 312 | * Logs reporting of a ble scan finding results. |
| 313 | * |
| 314 | * Logged from: |
Bookatz | ae6738e | 2018-09-13 11:38:56 -0700 | [diff] [blame] | 315 | * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 316 | */ |
Bookatz | ae6738e | 2018-09-13 11:38:56 -0700 | [diff] [blame] | 317 | // TODO: Consider also tracking per-scanner-id. |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 318 | message BleScanResultReceived { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 319 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 320 | |
| 321 | // Number of ble scan results returned. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 322 | optional int32 num_results = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 323 | } |
| 324 | |
| 325 | /** |
| 326 | * Logs when a sensor state changes. |
| 327 | * |
| 328 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 329 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 330 | */ |
| 331 | message SensorStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 332 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 333 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 334 | // The id (int) of the sensor. |
| 335 | optional int32 sensor_id = 2; |
| 336 | |
| 337 | enum State { |
| 338 | OFF = 0; |
| 339 | ON = 1; |
| 340 | } |
| 341 | optional State state = 3; |
| 342 | } |
| 343 | |
| 344 | |
| 345 | /** |
| 346 | * Logs when GPS state changes. |
| 347 | * |
| 348 | * Logged from: |
| 349 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 350 | */ |
| 351 | message GpsScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 352 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 353 | |
| 354 | enum State { |
| 355 | OFF = 0; |
| 356 | ON = 1; |
| 357 | } |
| 358 | optional State state = 2; |
| 359 | } |
| 360 | |
| 361 | |
| 362 | /** |
| 363 | * Logs when a sync manager sync state changes. |
| 364 | * |
| 365 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 366 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 367 | */ |
| 368 | message SyncStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 369 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 370 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 371 | // Name of the sync (as named in the app). Can be chosen at run-time. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 372 | optional string sync_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 373 | |
| 374 | enum State { |
| 375 | OFF = 0; |
| 376 | ON = 1; |
| 377 | } |
| 378 | optional State state = 3; |
| 379 | } |
| 380 | |
| 381 | /** |
| 382 | * Logs when a job scheduler job state changes. |
| 383 | * |
| 384 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 385 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 386 | */ |
| 387 | message ScheduledJobStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 388 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 389 | |
| 390 | // Name of the job (as named in the app) |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 391 | optional string job_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 392 | |
| 393 | enum State { |
Tej Singh | d5747a6 | 2018-01-08 20:57:35 -0800 | [diff] [blame] | 394 | FINISHED = 0; |
| 395 | STARTED = 1; |
| 396 | SCHEDULED = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 397 | } |
| 398 | optional State state = 3; |
| 399 | |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 400 | // The reason a job has stopped. |
| 401 | // This is only applicable when the state is FINISHED. |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 402 | // The default value is STOP_REASON_UNKNOWN. |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 403 | optional android.app.job.StopReasonEnum stop_reason = 4; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 404 | } |
| 405 | |
| 406 | /** |
| 407 | * Logs when the audio state changes. |
| 408 | * |
| 409 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 410 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 411 | */ |
| 412 | message AudioStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 413 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 414 | |
| 415 | enum State { |
| 416 | OFF = 0; |
| 417 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 418 | // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes). |
| 419 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 420 | } |
| 421 | optional State state = 2; |
| 422 | } |
| 423 | |
| 424 | /** |
| 425 | * Logs when the video codec state changes. |
| 426 | * |
| 427 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 428 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 429 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 430 | message MediaCodecStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 431 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 432 | |
| 433 | enum State { |
| 434 | OFF = 0; |
| 435 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 436 | // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes). |
| 437 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 438 | } |
| 439 | optional State state = 2; |
| 440 | } |
| 441 | |
| 442 | /** |
| 443 | * Logs when the flashlight state changes. |
| 444 | * |
| 445 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 446 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 447 | */ |
| 448 | message FlashlightStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 449 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 450 | |
| 451 | enum State { |
| 452 | OFF = 0; |
| 453 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 454 | // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes). |
| 455 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 456 | } |
| 457 | optional State state = 2; |
| 458 | } |
| 459 | |
| 460 | /** |
| 461 | * Logs when the camera state changes. |
| 462 | * |
| 463 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 464 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 465 | */ |
| 466 | message CameraStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 467 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 468 | |
| 469 | enum State { |
| 470 | OFF = 0; |
| 471 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 472 | // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes). |
| 473 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 474 | } |
| 475 | optional State state = 2; |
| 476 | } |
| 477 | |
| 478 | /** |
| 479 | * Logs that the state of a wakelock (per app and per wakelock name) has changed. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 480 | * |
| 481 | * Logged from: |
| 482 | * TODO |
| 483 | */ |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 484 | message WakelockStateChanged { |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 485 | repeated AttributionNode attribution_node = 1; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 486 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 487 | // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock. |
| 488 | // From frameworks/base/core/proto/android/os/enums.proto. |
| 489 | optional android.os.WakeLockLevelEnum level = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 490 | |
| 491 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 492 | optional string tag = 3; |
| 493 | |
| 494 | enum State { |
Yangster-mac | cfdf3a4 | 2017-12-06 13:42:38 -0800 | [diff] [blame] | 495 | RELEASE = 0; |
| 496 | ACQUIRE = 1; |
| 497 | CHANGE_RELEASE = 2; |
| 498 | CHANGE_ACQUIRE = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 499 | } |
| 500 | optional State state = 4; |
| 501 | } |
| 502 | |
| 503 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 504 | * Logs when a partial wakelock is considered 'long' (over 1 min). |
| 505 | * |
| 506 | * Logged from: |
| 507 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 508 | */ |
| 509 | message LongPartialWakelockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 510 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 511 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 512 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 513 | optional string tag = 2; |
| 514 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 515 | // TODO: I have no idea what this is. |
| 516 | optional string history_tag = 3; |
| 517 | |
| 518 | enum State { |
| 519 | OFF = 0; |
| 520 | ON = 1; |
| 521 | } |
| 522 | optional State state = 4; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 523 | } |
| 524 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 525 | /** |
| 526 | * Logs Battery Saver state change. |
| 527 | * |
| 528 | * Logged from: |
| 529 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 530 | */ |
| 531 | message BatterySaverModeStateChanged { |
| 532 | enum State { |
| 533 | OFF = 0; |
| 534 | ON = 1; |
| 535 | } |
| 536 | optional State state = 1; |
| 537 | } |
| 538 | |
| 539 | /** |
| 540 | * Logs Doze mode state change. |
| 541 | * |
| 542 | * Logged from: |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 543 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 544 | */ |
| 545 | message DeviceIdleModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 546 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 547 | } |
| 548 | |
| 549 | |
| 550 | /** |
| 551 | * Logs state change of Doze mode including maintenance windows. |
| 552 | * |
| 553 | * Logged from: |
| 554 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 555 | */ |
| 556 | message DeviceIdlingModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 557 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 558 | } |
| 559 | |
| 560 | /** |
| 561 | * Logs screen brightness level. |
| 562 | * |
| 563 | * Logged from: |
| 564 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 565 | */ |
| 566 | message ScreenBrightnessChanged { |
| 567 | // Screen brightness level. Should be in [-1, 255] according to PowerManager.java. |
| 568 | optional int32 level = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 569 | } |
| 570 | |
| 571 | /** |
| 572 | * Logs battery level (percent full, from 0 to 100). |
| 573 | * |
| 574 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 575 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 576 | */ |
| 577 | message BatteryLevelChanged { |
| 578 | // Battery level. Should be in [0, 100]. |
| 579 | optional int32 battery_level = 1; |
| 580 | } |
| 581 | |
| 582 | /** |
| 583 | * Logs change in charging status of the device. |
| 584 | * |
| 585 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 586 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 587 | */ |
| 588 | message ChargingStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 589 | // State of the battery, from frameworks/base/core/proto/android/os/enums.proto. |
| 590 | optional android.os.BatteryStatusEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 591 | } |
| 592 | |
| 593 | /** |
| 594 | * Logs whether the device is plugged in, and what power source it is using. |
| 595 | * |
| 596 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 597 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 598 | */ |
| 599 | message PluggedStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 600 | // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto. |
| 601 | optional android.os.BatteryPluggedStateEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 602 | } |
| 603 | |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 604 | /** |
| 605 | * Logs when an app's wakeup alarm fires. |
| 606 | * |
| 607 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 608 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 609 | */ |
| 610 | message WakeupAlarmOccurred { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 611 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 612 | |
| 613 | // Name of the wakeup alarm. |
| 614 | optional string tag = 2; |
| 615 | } |
| 616 | |
| 617 | /** |
| 618 | * Logs when an an app causes the mobile radio to change state. |
| 619 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio. |
| 620 | * |
| 621 | * Logged from: |
| 622 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 623 | */ |
| 624 | message MobileRadioPowerStateChanged { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 625 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 626 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 627 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 628 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 629 | } |
| 630 | |
| 631 | /** |
| 632 | * Logs when an an app causes the wifi radio to change state. |
| 633 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio. |
| 634 | * |
| 635 | * Logged from: |
| 636 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 637 | */ |
| 638 | message WifiRadioPowerStateChanged { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 639 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 640 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 641 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 642 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 643 | } |
| 644 | |
| 645 | /** |
| 646 | * Logs kernel wakeup reasons and aborts. |
| 647 | * |
| 648 | * Logged from: |
| 649 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 650 | */ |
| 651 | message KernelWakeupReported { |
| 652 | // Name of the kernel wakeup reason (or abort). |
| 653 | optional string wakeup_reason_name = 1; |
| 654 | |
| 655 | // Duration (in microseconds) for the wake-up interrupt to be serviced. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 656 | optional int64 duration_micros = 2; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 657 | } |
| 658 | |
| 659 | /** |
| 660 | * Logs wifi locks held by an app. |
| 661 | * |
| 662 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 663 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 664 | */ |
| 665 | message WifiLockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 666 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 667 | |
| 668 | enum State { |
| 669 | OFF = 0; |
| 670 | ON = 1; |
| 671 | } |
| 672 | optional State state = 2; |
| 673 | } |
| 674 | |
| 675 | /** |
| 676 | * Logs wifi signal strength changes. |
| 677 | * |
| 678 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 679 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 680 | */ |
| 681 | message WifiSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 682 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 683 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 684 | } |
| 685 | |
| 686 | /** |
| 687 | * Logs wifi scans performed by an app. |
| 688 | * |
| 689 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 690 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 691 | */ |
| 692 | message WifiScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 693 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 694 | |
| 695 | enum State { |
| 696 | OFF = 0; |
| 697 | ON = 1; |
| 698 | } |
| 699 | optional State state = 2; |
| 700 | } |
| 701 | |
| 702 | /** |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 703 | * Logs wifi multicast locks held by an app |
| 704 | * |
| 705 | * Logged from: |
| 706 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 707 | */ |
| 708 | message WifiMulticastLockStateChanged { |
| 709 | repeated AttributionNode attribution_node = 1; |
| 710 | |
| 711 | enum State { |
| 712 | OFF = 0; |
| 713 | ON = 1; |
| 714 | } |
| 715 | optional State state = 2; |
| 716 | } |
| 717 | |
| 718 | /** |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 719 | * Logs shutdown reason and duration on next boot. |
| 720 | * |
| 721 | * Logged from: |
| 722 | * frameworks/base/core/java/com/android/server/BootReceiver.java |
| 723 | */ |
| 724 | message ShutdownSequenceReported { |
| 725 | // True if shutdown is for a reboot. Default: false if we do not know. |
| 726 | optional bool reboot = 1; |
| 727 | |
| 728 | // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>". |
| 729 | optional string reason = 2; |
| 730 | |
| 731 | // Beginning of shutdown time in ms using wall clock time since unix epoch. |
| 732 | // Default: 0 if no start time received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 733 | optional int64 start_time_millis = 3; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 734 | |
| 735 | // Duration of shutdown in ms. Default: 0 if no duration received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 736 | optional int64 duration_millis = 4; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 737 | } |
| 738 | |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 739 | |
| 740 | /** |
| 741 | * Logs boot reason and duration. |
| 742 | * |
| 743 | * Logged from: |
| 744 | * system/core/bootstat/bootstat.cpp |
| 745 | */ |
| 746 | message BootSequenceReported { |
| 747 | // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list |
| 748 | // Default: "<EMPTY>" if not available. |
| 749 | optional string bootloader_reason = 1; |
| 750 | |
| 751 | // Reason for system boot. Eg. bootloader, reboot,userrequested |
| 752 | // Default: "<EMPTY>" if not available. |
| 753 | optional string system_reason = 2; |
| 754 | |
| 755 | // End of boot time in ms from unix epoch using system wall clock. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 756 | optional int64 end_time_millis = 3; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 757 | |
| 758 | // Total boot duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 759 | optional int64 total_duration_millis = 4; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 760 | |
| 761 | // Bootloader duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 762 | optional int64 bootloader_duration_millis = 5; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 763 | |
| 764 | // Time since last boot in ms. Default: 0 if not available. |
| 765 | optional int64 time_since_last_boot = 6; |
| 766 | } |
| 767 | |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 768 | |
| 769 | /** |
| 770 | * Logs call state and disconnect cause (if applicable). |
| 771 | * |
| 772 | * Logged from: |
| 773 | * packages/services/Telecomm/src/com/android/server/telecom/Call.java |
| 774 | */ |
| 775 | message CallStateChanged { |
| 776 | // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED. |
| 777 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 778 | optional android.telecom.CallStateEnum call_state = 1; |
| 779 | |
| 780 | // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY. |
| 781 | // This value is only applicable when the call_state is DISCONNECTED, and |
| 782 | // should always be UNKNOWN if the call_state is not DISCONNECTED. |
| 783 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 784 | optional android.telecom.DisconnectCauseEnum disconnect_cause = 2; |
| 785 | |
| 786 | // True if the call is self-managed, which are apps that use the |
| 787 | // telecom infrastructure to make their own calls. |
| 788 | optional bool self_managed = 3; |
| 789 | |
| 790 | // True if call is external. External calls are calls on connected Wear |
| 791 | // devices but show up in Telecom so the user can pull them onto the device. |
| 792 | optional bool external_call = 4; |
| 793 | } |
| 794 | |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 795 | /** |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 796 | * Logs keyguard state. The keyguard is the lock screen. |
| 797 | * |
| 798 | * Logged from: |
| 799 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java |
| 800 | */ |
| 801 | message KeyguardStateChanged { |
| 802 | enum State { |
| 803 | UNKNOWN = 0; |
| 804 | // The keyguard is hidden when the phone is unlocked. |
| 805 | HIDDEN = 1; |
| 806 | // The keyguard is shown when the phone is locked (screen turns off). |
| 807 | SHOWN= 2; |
| 808 | // The keyguard is occluded when something is overlaying the keyguard. |
| 809 | // Eg. Opening the camera while on the lock screen. |
| 810 | OCCLUDED = 3; |
| 811 | } |
| 812 | optional State state = 1; |
| 813 | } |
| 814 | |
| 815 | /** |
| 816 | * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and |
| 817 | * prompts the user to enter a password (pattern, pin, etc). |
| 818 | * |
| 819 | * Logged from: |
| 820 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java |
| 821 | */ |
| 822 | |
| 823 | message KeyguardBouncerStateChanged { |
| 824 | enum State { |
| 825 | UNKNOWN = 0; |
| 826 | // Bouncer is hidden, either as a result of successfully entering the |
| 827 | // password, screen timing out, or user going back to lock screen. |
| 828 | HIDDEN = 1; |
| 829 | // This is when the user is being prompted to enter the password. |
| 830 | SHOWN = 2; |
| 831 | } |
| 832 | optional State state = 1; |
| 833 | } |
| 834 | |
| 835 | /** |
| 836 | * Logs the result of entering a password into the keyguard bouncer. |
| 837 | * |
| 838 | * Logged from: |
| 839 | * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java |
| 840 | */ |
| 841 | message KeyguardBouncerPasswordEntered { |
| 842 | enum BouncerResult { |
| 843 | UNKNOWN = 0; |
| 844 | // The password entered was incorrect. |
| 845 | FAILURE = 1; |
| 846 | // The password entered was correct. |
| 847 | SUCCESS = 2; |
| 848 | } |
| 849 | optional BouncerResult result = 1; |
| 850 | } |
| 851 | |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 852 | /* |
| 853 | * Logs changes to the configuration of the device. The configuration is defined |
| 854 | * in frameworks/base/core/java/android/content/res/Configuration.java |
| 855 | * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html |
| 856 | * Please go there to interpret the possible values each field can be. |
| 857 | * |
| 858 | * Logged from: |
| 859 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 860 | */ |
| 861 | message ResourceConfigurationChanged { |
| 862 | // Bit mask of color capabilities of the screen. |
| 863 | // Contains information about the color gamut and hdr mode of the screen. |
| 864 | // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode |
| 865 | optional int32 colorMode = 1; |
| 866 | |
| 867 | // The target screen density being rendered to. |
| 868 | // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi |
| 869 | optional int32 densityDpi = 2; |
| 870 | |
| 871 | // Current user preference for the scaling factor for fonts, |
| 872 | // relative to the base density scaling. |
| 873 | // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale |
| 874 | optional float fontScale = 3; |
| 875 | |
| 876 | // Flag indicating whether the hard keyboard is hidden. |
| 877 | // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden |
| 878 | optional int32 hardKeyboardHidden = 4; |
| 879 | |
| 880 | // The type of keyboard attached to the device. |
| 881 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard |
| 882 | optional int32 keyboard = 5; |
| 883 | |
| 884 | // Flag indicating whether any keyboard is available. Takes soft keyboards into account. |
| 885 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden |
| 886 | optional int32 keyboardHideen = 6; |
| 887 | |
| 888 | // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier. |
| 889 | // 0 if undefined. |
| 890 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc |
| 891 | optional int32 mcc = 7; |
| 892 | |
| 893 | // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier. |
| 894 | // 0 if undefined. Note: the actual MNC may be 0, to check for this use the |
| 895 | // MNC_ZERO symbol defined in Configuration.java. |
| 896 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc |
| 897 | optional int32 mnc = 8; |
| 898 | |
| 899 | // The kind of navigation available on the device. |
| 900 | // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation |
| 901 | optional int32 navigation = 9; |
| 902 | |
| 903 | // Flag indicating whether the navigation is available. |
| 904 | // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden |
| 905 | optional int32 navigationHidden = 10; |
| 906 | |
| 907 | // Overall orientation of the screen. |
| 908 | // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation |
| 909 | optional int32 orientation = 11; |
| 910 | |
| 911 | // The current height of the available screen space, in dp units. |
| 912 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp |
| 913 | optional int32 screenHeightDp = 12; |
| 914 | |
| 915 | // Bit mask of overall layout of the screen. |
| 916 | // Contains information about screen size, whether the screen is wider/taller |
| 917 | // than normal, whether the screen layout is right-tl-left or left-to-right, |
| 918 | // and whether the screen has a rounded shape. |
| 919 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout |
| 920 | optional int32 screenLayout = 13; |
| 921 | |
| 922 | // Current width of the available screen space, in dp units. |
| 923 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp |
| 924 | optional int32 screenWidthDp = 14; |
| 925 | |
| 926 | // The smallest screen size an application will see in normal operation. |
| 927 | // This is the smallest value of both screenWidthDp and screenHeightDp |
| 928 | // in portrait and landscape. |
| 929 | // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp |
| 930 | optional int32 smallestScreenWidthDp = 15; |
| 931 | |
| 932 | // The type of touch screen attached to the device. |
| 933 | // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen |
| 934 | optional int32 touchscreen = 16; |
| 935 | |
| 936 | // Bit mask of the ui mode. |
| 937 | // Contains information about the overall ui mode of the device. |
| 938 | // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET |
| 939 | // Also contains information about whether the device is in night mode. |
| 940 | // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode |
| 941 | optional int32 uiMode = 17; |
| 942 | } |
| 943 | |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 944 | |
| 945 | /** |
| 946 | * Logs changes in the connection state of the mobile radio. |
| 947 | * |
| 948 | * Logged from: |
| 949 | * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java |
| 950 | */ |
| 951 | message MobileConnectionStateChanged { |
| 952 | // States are from the state machine DataConnection.java. |
| 953 | enum State { |
| 954 | UNKNOWN = 0; |
| 955 | // The connection is inactive, or disconnected. |
| 956 | INACTIVE = 1; |
| 957 | // The connection is being activated, or connecting. |
| 958 | ACTIVATING = 2; |
| 959 | // The connection is active, or connected. |
| 960 | ACTIVE = 3; |
| 961 | // The connection is disconnecting. |
| 962 | DISCONNECTING = 4; |
| 963 | // The connection is disconnecting after creating a connection. |
| 964 | DISCONNECTION_ERROR_CREATING_CONNECTION = 5; |
| 965 | } |
| 966 | optional State state = 1; |
| 967 | // For multi-sim phones, this distinguishes between the sim cards. |
| 968 | optional int32 sim_slot_index = 2; |
| 969 | // Used to identify the connection. Starts at 0 and increments by 1 for |
| 970 | // every new network created. Resets whenever the device reboots. |
| 971 | optional int32 data_connection_id = 3; |
| 972 | // A bitmask for the capabilities of this connection. |
| 973 | // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS. |
| 974 | // Default value (if we have no information): 0 |
| 975 | optional int64 capabilities = 4; |
| 976 | // If this connection has internet. |
| 977 | // This just checks if the DEFAULT bit of capabilities is set. |
| 978 | optional bool has_internet = 5; |
| 979 | } |
| 980 | |
| 981 | /** |
| 982 | * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA. |
| 983 | * |
| 984 | * Logged from: |
| 985 | * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java |
| 986 | */ |
| 987 | message MobileRadioTechnologyChanged { |
| 988 | optional android.telephony.NetworkTypeEnum state = 1; |
| 989 | // For multi-sim phones, this distinguishes between the sim cards. |
| 990 | optional int32 sim_slot_index = 2; |
| 991 | } |
| 992 | |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 993 | /** |
| 994 | * Logs the VID and PID of any connected USB devices. |
| 995 | * |
| 996 | * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present. |
| 997 | * |
| 998 | * Logged by Vendor. |
| 999 | */ |
| 1000 | message UsbDeviceAttached { |
| 1001 | optional int32 vid = 1; |
| 1002 | optional int32 pid = 2; |
| 1003 | optional bool has_audio = 3; |
| 1004 | optional bool has_hid = 4; |
| 1005 | optional bool has_storage = 5; |
| 1006 | } |
| 1007 | |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 1008 | |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 1009 | /** |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1010 | * Logs when Bluetooth is enabled and disabled. |
| 1011 | * |
| 1012 | * Logged from: |
| 1013 | * services/core/java/com/android/server/BluetoothManagerService.java |
| 1014 | */ |
| 1015 | message BluetoothEnabledStateChanged { |
| 1016 | repeated AttributionNode attribution_node = 1; |
| 1017 | // Whether or not bluetooth is enabled on the device. |
| 1018 | enum State { |
| 1019 | UNKNOWN = 0; |
| 1020 | ENABLED = 1; |
| 1021 | DISABLED = 2; |
| 1022 | } |
| 1023 | optional State state = 2; |
| 1024 | // The reason for being enabled/disabled. |
| 1025 | // Eg. Airplane mode, crash, application request. |
| 1026 | optional android.bluetooth.EnableDisableReasonEnum reason = 3; |
| 1027 | // If the reason is an application request, this will be the package name. |
| 1028 | optional string pkgName = 4; |
| 1029 | } |
| 1030 | |
| 1031 | /** |
Jack He | 22e4a1d | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1032 | * Logs when profiles on a Bluetooth device connects and disconnects. |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1033 | * |
| 1034 | * Logged from: |
Jack He | 22e4a1d | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1035 | * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java |
| 1036 | * |
| 1037 | * Next Tag: 5 |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1038 | */ |
| 1039 | message BluetoothConnectionStateChanged { |
| 1040 | // The state of the connection. |
| 1041 | // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED. |
| 1042 | optional android.bluetooth.ConnectionStateEnum state = 1; |
| 1043 | // An identifier that can be used to match connect and disconnect events. |
| 1044 | // Currently is last two bytes of a hash of a device level ID and |
| 1045 | // the mac address of the bluetooth device that is connected. |
Jack He | 22e4a1d | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1046 | // Deprecated: use obfuscated_id instead, this one is always 0 for Q+ |
| 1047 | optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true]; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1048 | // The profile that is connected. Eg. GATT, A2DP, HEADSET. |
| 1049 | // From android.bluetooth.BluetoothAdapter.java |
Jack He | 22e4a1d | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1050 | // Default: 0 when not used |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1051 | optional int32 bt_profile = 3; |
Jack He | 22e4a1d | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1052 | // An identifier that can be used to match events for this device. |
| 1053 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1054 | // Salt: Randomly generated 256 bit value |
| 1055 | // Hash algorithm: HMAC-SHA256 |
| 1056 | // Size: 32 byte |
| 1057 | // Default: null or empty if the device identifier is not known |
| 1058 | optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1059 | } |
| 1060 | |
| 1061 | /** |
| 1062 | * Logs when a Bluetooth device connects and disconnects over ACL |
| 1063 | * |
| 1064 | * Logged from: |
| 1065 | * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java |
| 1066 | * |
| 1067 | * Next Tag: 3 |
| 1068 | */ |
| 1069 | message BluetoothAclConnectionStateChanged { |
| 1070 | // An identifier that can be used to match events for this device. |
| 1071 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1072 | // Salt: Randomly generated 256 bit value |
| 1073 | // Hash algorithm: HMAC-SHA256 |
| 1074 | // Size: 32 byte |
| 1075 | // Default: null or empty if the device identifier is not known |
| 1076 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1077 | // The state of the connection. |
| 1078 | // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED. |
| 1079 | optional android.bluetooth.ConnectionStateEnum state = 2; |
| 1080 | } |
| 1081 | |
| 1082 | /** |
| 1083 | * Logs when a Bluetooth device connects and disconnects over SCO |
| 1084 | * |
| 1085 | * Logged from: |
| 1086 | * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java |
| 1087 | * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java |
| 1088 | * |
| 1089 | * Next Tag: 4 |
| 1090 | */ |
| 1091 | message BluetoothScoConnectionStateChanged { |
| 1092 | // An identifier that can be used to match events for this device. |
| 1093 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1094 | // Salt: Randomly generated 256 bit value |
| 1095 | // Hash algorithm: HMAC-SHA256 |
| 1096 | // Size: 32 byte |
| 1097 | // Default: null or empty if the device identifier is not known |
| 1098 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1099 | // The state of the connection. |
| 1100 | // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED. |
| 1101 | optional android.bluetooth.ConnectionStateEnum state = 2; |
| 1102 | // Codec used for this SCO connection |
| 1103 | // Default: UNKNOWN |
| 1104 | optional android.bluetooth.hfp.ScoCodec codec = 3; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1105 | } |
| 1106 | |
Jack He | 924f346 | 2019-01-09 20:54:41 -0800 | [diff] [blame] | 1107 | /** |
| 1108 | * Logged when active device of a profile changes |
| 1109 | * |
| 1110 | * Logged from: |
| 1111 | * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java |
| 1112 | * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java |
| 1113 | * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java |
| 1114 | */ |
| 1115 | message BluetoothActiveDeviceChanged { |
| 1116 | // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID |
| 1117 | // From android.bluetooth.BluetoothProfile |
| 1118 | optional int32 bt_profile = 1; |
| 1119 | // An identifier that can be used to match events for this new active device. |
| 1120 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1121 | // Salt: Randomly generated 256 bit value |
| 1122 | // Hash algorithm: HMAC-SHA256 |
| 1123 | // Size: 32 byte |
| 1124 | // Default: null or empty if there is no active device for this profile |
| 1125 | optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1126 | } |
| 1127 | |
Jack He | 5226014 | 2018-12-18 15:43:27 -0800 | [diff] [blame] | 1128 | // Logs when there is an event affecting Bluetooth device's link layer connection. |
| 1129 | // - This event is triggered when there is a related HCI command or event |
| 1130 | // - Users of this metrics can deduce Bluetooth device's connection state from these events |
| 1131 | // - HCI commands are logged before the command is sent, after receiving command status, and after |
| 1132 | // receiving command complete |
| 1133 | // - HCI events are logged when they arrive |
| 1134 | // |
| 1135 | // Low level log from system/bt |
| 1136 | // |
| 1137 | // Bluetooth classic commands: |
| 1138 | // - CMD_CREATE_CONNECTION |
| 1139 | // - CMD_DISCONNECT |
| 1140 | // - CMD_CREATE_CONNECTION_CANCEL |
| 1141 | // - CMD_ACCEPT_CONNECTION_REQUEST |
| 1142 | // - CMD_REJECT_CONNECTION_REQUEST |
| 1143 | // - CMD_SETUP_ESCO_CONNECTION |
| 1144 | // - CMD_ACCEPT_ESCO_CONNECTION |
| 1145 | // - CMD_REJECT_ESCO_CONNECTION |
| 1146 | // - CMD_ENH_SETUP_ESCO_CONNECTION |
| 1147 | // - CMD_ENH_ACCEPT_ESCO_CONNECTION |
| 1148 | // |
| 1149 | // Bluetooth low energy commands: |
| 1150 | // - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00] |
| 1151 | // - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error] |
| 1152 | // - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00] |
| 1153 | // - CMD_BLE_CLEAR_WHITE_LIST |
| 1154 | // - CMD_BLE_ADD_WHITE_LIST |
| 1155 | // - CMD_BLE_REMOVE_WHITE_LIST |
| 1156 | // |
| 1157 | // Bluetooth classic events: |
| 1158 | // - EVT_CONNECTION_COMP |
| 1159 | // - EVT_CONNECTION_REQUEST |
| 1160 | // - EVT_DISCONNECTION_COMP |
| 1161 | // - EVT_ESCO_CONNECTION_COMP |
| 1162 | // - EVT_ESCO_CONNECTION_CHANGED |
| 1163 | // |
| 1164 | // Bluetooth low energy meta events: |
| 1165 | // - BLE_EVT_CONN_COMPLETE_EVT |
| 1166 | // - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT |
| 1167 | // |
| 1168 | // Next tag: 10 |
| 1169 | message BluetoothLinkLayerConnectionEvent { |
| 1170 | // An identifier that can be used to match events for this device. |
| 1171 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1172 | // Salt: Randomly generated 256 bit value |
| 1173 | // Hash algorithm: HMAC-SHA256 |
| 1174 | // Size: 32 byte |
| 1175 | // Default: null or empty if the device identifier is not known |
| 1176 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1177 | // Connection handle of this connection if available |
| 1178 | // Range: 0x0000 - 0x0EFF (12 bits) |
| 1179 | // Default: 0xFFFF if the handle is unknown |
| 1180 | optional int32 connection_handle = 2; |
| 1181 | // Direction of the link |
| 1182 | // Default: DIRECTION_UNKNOWN |
| 1183 | optional android.bluetooth.DirectionEnum direction = 3; |
| 1184 | // Type of this link |
| 1185 | // Default: LINK_TYPE_UNKNOWN |
| 1186 | optional android.bluetooth.LinkTypeEnum type = 4; |
| 1187 | |
| 1188 | // Reason metadata for this link layer connection event, rules for interpretation: |
| 1189 | // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or |
| 1190 | // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case |
| 1191 | // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is |
| 1192 | // set and valid, ignore hci_ble_event |
| 1193 | |
| 1194 | // HCI command associated with this event |
| 1195 | // Default: CMD_UNKNOWN |
| 1196 | optional android.bluetooth.hci.CommandEnum hci_cmd = 5; |
| 1197 | // HCI event associated with this event |
| 1198 | // Default: EVT_UNKNOWN |
| 1199 | optional android.bluetooth.hci.EventEnum hci_event = 6; |
| 1200 | // HCI BLE meta event associated with this event |
| 1201 | // Default: BLE_EVT_UNKNOWN |
| 1202 | optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7; |
| 1203 | // HCI command status code if this is triggerred by hci_cmd |
| 1204 | // Default: STATUS_UNKNOWN |
| 1205 | optional android.bluetooth.hci.StatusEnum cmd_status = 8; |
| 1206 | // HCI reason code associated with this event |
| 1207 | // Default: STATUS_UNKNOWN |
| 1208 | optional android.bluetooth.hci.StatusEnum reason_code = 9; |
| 1209 | } |
| 1210 | |
Jack He | 924f346 | 2019-01-09 20:54:41 -0800 | [diff] [blame] | 1211 | /** |
| 1212 | * Logs when there is a change in Bluetooth A2DP playback state |
| 1213 | * |
| 1214 | * Logged from: |
| 1215 | * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java |
| 1216 | */ |
| 1217 | message BluetoothA2dpPlaybackStateChanged { |
| 1218 | // An identifier that can be used to match events for this device. |
| 1219 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1220 | // Salt: Randomly generated 256 bit value |
| 1221 | // Hash algorithm: HMAC-SHA256 |
| 1222 | // Size: 32 byte |
| 1223 | // Default: null or empty if the device identifier is not known |
| 1224 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1225 | // Current playback state |
| 1226 | // Default: PLAYBACK_STATE_UNKNOWN |
| 1227 | optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2; |
| 1228 | // Current audio coding mode |
| 1229 | // Default: AUDIO_CODING_MODE_UNKNOWN |
| 1230 | optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3; |
| 1231 | } |
| 1232 | |
| 1233 | /** |
| 1234 | * Logs when there is a change in A2DP codec config for a particular remote device |
| 1235 | * |
| 1236 | * Logged from: |
| 1237 | * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java |
| 1238 | * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java |
| 1239 | */ |
| 1240 | message BluetoothA2dpCodecConfigChanged { |
| 1241 | // An identifier that can be used to match events for this device. |
| 1242 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1243 | // Salt: Randomly generated 256 bit value |
| 1244 | // Hash algorithm: HMAC-SHA256 |
| 1245 | // Size: 32 byte |
| 1246 | // Default: null or empty if the device identifier is not known |
| 1247 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1248 | // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig |
| 1249 | // Default SOURCE_CODEC_TYPE_INVALID |
| 1250 | optional int32 codec_type = 2; |
| 1251 | // Codec priroity, the higher the more preferred, -1 for disabled |
| 1252 | // Default: CODEC_PRIORITY_DEFAULT |
| 1253 | optional int32 codec_priority = 3; |
| 1254 | // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig |
| 1255 | // Default: SAMPLE_RATE_NONE |
| 1256 | optional int32 sample_rate = 4; |
| 1257 | // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig |
| 1258 | // Default: BITS_PER_SAMPLE_NONE |
| 1259 | optional int32 bits_per_sample = 5; |
| 1260 | // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig |
| 1261 | // Default: CHANNEL_MODE_NONE |
| 1262 | optional int32 channel_mode = 6; |
| 1263 | // Codec specific values |
| 1264 | // Default 0 |
| 1265 | optional int64 codec_specific_1 = 7; |
| 1266 | optional int64 codec_specific_2 = 8; |
| 1267 | optional int64 codec_specific_3 = 9; |
| 1268 | optional int64 codec_specific_4 = 10; |
| 1269 | } |
| 1270 | |
| 1271 | /** |
| 1272 | * Logs when there is a change in selectable A2DP codec capability for a paricular remote device |
| 1273 | * Each codec's capability is logged separately due to statsd restriction |
| 1274 | * |
| 1275 | * Logged from: |
| 1276 | * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java |
| 1277 | * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java |
| 1278 | */ |
| 1279 | message BluetoothA2dpCodecCapabilityChanged { |
| 1280 | // An identifier that can be used to match events for this device. |
| 1281 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1282 | // Salt: Randomly generated 256 bit value |
| 1283 | // Hash algorithm: HMAC-SHA256 |
| 1284 | // Size: 32 byte |
| 1285 | // Default: null or empty if the device identifier is not known |
| 1286 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1287 | // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig |
| 1288 | // Default SOURCE_CODEC_TYPE_INVALID |
| 1289 | optional int32 codec_type = 2; |
| 1290 | // Codec priroity, the higher the more preferred, -1 for disabled |
| 1291 | // Default: CODEC_PRIORITY_DEFAULT |
| 1292 | optional int32 codec_priority = 3; |
| 1293 | // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants |
| 1294 | // in BluetoothCodecConfig |
| 1295 | // Default: empty and SAMPLE_RATE_NONE for individual item |
| 1296 | optional int32 sample_rate = 4; |
| 1297 | // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants |
| 1298 | // in BluetoothCodecConfig |
| 1299 | // Default: empty and BITS_PER_SAMPLE_NONE for individual item |
| 1300 | optional int32 bits_per_sample = 5; |
| 1301 | // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in |
| 1302 | // BluetoothCodecConfig |
| 1303 | // Default: empty and CHANNEL_MODE_NONE for individual item |
| 1304 | optional int32 channel_mode = 6; |
| 1305 | // Codec specific values |
| 1306 | // Default 0 |
| 1307 | optional int64 codec_specific_1 = 7; |
| 1308 | optional int64 codec_specific_2 = 8; |
| 1309 | optional int64 codec_specific_3 = 9; |
| 1310 | optional int64 codec_specific_4 = 10; |
| 1311 | } |
| 1312 | |
| 1313 | /** |
| 1314 | * Logs when A2DP failed to read from PCM source. |
| 1315 | * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding. |
| 1316 | * |
| 1317 | * Logged from: |
| 1318 | * system/bt |
| 1319 | */ |
| 1320 | message BluetoothA2dpAudioUnderrunReported { |
| 1321 | // An identifier that can be used to match events for this device. |
| 1322 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1323 | // Salt: Randomly generated 256 bit value |
| 1324 | // Hash algorithm: HMAC-SHA256 |
| 1325 | // Size: 32 byte |
| 1326 | // Default: null or empty if the device identifier is not known |
| 1327 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1328 | // Encoding interval in nanoseconds |
| 1329 | // Default: 0 |
| 1330 | optional int64 encoding_interval_nanos = 2; |
| 1331 | // Number of bytes of PCM data that could not be read from the source |
| 1332 | // Default: 0 |
| 1333 | optional int32 num_missing_pcm_bytes = 3; |
| 1334 | } |
| 1335 | |
| 1336 | /** |
| 1337 | * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit |
| 1338 | * buffer queue is full and we have to drop data |
| 1339 | * |
| 1340 | * Logged from: |
| 1341 | * system/bt |
| 1342 | */ |
| 1343 | message BluetoothA2dpAudioOverrunReported { |
| 1344 | // An identifier that can be used to match events for this device. |
| 1345 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1346 | // Salt: Randomly generated 256 bit value |
| 1347 | // Hash algorithm: HMAC-SHA256 |
| 1348 | // Size: 32 byte |
| 1349 | // Default: null or empty if the device identifier is not known |
| 1350 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1351 | // Encoding interval in nanoseconds |
| 1352 | // Default: 0 |
| 1353 | optional int64 encoding_interval_nanos = 2; |
| 1354 | // Number of buffers dropped in this event |
| 1355 | // Each buffer is encoded in one encoding interval and consists of multiple encoded frames |
| 1356 | // Default: 0 |
| 1357 | optional int32 num_dropped_buffers = 3; |
| 1358 | // Number of encoded buffers dropped in this event |
| 1359 | // Default 0 |
| 1360 | optional int32 num_dropped_encoded_frames = 4; |
| 1361 | // Number of encoded bytes dropped in this event |
| 1362 | // Default: 0 |
| 1363 | optional int32 num_dropped_encoded_bytes = 5; |
| 1364 | } |
| 1365 | |
| 1366 | /** |
| 1367 | * Logs when we receive reports regarding a device's RSSI value |
| 1368 | * |
| 1369 | * Logged from: |
| 1370 | * system/bt |
| 1371 | */ |
| 1372 | message BluetoothDeviceRssiReported { |
| 1373 | // An identifier that can be used to match events for this device. |
| 1374 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1375 | // Salt: Randomly generated 256 bit value |
| 1376 | // Hash algorithm: HMAC-SHA256 |
| 1377 | // Size: 32 byte |
| 1378 | // Default: null or empty if the device identifier is not known |
| 1379 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1380 | // Connection handle of this connection if available |
| 1381 | // Range: 0x0000 - 0x0EFF (12 bits) |
| 1382 | // Default: 0xFFFF if the handle is unknown |
| 1383 | optional int32 connection_handle = 2; |
| 1384 | // HCI command status code if this is triggerred by hci_cmd |
| 1385 | // Default: STATUS_UNKNOWN |
| 1386 | optional android.bluetooth.hci.StatusEnum hci_status = 3; |
| 1387 | // BR/EDR |
| 1388 | // Range: -128 ≤ N ≤ 127 (signed integer) |
| 1389 | // Units: dB |
| 1390 | // LE: |
| 1391 | // Range: -127 to 20, 127 (signed integer) |
| 1392 | // Units: dBm |
| 1393 | // Invalid when an out of range value is reported |
| 1394 | optional int32 rssi = 4; |
| 1395 | } |
| 1396 | |
| 1397 | /** |
| 1398 | * Logs when we receive reports regarding how many consecutive failed contacts for a connection |
| 1399 | * |
| 1400 | * Logged from: |
| 1401 | * system/bt |
| 1402 | */ |
| 1403 | message BluetoothDeviceFailedContactCounterReported { |
| 1404 | // An identifier that can be used to match events for this device. |
| 1405 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1406 | // Salt: Randomly generated 256 bit value |
| 1407 | // Hash algorithm: HMAC-SHA256 |
| 1408 | // Size: 32 byte |
| 1409 | // Default: null or empty if the device identifier is not known |
| 1410 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1411 | // Connection handle of this connection if available |
| 1412 | // Range: 0x0000 - 0x0EFF (12 bits) |
| 1413 | // Default: 0xFFFF if the handle is unknown |
| 1414 | optional int32 connection_handle = 2; |
| 1415 | // HCI command status code if this is triggerred by hci_cmd |
| 1416 | // Default: STATUS_UNKNOWN |
| 1417 | optional android.bluetooth.hci.StatusEnum cmd_status = 3; |
| 1418 | // Number of consecutive failed contacts for a connection corresponding to the Handle |
| 1419 | // Range: uint16_t, 0-0xFFFF |
| 1420 | // Default: 0xFFFFF |
| 1421 | optional int32 failed_contact_counter = 4; |
| 1422 | } |
| 1423 | |
| 1424 | /** |
| 1425 | * Logs when we receive reports regarding the tranmit power level used for a specific connection |
| 1426 | * |
| 1427 | * Logged from: |
| 1428 | * system/bt |
| 1429 | */ |
| 1430 | message BluetoothDeviceTxPowerLevelReported { |
| 1431 | // An identifier that can be used to match events for this device. |
| 1432 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1433 | // Salt: Randomly generated 256 bit value |
| 1434 | // Hash algorithm: HMAC-SHA256 |
| 1435 | // Size: 32 byte |
| 1436 | // Default: null or empty if the device identifier is not known |
| 1437 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1438 | // Connection handle of this connection if available |
| 1439 | // Range: 0x0000 - 0x0EFF (12 bits) |
| 1440 | // Default: 0xFFFF if the handle is unknown |
| 1441 | optional int32 connection_handle = 2; |
Jack He | 4d6abe6 | 2019-01-20 21:22:46 -0800 | [diff] [blame] | 1442 | // HCI command status code if this is triggered by hci_cmd |
Jack He | 924f346 | 2019-01-09 20:54:41 -0800 | [diff] [blame] | 1443 | // Default: STATUS_UNKNOWN |
| 1444 | optional android.bluetooth.hci.StatusEnum hci_status = 3; |
| 1445 | // Range: -30 ≤ N ≤ 20 |
| 1446 | // Units: dBm |
| 1447 | // Invalid when an out of range value is reported |
| 1448 | optional int32 transmit_power_level = 4; |
| 1449 | } |
Jack He | 5226014 | 2018-12-18 15:43:27 -0800 | [diff] [blame] | 1450 | |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1451 | /** |
Jack He | 4d6abe6 | 2019-01-20 21:22:46 -0800 | [diff] [blame] | 1452 | * Logs when Bluetooth controller failed to reply with command status within a timeout period after |
| 1453 | * receiving an HCI command from the host |
| 1454 | * |
| 1455 | * Logged from: system/bt |
| 1456 | */ |
| 1457 | message BluetoothHciTimeoutReported { |
| 1458 | // HCI command associated with this event |
| 1459 | // Default: CMD_UNKNOWN |
| 1460 | optional android.bluetooth.hci.CommandEnum hci_command = 1; |
| 1461 | } |
| 1462 | |
| 1463 | /** |
| 1464 | * Logs when we receive Bluetooth Link Quality Report event from the controller |
| 1465 | * See Android Bluetooth HCI specification for more details |
| 1466 | * |
| 1467 | * Note: all count and bytes field are counted since last event |
| 1468 | * |
| 1469 | * Logged from: system/bt |
| 1470 | */ |
| 1471 | message BluetoothQualityReportReported { |
| 1472 | // Quality report ID |
| 1473 | // Original type: uint8_t |
| 1474 | // Default: BQR_ID_UNKNOWN |
| 1475 | optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1; |
| 1476 | // Packet type of the connection |
| 1477 | // Original type: uint8_t |
| 1478 | // Default: BQR_PACKET_TYPE_UNKNOWN |
| 1479 | optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2; |
| 1480 | // Connection handle of the connection |
| 1481 | // Original type: uint16_t |
| 1482 | optional int32 connection_handle = 3; |
| 1483 | // Performing Role for the connection |
| 1484 | // Original type: uint8_t |
| 1485 | optional int32 connection_role = 4; |
| 1486 | // Current Transmit Power Level for the connection. This value is the same as the controller's |
| 1487 | // response to the HCI_Read_Transmit_Power_Level HCI command |
| 1488 | // Original type: uint8_t |
| 1489 | optional int32 tx_power_level = 5; |
| 1490 | // Received Signal Strength Indication (RSSI) value for the connection. This value is an |
| 1491 | // absolute receiver signal strength value |
| 1492 | // Original type: int8_t |
| 1493 | optional int32 rssi = 6; |
| 1494 | // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the |
| 1495 | // channels used by the link currently |
| 1496 | // Original type: uint8_t |
| 1497 | optional int32 snr = 7; |
| 1498 | // Indicates the number of unused channels in AFH_channel_map |
| 1499 | // Original type: uint8_t |
| 1500 | optional int32 unused_afh_channel_count = 8; |
| 1501 | // Indicates the number of the channels which are interfered and quality is bad but are still |
| 1502 | // selected for AFH |
| 1503 | // Original type: uint8_t |
| 1504 | optional int32 afh_select_unideal_channel_count = 9; |
| 1505 | // Current Link Supervision Timeout Setting |
| 1506 | // Unit: N * 0.3125 ms (1 Bluetooth Clock) |
| 1507 | // Original type: uint16_t |
| 1508 | optional int32 lsto = 10; |
| 1509 | // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's |
| 1510 | // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of |
| 1511 | // 0x01 (Piconet Clock) |
| 1512 | // Unit: N * 0.3125 ms (1 Bluetooth Clock) |
| 1513 | // Original type: uint32_t |
| 1514 | optional int64 connection_piconet_clock = 11; |
| 1515 | // The count of retransmission |
| 1516 | // Original type: uint32_t |
| 1517 | optional int64 retransmission_count = 12; |
| 1518 | // The count of no RX |
| 1519 | // Original type: uint32_t |
| 1520 | optional int64 no_rx_count = 13; |
| 1521 | // The count of NAK (Negative Acknowledge) |
| 1522 | // Original type: uint32_t |
| 1523 | optional int64 nak_count = 14; |
| 1524 | // Controller timestamp of last TX ACK |
| 1525 | // Unit: N * 0.3125 ms (1 Bluetooth Clock) |
| 1526 | // Original type: uint32_t |
| 1527 | optional int64 last_tx_ack_timestamp = 15; |
| 1528 | // The count of Flow-off (STOP) |
| 1529 | // Original type: uint32_t |
| 1530 | optional int64 flow_off_count = 16; |
| 1531 | // Controller timestamp of last Flow-on (GO) |
| 1532 | // Unit: N * 0.3125 ms (1 Bluetooth Clock) |
| 1533 | // Original type: uint32_t |
| 1534 | optional int64 last_flow_on_timestamp = 17; |
| 1535 | // Buffer overflow count (how many bytes of TX data are dropped) since the last event |
| 1536 | // Original type: uint32_t |
| 1537 | optional int64 buffer_overflow_bytes = 18; |
| 1538 | // Buffer underflow count (in byte) since last event |
| 1539 | // Original type: uint32_t |
| 1540 | optional int64 buffer_underflow_bytes = 19; |
| 1541 | } |
| 1542 | |
| 1543 | /** |
| 1544 | * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack |
| 1545 | * |
| 1546 | * Notes: |
| 1547 | * - Each event can be partially filled as we might learn different pieces of device |
| 1548 | * information at different time |
| 1549 | * - Multiple device info events can be combined to give more complete picture |
| 1550 | * - When multiple device info events tries to describe the same information, the |
| 1551 | * later one wins |
| 1552 | * |
| 1553 | * Logged from: |
| 1554 | * packages/apps/Bluetooth |
| 1555 | */ |
| 1556 | message BluetoothManufacturerInfoReported { |
| 1557 | // An identifier that can be used to match events for this device. |
| 1558 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1559 | // Salt: Randomly generated 256 bit value |
| 1560 | // Hash algorithm: HMAC-SHA256 |
| 1561 | // Size: 32 byte |
| 1562 | // Default: null or empty if the device identifier is not known |
| 1563 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1564 | // Where is this device info obtained from |
| 1565 | optional android.bluetooth.DeviceInfoSrcEnum source_type = 2; |
| 1566 | // Name of the data source |
| 1567 | // For EXTERNAL: package name of the data source |
| 1568 | // For INTERNAL: null for general case, component name otherwise |
| 1569 | optional string source_name = 3; |
| 1570 | // Name of the manufacturer of this device |
| 1571 | optional string manufacturer = 4; |
| 1572 | // Model of this device |
| 1573 | optional string model = 5; |
| 1574 | // Hardware version of this device |
| 1575 | optional string hardware_version = 6; |
| 1576 | // Software version of this device |
| 1577 | optional string software_version = 7; |
| 1578 | } |
| 1579 | |
| 1580 | /** |
| 1581 | * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote |
| 1582 | * device, as documented by the Bluetooth Core HCI specification |
| 1583 | * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification |
| 1584 | * Vol 2, Part E, Page 1118 |
| 1585 | * |
| 1586 | * Logged from: |
| 1587 | * system/bt |
| 1588 | */ |
| 1589 | message BluetoothRemoteVersionInfoReported { |
| 1590 | // Connection handle of the connection |
| 1591 | // Original type: uint16_t |
| 1592 | optional int32 connection_handle = 1; |
| 1593 | // HCI command status code |
| 1594 | // Default: STATUS_UNKNOWN |
| 1595 | optional android.bluetooth.hci.StatusEnum hci_status = 2; |
| 1596 | // 1 byte Version of current LMP in the remote controller |
| 1597 | optional int32 lmp_version = 3; |
| 1598 | // 2 bytes LMP manufacturer code of the remote controller |
| 1599 | // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers |
| 1600 | optional int32 lmp_manufacturer_code = 4; |
| 1601 | // 4 bytes subversion of the LMP in the remote controller |
| 1602 | optional int32 lmp_subversion = 5; |
| 1603 | } |
| 1604 | |
| 1605 | /** |
| 1606 | * Logs when certain Bluetooth SDP attributes are discovered |
| 1607 | * Constant definitions are from: |
| 1608 | * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery |
| 1609 | * |
| 1610 | * Current logged attributes: |
| 1611 | * - BluetoothProfileDescriptorList |
| 1612 | * - Supported Features Bitmask |
| 1613 | * |
| 1614 | * Logged from: |
| 1615 | * system/bt |
| 1616 | */ |
| 1617 | message BluetoothSdpAttributeReported { |
| 1618 | // An identifier that can be used to match events for this device. |
| 1619 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1620 | // Salt: Randomly generated 256 bit value |
| 1621 | // Hash algorithm: HMAC-SHA256 |
| 1622 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1623 | // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes |
| 1624 | // Original type: uint16_t |
| 1625 | optional int32 protocol_uuid = 2; |
| 1626 | // Short form UUIDs used to identify Bluetooth SDP attribute types |
| 1627 | // Original type: uint16_t |
| 1628 | optional int32 attribute_id = 3; |
| 1629 | // Attribute value for the particular attribute |
| 1630 | optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1631 | } |
| 1632 | |
| 1633 | /** |
| 1634 | * Logs when bond state of a Bluetooth device changes |
| 1635 | * |
| 1636 | * Logged from: |
| 1637 | * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java |
| 1638 | * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java |
| 1639 | */ |
| 1640 | message BluetoothBondStateChanged { |
| 1641 | // An identifier that can be used to match events for this device. |
| 1642 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1643 | // Salt: Randomly generated 256 bit value |
| 1644 | // Hash algorithm: HMAC-SHA256 |
| 1645 | // Size: 32 byte |
| 1646 | // Default: null or empty if the device identifier is not known |
| 1647 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1648 | // Preferred transport type to remote dual mode device |
| 1649 | // Default: TRANSPORT_AUTO means no preference |
| 1650 | optional android.bluetooth.TransportTypeEnum transport = 2; |
| 1651 | // The type of this Bluetooth device (Classic, LE, or Dual mode) |
| 1652 | // Default: UNKNOWN |
| 1653 | optional android.bluetooth.DeviceTypeEnum type = 3; |
| 1654 | // Current bond state (NONE, BONDING, BONDED) |
| 1655 | // Default: BOND_STATE_UNKNOWN |
| 1656 | optional android.bluetooth.BondStateEnum bond_state = 4; |
| 1657 | // Bonding sub state |
| 1658 | // Default: BOND_SUB_STATE_UNKNOWN |
| 1659 | optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5; |
| 1660 | // Unbond Reason |
| 1661 | // Default: UNBOND_REASON_UNKNOWN |
| 1662 | optional android.bluetooth.UnbondReasonEnum unbond_reason = 6; |
| 1663 | } |
| 1664 | |
| 1665 | /** |
| 1666 | * Logs there is an event related Bluetooth classic pairing |
| 1667 | * |
| 1668 | * Logged from: |
| 1669 | * system/bt |
| 1670 | */ |
| 1671 | message BluetoothClassicPairingEventReported { |
| 1672 | // An identifier that can be used to match events for this device. |
| 1673 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1674 | // Salt: Randomly generated 256 bit value |
| 1675 | // Hash algorithm: HMAC-SHA256 |
| 1676 | // Size: 32 byte |
| 1677 | // Default: null or empty if the device identifier is not known |
| 1678 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1679 | // Connection handle of this connection if available |
| 1680 | // Range: 0x0000 - 0x0EFF (12 bits) |
| 1681 | // Default: 0xFFFF if the handle is unknown |
| 1682 | optional int32 connection_handle = 2; |
| 1683 | // HCI command associated with this event |
| 1684 | // Default: CMD_UNKNOWN |
| 1685 | optional android.bluetooth.hci.CommandEnum hci_cmd = 3; |
| 1686 | // HCI event associated with this event |
| 1687 | // Default: EVT_UNKNOWN |
| 1688 | optional android.bluetooth.hci.EventEnum hci_event = 4; |
| 1689 | // HCI command status code if this is triggerred by hci_cmd |
| 1690 | // Default: STATUS_UNKNOWN |
| 1691 | optional android.bluetooth.hci.StatusEnum cmd_status = 5; |
| 1692 | // HCI reason code associated with this event |
| 1693 | // Default: STATUS_UNKNOWN |
| 1694 | optional android.bluetooth.hci.StatusEnum reason_code = 6; |
| 1695 | } |
| 1696 | |
| 1697 | /** |
| 1698 | * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP) |
| 1699 | * |
| 1700 | * Logged from: |
| 1701 | * system/bt |
| 1702 | */ |
| 1703 | message BluetoothSmpPairingEventReported { |
| 1704 | // An identifier that can be used to match events for this device. |
| 1705 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1706 | // Salt: Randomly generated 256 bit value |
| 1707 | // Hash algorithm: HMAC-SHA256 |
| 1708 | // Size: 32 byte |
| 1709 | // Default: null or empty if the device identifier is not known |
| 1710 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1711 | // SMP command sent or received over L2CAP |
| 1712 | // Default: CMD_UNKNOWN |
| 1713 | optional android.bluetooth.smp.CommandEnum smp_command = 2; |
| 1714 | // Whether this command is sent or received |
| 1715 | // Default: DIRECTION_UNKNOWN |
| 1716 | optional android.bluetooth.DirectionEnum direction = 3; |
| 1717 | // SMP failure reason code |
| 1718 | // Default: PAIRING_FAIL_REASON_DEFAULT |
| 1719 | optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4; |
| 1720 | } |
| 1721 | |
| 1722 | /** |
Jack He | 9c30c7c6b | 2019-01-30 17:24:55 -0800 | [diff] [blame] | 1723 | * Logs when a Bluetooth socket’s connection state changed |
| 1724 | * |
| 1725 | * Logged from: |
| 1726 | * system/bt |
| 1727 | */ |
| 1728 | message BluetoothSocketConnectionStateChanged { |
| 1729 | // An identifier that can be used to match events for this device. |
| 1730 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1731 | // Salt: Randomly generated 256 bit value |
| 1732 | // Hash algorithm: HMAC-SHA256 |
| 1733 | // Size: 32 byte |
Jack He | e4ae0e7 | 2019-02-07 13:52:45 -0800 | [diff] [blame] | 1734 | // Default: null or empty if this is a server listener socket |
Jack He | 9c30c7c6b | 2019-01-30 17:24:55 -0800 | [diff] [blame] | 1735 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
Jack He | e4ae0e7 | 2019-02-07 13:52:45 -0800 | [diff] [blame] | 1736 | // Temporary port of this socket for the current connection or session only |
Jack He | 9c30c7c6b | 2019-01-30 17:24:55 -0800 | [diff] [blame] | 1737 | // Default 0 when unknown or don't care |
| 1738 | optional int32 port = 2; |
| 1739 | // Socket type as mentioned in |
| 1740 | // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java |
| 1741 | // Default: SOCKET_TYPE_UNKNOWN |
| 1742 | optional android.bluetooth.SocketTypeEnum type = 3; |
| 1743 | // Socket connection state |
| 1744 | // Default: SOCKET_CONNECTION_STATE_UNKNOWN |
| 1745 | optional android.bluetooth.SocketConnectionstateEnum state = 4; |
| 1746 | // Number of bytes sent to remote device during this connection |
| 1747 | optional int64 tx_bytes = 5; |
| 1748 | // Number of bytes received from remote device during this connection |
| 1749 | optional int64 rx_bytes = 6; |
Jack He | e4ae0e7 | 2019-02-07 13:52:45 -0800 | [diff] [blame] | 1750 | // Socket owner's UID |
| 1751 | optional int32 uid = 7 [(is_uid) = true]; |
| 1752 | // Server port of this socket, if any. When both |server_port| and |port| fields are populated, |
| 1753 | // |port| must be spawned by |server_port| |
| 1754 | // Default 0 when unknown or don't care |
| 1755 | optional int32 server_port = 8; |
| 1756 | // Whether this is a server listener socket |
| 1757 | optional android.bluetooth.SocketRoleEnum is_server = 9; |
Jack He | 9c30c7c6b | 2019-01-30 17:24:55 -0800 | [diff] [blame] | 1758 | } |
| 1759 | |
| 1760 | /** |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1761 | * Logs when something is plugged into or removed from the USB-C connector. |
| 1762 | * |
| 1763 | * Logged from: |
| 1764 | * Vendor USB HAL. |
| 1765 | */ |
| 1766 | message UsbConnectorStateChanged { |
| 1767 | enum State { |
| 1768 | DISCONNECTED = 0; |
| 1769 | CONNECTED = 1; |
| 1770 | } |
| 1771 | optional State state = 1; |
| 1772 | } |
| 1773 | |
| 1774 | /** |
| 1775 | * Logs the reported speaker impedance. |
| 1776 | * |
| 1777 | * Logged from: |
| 1778 | * Vendor audio implementation. |
| 1779 | */ |
| 1780 | message SpeakerImpedanceReported { |
| 1781 | optional int32 speaker_location = 1; |
| 1782 | optional int32 impedance = 2; |
| 1783 | } |
| 1784 | |
| 1785 | /** |
| 1786 | * Logs the report of a failed hardware. |
| 1787 | * |
| 1788 | * Logged from: |
| 1789 | * Vendor HALs. |
| 1790 | * |
| 1791 | */ |
| 1792 | message HardwareFailed { |
| 1793 | enum HardwareType { |
| 1794 | HARDWARE_FAILED_UNKNOWN = 0; |
| 1795 | HARDWARE_FAILED_MICROPHONE = 1; |
| 1796 | HARDWARE_FAILED_CODEC = 2; |
| 1797 | HARDWARE_FAILED_SPEAKER = 3; |
| 1798 | HARDWARE_FAILED_FINGERPRINT = 4; |
| 1799 | } |
| 1800 | optional HardwareType hardware_type = 1; |
| 1801 | |
| 1802 | /* hardware_location allows vendors to differentiate between multiple instances of |
| 1803 | * the same hardware_type. The specific locations are vendor defined integers, |
| 1804 | * referring to board-specific numbering schemes. |
| 1805 | */ |
| 1806 | optional int32 hardware_location = 2; |
| 1807 | |
| 1808 | /* failure_code is specific to the HardwareType of the failed hardware. |
| 1809 | * It should use the enum values defined below. |
| 1810 | */ |
| 1811 | enum MicrophoneFailureCode { |
| 1812 | MICROPHONE_FAILURE_COMPLETE = 0; |
| 1813 | } |
| 1814 | enum CodecFailureCode { |
| 1815 | CODEC_FAILURE_COMPLETE = 0; |
| 1816 | } |
| 1817 | enum SpeakerFailureCode { |
| 1818 | SPEAKER_FAILURE_COMPLETE = 0; |
| 1819 | SPEAKER_FAILURE_HIGH_Z = 1; |
| 1820 | SPEAKER_FAILURE_SHORT = 2; |
| 1821 | } |
| 1822 | enum FingerprintFailureCode { |
| 1823 | FINGERPRINT_FAILURE_COMPLETE = 0; |
| 1824 | FINGERPRINT_SENSOR_BROKEN = 1; |
| 1825 | FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2; |
| 1826 | } |
| 1827 | optional int32 failure_code = 3; |
| 1828 | } |
| 1829 | |
| 1830 | /** |
| 1831 | * Log an event when the device has been physically dropped. |
| 1832 | * Reported from the /vendor partition. |
| 1833 | */ |
| 1834 | message PhysicalDropDetected { |
| 1835 | // Confidence that the event was actually a drop, 0 -> 100 |
| 1836 | optional int32 confidence_pctg = 1; |
| 1837 | // Peak acceleration of the drop, in 1/1000s of a g. |
| 1838 | optional int32 accel_peak_thousandths_g = 2; |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 1839 | // Duration of freefall in ms |
| 1840 | optional int32 freefall_time_millis = 3; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1841 | } |
| 1842 | |
| 1843 | /** |
| 1844 | * Log bucketed battery charge cycles. |
| 1845 | * |
| 1846 | * Each bucket represents cycles of the battery past |
| 1847 | * a given charge point. For example, bucket 1 is the |
| 1848 | * lowest 1/8th of the battery, and bucket 8 is 100%. |
| 1849 | * |
| 1850 | * Logged from: |
| 1851 | * /sys/class/power_supply/bms/cycle_count, via Vendor. |
| 1852 | */ |
| 1853 | message ChargeCyclesReported { |
| 1854 | optional int32 cycle_bucket_1 = 1; |
| 1855 | optional int32 cycle_bucket_2 = 2; |
| 1856 | optional int32 cycle_bucket_3 = 3; |
| 1857 | optional int32 cycle_bucket_4 = 4; |
| 1858 | optional int32 cycle_bucket_5 = 5; |
| 1859 | optional int32 cycle_bucket_6 = 6; |
| 1860 | optional int32 cycle_bucket_7 = 7; |
| 1861 | optional int32 cycle_bucket_8 = 8; |
| 1862 | } |
| 1863 | |
| 1864 | /** |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1865 | * Logs the duration of a davey (jank of >=700ms) when it occurs |
| 1866 | * |
| 1867 | * Logged from: |
| 1868 | * frameworks/base/libs/hwui/JankTracker.cpp |
| 1869 | */ |
| 1870 | message DaveyOccurred { |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1871 | // The UID that logged this atom. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1872 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1873 | |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1874 | // Amount of time it took to render the frame. Should be >=700ms. |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1875 | optional int64 jank_duration_millis = 2; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1876 | } |
| 1877 | |
| 1878 | /** |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 1879 | * Logs phone signal strength changes. |
| 1880 | * |
| 1881 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1882 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 1883 | */ |
| 1884 | message PhoneSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 1885 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 1886 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1887 | } |
| 1888 | |
Yangster | 4ccebea | 2018-10-09 17:09:02 -0700 | [diff] [blame] | 1889 | |
| 1890 | /** |
| 1891 | * Logs when the phone state, sim state or signal strength changes |
| 1892 | * |
| 1893 | * Logged from: |
| 1894 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 1895 | */ |
| 1896 | message PhoneServiceStateChanged { |
| 1897 | optional android.telephony.ServiceStateEnum state = 1; |
| 1898 | optional android.telephony.SimStateEnum sim_state = 2; |
| 1899 | optional android.telephony.SignalStrengthEnum signal_strength = 3; |
| 1900 | } |
| 1901 | |
| 1902 | /** |
| 1903 | * Logs when the phone becomes on or off. |
| 1904 | * |
| 1905 | * Logged from: |
| 1906 | * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java |
| 1907 | */ |
| 1908 | message PhoneStateChanged { |
| 1909 | enum State { |
| 1910 | OFF = 0; |
| 1911 | ON = 1; |
| 1912 | } |
| 1913 | optional State state = 1; |
| 1914 | } |
| 1915 | |
Hyunyoung Song | cc651c1 | 2018-10-17 13:35:32 -0700 | [diff] [blame] | 1916 | message LauncherUIChanged { |
Yao Chen | 046b512 | 2018-10-24 14:09:20 -0700 | [diff] [blame] | 1917 | optional android.stats.launcher.LauncherAction action = 1; |
| 1918 | optional android.stats.launcher.LauncherState src_state = 2; |
| 1919 | optional android.stats.launcher.LauncherState dst_state = 3; |
| 1920 | optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES]; |
Hyunyoung Song | cc651c1 | 2018-10-17 13:35:32 -0700 | [diff] [blame] | 1921 | optional bool is_swipe_up_enabled = 5; |
| 1922 | } |
| 1923 | |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1924 | /** |
| 1925 | * Logs that a setting was updated. |
| 1926 | * Logged from: |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1927 | * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1928 | * The tag and is_default allow resetting of settings to default values based on the specified |
| 1929 | * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details. |
| 1930 | */ |
| 1931 | message SettingChanged { |
| 1932 | // The name of the setting. |
| 1933 | optional string setting = 1; |
| 1934 | |
| 1935 | // The change being imposed on this setting. May represent a number, eg "3". |
| 1936 | optional string value = 2; |
| 1937 | |
| 1938 | // The new value of this setting. For most settings, this is same as value. For some settings, |
| 1939 | // value is +X or -X where X represents an element in a set. For example, if the previous value |
| 1940 | // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C. |
| 1941 | // The +/- feature is currently only used for location_providers_allowed. |
| 1942 | optional string new_value = 3; |
| 1943 | |
| 1944 | // The previous value of this setting. |
| 1945 | optional string prev_value = 4; |
| 1946 | |
| 1947 | // The tag used with the is_default for resetting sets of settings. This is generally null. |
| 1948 | optional string tag = 5; |
| 1949 | |
Bookatz | 9086762 | 2018-01-31 15:05:57 -0800 | [diff] [blame] | 1950 | // True if this setting with tag should be resettable. |
| 1951 | optional bool is_default = 6; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1952 | |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1953 | // The associated user (for multi-user feature). Defined in android/os/UserHandle.java |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1954 | optional int32 user = 7; |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1955 | |
| 1956 | enum ChangeReason { |
| 1957 | UPDATED = 1; // Updated can be an insertion or an update. |
| 1958 | DELETED = 2; |
| 1959 | } |
| 1960 | optional ChangeReason reason = 8; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1961 | } |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 1962 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1963 | /** |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1964 | * Logs activity going to foreground or background |
| 1965 | * |
| 1966 | * Logged from: |
| 1967 | * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java |
| 1968 | */ |
| 1969 | message ActivityForegroundStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1970 | optional int32 uid = 1 [(is_uid) = true]; |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 1971 | optional string pkg_name = 2; |
| 1972 | optional string class_name = 3; |
| 1973 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1974 | enum State { |
| 1975 | BACKGROUND = 0; |
| 1976 | FOREGROUND = 1; |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1977 | } |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1978 | optional State state = 4; |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1979 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1980 | |
| 1981 | /** |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1982 | * Logs when an app crashes. |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1983 | * Logged from: |
| 1984 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1985 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1986 | message AppCrashOccurred { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1987 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1988 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1989 | optional string event_type = 2; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1990 | |
| 1991 | // The name of the process. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1992 | // system_server if it is not by an app |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1993 | optional string process_name = 3; |
| 1994 | |
| 1995 | // The pid if available. -1 means not available. |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 1996 | optional sint32 pid = 4; |
Chenjie Yu | f17bf62 | 2018-04-02 14:22:19 -0700 | [diff] [blame] | 1997 | |
| 1998 | optional string package_name = 5; |
| 1999 | |
| 2000 | enum InstantApp { |
| 2001 | UNAVAILABLE = 0; |
| 2002 | FALSE = 1; |
| 2003 | TRUE = 2; |
| 2004 | } |
| 2005 | optional InstantApp is_instant_app = 6; |
| 2006 | |
| 2007 | enum ForegroundState { |
| 2008 | UNKNOWN = 0; |
| 2009 | BACKGROUND = 1; |
| 2010 | FOREGROUND = 2; |
| 2011 | } |
| 2012 | optional ForegroundState foreground_state = 7; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2013 | } |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 2014 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2015 | /** |
| 2016 | * Logs when a WTF (What a Terrible Failure) happened. |
| 2017 | * Logged from: |
| 2018 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 2019 | */ |
| 2020 | message WTFOccurred { |
| 2021 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 2022 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2023 | optional string tag = 2; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 2024 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2025 | // The name of the process. |
| 2026 | // system_server if it is not by an app |
| 2027 | optional string process_name = 3; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 2028 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2029 | // The pid if available. -1 means not available. |
| 2030 | optional sint32 pid = 4; |
| 2031 | } |
| 2032 | |
| 2033 | /** |
| 2034 | * Logs when system server reports low memory. |
| 2035 | * Logged from: |
| 2036 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 2037 | */ |
| 2038 | message LowMemReported { |
| 2039 | } |
| 2040 | |
| 2041 | /** |
| 2042 | * Logs when an app ANR (App Not Responding) occurs. |
| 2043 | * Logged from: |
| 2044 | * frameworks/base/services/core/java/com/android/server/am/AppErrors.java |
| 2045 | */ |
| 2046 | message ANROccurred { |
| 2047 | optional int32 uid = 1 [(is_uid) = true]; |
| 2048 | |
| 2049 | optional string process_name = 2; |
| 2050 | |
| 2051 | optional string short_component_name = 3; |
| 2052 | |
| 2053 | optional string reason = 4; |
Chenjie Yu | f17bf62 | 2018-04-02 14:22:19 -0700 | [diff] [blame] | 2054 | |
| 2055 | enum InstantApp { |
| 2056 | UNAVAILABLE = 0; |
| 2057 | FALSE = 1; |
| 2058 | TRUE = 2; |
| 2059 | } |
| 2060 | optional InstantApp is_instant_app = 5; |
| 2061 | |
| 2062 | enum ForegroundState { |
| 2063 | UNKNOWN = 0; |
| 2064 | BACKGROUND = 1; |
| 2065 | FOREGROUND = 2; |
| 2066 | } |
| 2067 | optional ForegroundState foreground_state = 6; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 2068 | } |
| 2069 | |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 2070 | /* |
| 2071 | * Allows other apps to push events into statsd. |
| 2072 | * Logged from: |
| 2073 | * frameworks/base/core/java/android/util/StatsLog.java |
| 2074 | */ |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2075 | message AppBreadcrumbReported { |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 2076 | // The uid of the application that sent this custom atom. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2077 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 2078 | |
| 2079 | // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16). |
| 2080 | optional int32 label = 2; |
| 2081 | |
| 2082 | // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom |
| 2083 | // predicates for the metrics). |
| 2084 | enum State { |
| 2085 | UNKNOWN = 0; |
| 2086 | UNSPECIFIED = 1; // For events that are known to not represent START/STOP. |
| 2087 | STOP = 2; |
| 2088 | START = 3; |
| 2089 | } |
| 2090 | optional State state = 3; |
| 2091 | } |
| 2092 | |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 2093 | /** |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 2094 | * Logs when statsd detects an anomaly. |
| 2095 | * |
| 2096 | * Logged from: |
| 2097 | * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp |
| 2098 | */ |
| 2099 | message AnomalyDetected { |
| 2100 | // Uid that owns the config whose anomaly detection alert fired. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2101 | optional int32 config_uid = 1 [(is_uid) = true]; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 2102 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 2103 | // Id of the config whose anomaly detection alert fired. |
| 2104 | optional int64 config_id = 2; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 2105 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 2106 | // Id of the alert (i.e. name of the anomaly that was detected). |
| 2107 | optional int64 alert_id = 3; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 2108 | } |
| 2109 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2110 | message AppStartOccurred { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2111 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2112 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2113 | |
| 2114 | // The app package name. |
| 2115 | optional string pkg_name = 2; |
| 2116 | |
| 2117 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2118 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2119 | WARM = 1; |
| 2120 | HOT = 2; |
| 2121 | COLD = 3; |
| 2122 | } |
| 2123 | // The transition type. |
| 2124 | optional TransitionType type = 3; |
| 2125 | |
| 2126 | // The activity name. |
| 2127 | optional string activity_name = 4; |
| 2128 | |
| 2129 | // The name of the calling app. Empty if not set. |
| 2130 | optional string calling_pkg_name = 5; |
| 2131 | |
| 2132 | // Whether the app is an instant app. |
| 2133 | optional bool is_instant_app = 6; |
| 2134 | |
| 2135 | // Device uptime when activity started. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2136 | optional int64 activity_start_millis = 7; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2137 | |
Bookatz | 80d11a0 | 2018-01-16 10:46:35 -0800 | [diff] [blame] | 2138 | optional android.app.AppTransitionReasonEnum reason = 8; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2139 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2140 | optional int32 transition_delay_millis = 9; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2141 | // -1 if not set. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2142 | optional int32 starting_window_delay_millis = 10; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2143 | // -1 if not set. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2144 | optional int32 bind_application_delay_millis = 11; |
| 2145 | optional int32 windows_drawn_delay_millis = 12; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2146 | |
| 2147 | // Empty if not set. |
| 2148 | optional string launch_token = 13; |
| 2149 | |
Calin Juravle | 759fbda | 2018-02-20 19:52:30 +0000 | [diff] [blame] | 2150 | // The compiler filter used when when the package was optimized. |
Calin Juravle | a86783b | 2018-03-21 14:25:59 -0700 | [diff] [blame] | 2151 | optional int32 package_optimization_compilation_filter = 14; |
Calin Juravle | 759fbda | 2018-02-20 19:52:30 +0000 | [diff] [blame] | 2152 | |
| 2153 | // The reason why the package was optimized. |
Calin Juravle | a86783b | 2018-03-21 14:25:59 -0700 | [diff] [blame] | 2154 | optional int32 package_optimization_compilation_reason = 15; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2155 | } |
| 2156 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2157 | message AppStartCanceled { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2158 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2159 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2160 | |
| 2161 | // The app package name. |
| 2162 | optional string pkg_name = 2; |
| 2163 | |
| 2164 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2165 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2166 | WARM = 1; |
| 2167 | HOT = 2; |
| 2168 | COLD = 3; |
| 2169 | } |
| 2170 | // The transition type. |
| 2171 | optional TransitionType type = 3; |
| 2172 | |
| 2173 | // The activity name. |
| 2174 | optional string activity_name = 4; |
| 2175 | } |
| 2176 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2177 | message AppStartFullyDrawn { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2178 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2179 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2180 | |
| 2181 | // The app package name. |
| 2182 | optional string pkg_name = 2; |
| 2183 | |
| 2184 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2185 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2186 | WITH_BUNDLE = 1; |
| 2187 | WITHOUT_BUNDLE = 2; |
| 2188 | } |
| 2189 | // The transition type. |
| 2190 | optional TransitionType type = 3; |
| 2191 | |
| 2192 | // The activity name. |
| 2193 | optional string activity_name = 4; |
| 2194 | |
| 2195 | optional bool transition_process_running = 5; |
| 2196 | |
| 2197 | // App startup time (until call to Activity#reportFullyDrawn()). |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2198 | optional int64 app_startup_time_millis = 6; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2199 | } |
| 2200 | |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 2201 | /** |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2202 | * Logs a picture-in-picture action |
| 2203 | * Logged from: |
| 2204 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 2205 | * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java |
| 2206 | * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java |
| 2207 | */ |
| 2208 | message PictureInPictureStateChanged { |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 2209 | // -1 if it is not available |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2210 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2211 | |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 2212 | optional string short_name = 2; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2213 | |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2214 | enum State { |
| 2215 | ENTERED = 1; |
| 2216 | EXPANDED_TO_FULL_SCREEN = 2; |
| 2217 | MINIMIZED = 3; |
| 2218 | DISMISSED = 4; |
| 2219 | } |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 2220 | optional State state = 3; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2221 | } |
| 2222 | |
| 2223 | /** |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 2224 | * Logs overlay action |
| 2225 | * Logged from: |
| 2226 | * services/core/java/com/android/server/wm/Session.java |
| 2227 | */ |
| 2228 | message OverlayStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2229 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 2230 | |
| 2231 | optional string package_name = 2; |
| 2232 | |
| 2233 | optional bool using_alert_window = 3; |
| 2234 | |
| 2235 | enum State { |
| 2236 | ENTERED = 1; |
| 2237 | EXITED = 2; |
| 2238 | } |
| 2239 | optional State state = 4; |
| 2240 | } |
| 2241 | |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 2242 | /* |
| 2243 | * Logs foreground service starts and stops. |
| 2244 | * Note that this is not when a service starts or stops, but when it is |
| 2245 | * considered foreground. |
| 2246 | * Logged from |
| 2247 | * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java |
| 2248 | */ |
| 2249 | message ForegroundServiceStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2250 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 2251 | // package_name + "/" + class_name |
| 2252 | optional string short_name = 2; |
| 2253 | |
| 2254 | enum State { |
| 2255 | ENTER = 1; |
| 2256 | EXIT = 2; |
| 2257 | } |
| 2258 | optional State state = 3; |
| 2259 | } |
| 2260 | |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 2261 | /** |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2262 | * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky |
| 2263 | * behavior in its own uid. However, the metrics of these isolated uid's almost always should be |
| 2264 | * attributed back to the parent (host) uid. One example is Chrome. |
| 2265 | * |
| 2266 | * Logged from: |
| 2267 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 2268 | */ |
| 2269 | message IsolatedUidChanged { |
| 2270 | // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2271 | // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd. |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2272 | optional int32 parent_uid = 1; |
| 2273 | |
| 2274 | optional int32 isolated_uid = 2; |
| 2275 | |
| 2276 | // We expect an isolated uid to be removed before if it's used for another parent uid. |
| 2277 | enum Event { |
| 2278 | REMOVED = 0; |
| 2279 | CREATED = 1; |
| 2280 | } |
| 2281 | optional Event event = 3; |
| 2282 | } |
| 2283 | |
| 2284 | /* |
| 2285 | * Logs the reception of an incoming network packet causing the main system to wake up for |
| 2286 | * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd |
| 2287 | * and processed by WakeupController.cpp. |
| 2288 | */ |
| 2289 | message PacketWakeupOccurred { |
| 2290 | // The uid owning the socket into which the packet was delivered, or -1 if the packet was |
| 2291 | // delivered nowhere. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2292 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2293 | // The interface name on which the packet was received. |
| 2294 | optional string iface = 2; |
| 2295 | // The ethertype value of the packet. |
| 2296 | optional int32 ethertype = 3; |
| 2297 | // String representation of the destination MAC address of the packet. |
| 2298 | optional string destination_hardware_address = 4; |
| 2299 | // String representation of the source address of the packet if this was an IP packet. |
| 2300 | optional string source_ip = 5; |
| 2301 | // String representation of the destination address of the packet if this was an IP packet. |
| 2302 | optional string destination_ip = 6; |
| 2303 | // The value of the protocol field if this was an IPv4 packet or the value of the Next Header |
| 2304 | // field if this was an IPv6 packet. The range of possible values is the same for both IP |
| 2305 | // families. |
| 2306 | optional int32 ip_next_header = 7; |
| 2307 | // The source port if this was a TCP or UDP packet. |
| 2308 | optional int32 source_port = 8; |
| 2309 | // The destination port if this was a TCP or UDP packet. |
| 2310 | optional int32 destination_port = 9; |
| 2311 | } |
| 2312 | |
| 2313 | /* |
| 2314 | * Logs the memory stats for an app on startup. |
| 2315 | * Logged from: |
| 2316 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 2317 | */ |
| 2318 | message AppStartMemoryStateCaptured { |
| 2319 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2320 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2321 | |
| 2322 | // The process name. |
| 2323 | optional string process_name = 2; |
| 2324 | |
| 2325 | // The activity name. |
| 2326 | optional string activity_name = 3; |
| 2327 | |
| 2328 | // # of page-faults |
| 2329 | optional int64 pgfault = 4; |
| 2330 | |
| 2331 | // # of major page-faults |
| 2332 | optional int64 pgmajfault = 5; |
| 2333 | |
| 2334 | // RSS |
| 2335 | optional int64 rss_in_bytes = 6; |
| 2336 | |
| 2337 | // CACHE |
| 2338 | optional int64 cache_in_bytes = 7; |
| 2339 | |
| 2340 | // SWAP |
| 2341 | optional int64 swap_in_bytes = 8; |
| 2342 | } |
| 2343 | |
| 2344 | /* |
| 2345 | * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries |
| 2346 | * for LMK event. |
| 2347 | * Logged from: |
| 2348 | * system/core/lmkd/lmkd.c |
| 2349 | */ |
| 2350 | message LmkStateChanged { |
| 2351 | enum State { |
| 2352 | UNKNOWN = 0; |
| 2353 | START = 1; |
| 2354 | STOP = 2; |
| 2355 | } |
| 2356 | optional State state = 1; |
| 2357 | } |
| 2358 | |
| 2359 | /* |
| 2360 | * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure. |
| 2361 | * Logged from: |
| 2362 | * system/core/lmkd/lmkd.c |
| 2363 | */ |
| 2364 | message LmkKillOccurred { |
| 2365 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2366 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2367 | |
| 2368 | // The process name. |
| 2369 | optional string process_name = 2; |
| 2370 | |
| 2371 | // oom adj score. |
| 2372 | optional int32 oom_score = 3; |
| 2373 | |
| 2374 | // # of page-faults |
| 2375 | optional int64 pgfault = 4; |
| 2376 | |
| 2377 | // # of major page-faults |
| 2378 | optional int64 pgmajfault = 5; |
| 2379 | |
| 2380 | // RSS |
| 2381 | optional int64 rss_in_bytes = 6; |
| 2382 | |
| 2383 | // CACHE |
| 2384 | optional int64 cache_in_bytes = 7; |
| 2385 | |
| 2386 | // SWAP |
| 2387 | optional int64 swap_in_bytes = 8; |
Jim Blackler | 972a5c5 | 2018-11-21 15:24:48 +0000 | [diff] [blame] | 2388 | |
| 2389 | // The elapsed real time of start of the process. |
| 2390 | optional int64 process_start_time_nanos = 9; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2391 | } |
| 2392 | |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 2393 | /* |
| 2394 | * Logs when the ActivityManagerService detects that an app died. |
| 2395 | * |
| 2396 | * Logged from: |
| 2397 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 2398 | */ |
| 2399 | message AppDied { |
| 2400 | // timestamp(elapsedRealtime) of record creation |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2401 | optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE]; |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 2402 | } |
| 2403 | |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2404 | ////////////////////////////////////////////////////////////////////// |
| 2405 | // Pulled atoms below this line // |
| 2406 | ////////////////////////////////////////////////////////////////////// |
| 2407 | |
| 2408 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2409 | * Pulls bytes transferred via wifi (Sum of foreground and background usage). |
| 2410 | * |
| 2411 | * Pulled from: |
| 2412 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 2413 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2414 | message WifiBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2415 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2416 | |
| 2417 | optional int64 rx_bytes = 2; |
| 2418 | |
| 2419 | optional int64 rx_packets = 3; |
| 2420 | |
| 2421 | optional int64 tx_bytes = 4; |
| 2422 | |
| 2423 | optional int64 tx_packets = 5; |
| 2424 | } |
| 2425 | |
| 2426 | /** |
| 2427 | * Pulls bytes transferred via wifi (separated by foreground and background usage). |
| 2428 | * |
| 2429 | * Pulled from: |
| 2430 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 2431 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2432 | message WifiBytesTransferByFgBg { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2433 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2434 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2435 | // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats. |
| 2436 | optional bool is_foreground = 2; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2437 | |
| 2438 | optional int64 rx_bytes = 3; |
| 2439 | |
| 2440 | optional int64 rx_packets = 4; |
| 2441 | |
| 2442 | optional int64 tx_bytes = 5; |
| 2443 | |
| 2444 | optional int64 tx_packets = 6; |
| 2445 | } |
| 2446 | |
| 2447 | /** |
| 2448 | * Pulls bytes transferred via mobile networks (Sum of foreground and background usage). |
| 2449 | * |
| 2450 | * Pulled from: |
| 2451 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 2452 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2453 | message MobileBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2454 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2455 | |
| 2456 | optional int64 rx_bytes = 2; |
| 2457 | |
| 2458 | optional int64 rx_packets = 3; |
| 2459 | |
| 2460 | optional int64 tx_bytes = 4; |
| 2461 | |
| 2462 | optional int64 tx_packets = 5; |
| 2463 | } |
| 2464 | |
| 2465 | /** |
| 2466 | * Pulls bytes transferred via mobile networks (separated by foreground and background usage). |
| 2467 | * |
| 2468 | * Pulled from: |
| 2469 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 2470 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2471 | message MobileBytesTransferByFgBg { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2472 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2473 | |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2474 | // 1 denotes foreground and 0 denotes background. This is called Set in |
| 2475 | // NetworkStats. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2476 | optional bool is_foreground = 2; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2477 | |
| 2478 | optional int64 rx_bytes = 3; |
| 2479 | |
| 2480 | optional int64 rx_packets = 4; |
| 2481 | |
| 2482 | optional int64 tx_bytes = 5; |
| 2483 | |
| 2484 | optional int64 tx_packets = 6; |
| 2485 | } |
| 2486 | |
| 2487 | /** |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2488 | * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller. |
| 2489 | * |
| 2490 | * Pulled from: |
| 2491 | * StatsCompanionService |
| 2492 | */ |
| 2493 | message BluetoothBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2494 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2495 | |
| 2496 | optional int64 rx_bytes = 2; |
| 2497 | |
| 2498 | optional int64 tx_bytes = 3; |
| 2499 | } |
| 2500 | |
| 2501 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2502 | * Pulls the kernel wakelock durations. This atom is adapted from |
| 2503 | * android/internal/os/KernelWakelockStats.java |
| 2504 | * |
| 2505 | * Pulled from: |
| 2506 | * StatsCompanionService using KernelWakelockReader. |
| 2507 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2508 | message KernelWakelock { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2509 | optional string name = 1; |
| 2510 | |
| 2511 | optional int32 count = 2; |
| 2512 | |
| 2513 | optional int32 version = 3; |
| 2514 | |
| 2515 | optional int64 time = 4; |
| 2516 | } |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 2517 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2518 | /** |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 2519 | * Pulls low power state information. This includes platform and subsystem sleep state information, |
| 2520 | * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 2521 | * hardware/interfaces/power/1.0/types.hal |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 2522 | * hardware/interfaces/power/1.1/types.hal |
| 2523 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2524 | message SubsystemSleepState { |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2525 | // Subsystem name |
| 2526 | optional string subsystem_name = 1; |
| 2527 | // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty. |
| 2528 | // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name. |
| 2529 | optional string subname = 2; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 2530 | // The number of times it entered, or voted for entering the sleep state |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2531 | optional uint64 count = 3; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 2532 | // The length of time spent in, or spent voting for, the sleep state |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2533 | optional uint64 time_millis = 4; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 2534 | } |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2535 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2536 | /** |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2537 | * Pulls Cpu time per frequency. |
Chenjie Yu | 1ee9b74 | 2018-01-10 16:02:57 -0800 | [diff] [blame] | 2538 | * Pulls the time the cpu spend on the frequency index. Frequency index |
| 2539 | * starts from highest to lowest. The value should be monotonically |
| 2540 | * increasing since boot. However, if there is a cpu |
| 2541 | * hotplug event, the value would be reset as well. |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2542 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2543 | message CpuTimePerFreq { |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2544 | optional uint32 cluster = 1; |
| 2545 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2546 | optional uint64 time_millis = 3; |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2547 | } |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2548 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2549 | /** |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2550 | * Pulls Cpu Time Per Uid. |
| 2551 | * Note that isolated process uid time should be attributed to host uids. |
| 2552 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2553 | message CpuTimePerUid { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2554 | optional int32 uid = 1 [(is_uid) = true]; |
Misha Wagner | 6bc6c91 | 2018-11-16 13:19:54 +0000 | [diff] [blame] | 2555 | optional uint64 user_time_micros = 2; |
| 2556 | optional uint64 sys_time_micros = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2557 | } |
| 2558 | |
| 2559 | /** |
| 2560 | * Pulls Cpu Time Per Uid per frequency. |
| 2561 | * Note that isolated process uid time should be attributed to host uids. |
| 2562 | * For each uid, we order the time by descending frequencies. |
| 2563 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2564 | message CpuTimePerUidFreq { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2565 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2566 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2567 | optional uint64 time_millis = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2568 | } |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 2569 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2570 | /** |
| 2571 | * Pulls Wifi Controller Activity Energy Info |
| 2572 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2573 | message WifiActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2574 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2575 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2576 | // stack reported state |
| 2577 | // TODO: replace this with proto enum |
| 2578 | optional int32 stack_state = 2; |
| 2579 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2580 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2581 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2582 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2583 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2584 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2585 | // product of current(mA), voltage(V) and time(ms) |
| 2586 | optional uint64 controller_energy_used = 6; |
| 2587 | } |
| 2588 | |
| 2589 | /** |
| 2590 | * Pulls Modem Activity Energy Info |
| 2591 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2592 | message ModemActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2593 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2594 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2595 | // sleep time in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2596 | optional uint64 sleep_time_millis = 2; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2597 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2598 | optional uint64 controller_idle_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2599 | /** |
| 2600 | * Tx power index |
| 2601 | * index 0 = tx_power < 0dBm |
| 2602 | * index 1 = 0dBm < tx_power < 5dBm |
| 2603 | * index 2 = 5dBm < tx_power < 15dBm |
| 2604 | * index 3 = 15dBm < tx_power < 20dBm |
| 2605 | * index 4 = tx_power > 20dBm |
| 2606 | */ |
| 2607 | // tx time in ms at power level 0 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2608 | optional uint64 controller_tx_time_pl0_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2609 | // tx time in ms at power level 1 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2610 | optional uint64 controller_tx_time_pl1_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2611 | // tx time in ms at power level 2 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2612 | optional uint64 controller_tx_time_pl2_millis = 6; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2613 | // tx time in ms at power level 3 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2614 | optional uint64 controller_tx_time_pl3_millis = 7; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2615 | // tx time in ms at power level 4 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2616 | optional uint64 controller_tx_time_pl4_millis = 8; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2617 | // rx time in ms at power level 5 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2618 | optional uint64 controller_rx_time_millis = 9; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2619 | // product of current(mA), voltage(V) and time(ms) |
| 2620 | optional uint64 energy_used = 10; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 2621 | } |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 2622 | |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2623 | /** |
| 2624 | * Pulls Bluetooth Activity Energy Info |
| 2625 | * Note: BluetoothBytesTransfer is pulled at the same time from the controller. |
| 2626 | */ |
| 2627 | message BluetoothActivityInfo { |
| 2628 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2629 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2630 | // bluetooth stack state |
| 2631 | optional int32 bluetooth_stack_state = 2; |
| 2632 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2633 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2634 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2635 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2636 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2637 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2638 | // product of current(mA), voltage(V) and time(ms) |
| 2639 | optional uint64 energy_used = 6; |
| 2640 | } |
| 2641 | |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 2642 | /* |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2643 | * Logs the memory stats for a process. |
| 2644 | */ |
| 2645 | message ProcessMemoryState { |
| 2646 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2647 | optional int32 uid = 1 [(is_uid) = true]; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2648 | |
| 2649 | // The process name. |
| 2650 | optional string process_name = 2; |
| 2651 | |
| 2652 | // oom adj score. |
| 2653 | optional int32 oom_score = 3; |
| 2654 | |
| 2655 | // # of page-faults |
| 2656 | optional int64 pgfault = 4; |
| 2657 | |
| 2658 | // # of major page-faults |
| 2659 | optional int64 pgmajfault = 5; |
| 2660 | |
Rajeev Kumar | 9023599 | 2018-01-29 11:06:48 -0800 | [diff] [blame] | 2661 | // RSS |
| 2662 | optional int64 rss_in_bytes = 6; |
| 2663 | |
| 2664 | // CACHE |
| 2665 | optional int64 cache_in_bytes = 7; |
| 2666 | |
| 2667 | // SWAP |
| 2668 | optional int64 swap_in_bytes = 8; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2669 | } |
| 2670 | |
| 2671 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2672 | * Elapsed real time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2673 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2674 | message SystemElapsedRealtime { |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2675 | optional uint64 time_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2676 | } |
| 2677 | |
| 2678 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2679 | * Up time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2680 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2681 | message SystemUptime { |
| 2682 | // Milliseconds since the system was booted. |
| 2683 | // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting |
| 2684 | // for external input). |
| 2685 | // It is not affected by clock scaling, idle, or other power saving mechanisms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2686 | optional uint64 uptime_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2687 | } |
| 2688 | |
| 2689 | /* |
| 2690 | * Reads from /proc/uid_concurrent_active_time which has the format: |
| 2691 | * active: X (X is # cores) |
| 2692 | * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores) |
| 2693 | * [uid1]: [time-0] [time-1] [time-2] ... ... |
| 2694 | * ... |
| 2695 | * Time-N means the CPU time a UID spent running concurrently with N other processes. |
| 2696 | * The file contains a monotonically increasing count of time for a single boot. |
| 2697 | */ |
| 2698 | message CpuActiveTime { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2699 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2700 | optional uint64 time_millis = 2; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2701 | } |
| 2702 | |
| 2703 | /** |
| 2704 | * Reads from /proc/uid_concurrent_policy_time which has the format: |
| 2705 | * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4) |
| 2706 | * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 2707 | * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 2708 | * ... |
| 2709 | * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes. |
| 2710 | * The file contains a monotonically increasing count of time for a single boot. |
| 2711 | */ |
| 2712 | message CpuClusterTime { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2713 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2714 | optional int32 cluster_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2715 | optional uint64 time_millis = 3; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame] | 2716 | } |
| 2717 | |
| 2718 | /* |
| 2719 | * Pulls free disk space, for data, system partition and temporary directory. |
| 2720 | */ |
| 2721 | message DiskSpace { |
| 2722 | // available bytes in data partition |
| 2723 | optional uint64 data_available_bytes = 1; |
| 2724 | // available bytes in system partition |
| 2725 | optional uint64 system_available_bytes = 2; |
| 2726 | // available bytes in download cache or temp directories |
| 2727 | optional uint64 temp_available_bytes = 3; |
| 2728 | } |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2729 | |
| 2730 | /** |
| 2731 | * Pulls battery coulomb counter, which is the remaining battery charge in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2732 | * Pulled from: |
| 2733 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2734 | */ |
| 2735 | message RemainingBatteryCapacity { |
| 2736 | optional int32 charge_uAh = 1; |
| 2737 | } |
| 2738 | |
| 2739 | /** |
| 2740 | * Pulls battery capacity, which is the battery capacity when full in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2741 | * Pulled from: |
| 2742 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2743 | */ |
| 2744 | message FullBatteryCapacity { |
| 2745 | optional int32 capacity_uAh = 1; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2746 | } |
| 2747 | |
| 2748 | /** |
Tej Singh | d89137e | 2018-03-26 14:51:40 -0700 | [diff] [blame] | 2749 | * Pulls the temperature of various parts of the device. |
| 2750 | * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2751 | * |
| 2752 | * Pulled from: |
| 2753 | * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp |
| 2754 | */ |
| 2755 | message Temperature { |
| 2756 | // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY. |
| 2757 | optional android.os.TemperatureTypeEnum sensor_location = 1; |
| 2758 | |
| 2759 | // The name of the temperature source. Eg. CPU0 |
| 2760 | optional string sensor_name = 2; |
| 2761 | |
Tej Singh | d89137e | 2018-03-26 14:51:40 -0700 | [diff] [blame] | 2762 | // Temperature in tenths of a degree C. |
| 2763 | optional int32 temperature_dC = 3; |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 2764 | } |
lifr | 35a7cf0 | 2018-12-12 16:38:04 +0800 | [diff] [blame] | 2765 | |
| 2766 | /** |
| 2767 | * Logs the latency period(in microseconds) and the return code of |
| 2768 | * the DNS(Domain Name System) lookups. |
| 2769 | * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND) |
| 2770 | * to get info(address or hostname) from DNS server(or DNS cache). |
| 2771 | * Logged from: |
| 2772 | * /system/netd/server/DnsProxyListener.cpp |
| 2773 | */ |
| 2774 | message NetworkDnsEventReported { |
| 2775 | // The types of the DNS lookups, as defined in |
| 2776 | //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl |
| 2777 | enum EventType { |
| 2778 | EVENT_UNKNOWN = 0; |
| 2779 | EVENT_GETADDRINFO = 1; |
| 2780 | EVENT_GETHOSTBYNAME = 2; |
| 2781 | EVENT_GETHOSTBYADDR = 3; |
| 2782 | EVENT_RES_NSEND = 4; |
| 2783 | } |
| 2784 | optional EventType event_type = 1; |
| 2785 | |
| 2786 | // The return value of the DNS resolver for each DNS lookups. |
| 2787 | //bionic/libc/include/netdb.h |
| 2788 | //system/netd/resolv/include/netd_resolv/resolv.h |
| 2789 | enum ReturnCode { |
| 2790 | EAI_NO_ERROR = 0; |
| 2791 | EAI_ADDRFAMILY = 1; |
| 2792 | EAI_AGAIN = 2; |
| 2793 | EAI_BADFLAGS = 3; |
| 2794 | EAI_FAIL = 4; |
| 2795 | EAI_FAMILY = 5; |
| 2796 | EAI_MEMORY = 6; |
| 2797 | EAI_NODATA = 7; |
| 2798 | EAI_NONAME = 8; |
| 2799 | EAI_SERVICE = 9; |
| 2800 | EAI_SOCKTYPE = 10; |
| 2801 | EAI_SYSTEM = 11; |
| 2802 | EAI_BADHINTS = 12; |
| 2803 | EAI_PROTOCOL = 13; |
| 2804 | EAI_OVERFLOW = 14; |
| 2805 | RESOLV_TIMEOUT = 255; |
| 2806 | EAI_MAX = 256; |
| 2807 | } |
| 2808 | optional ReturnCode return_code = 2; |
| 2809 | |
| 2810 | // The latency period(in microseconds) it took for this DNS lookup to complete. |
| 2811 | optional int32 latency_micros = 3; |
| 2812 | } |
| 2813 | |
Chiachang Wang | 67f2447 | 2019-01-15 15:14:00 +0800 | [diff] [blame] | 2814 | /** |
| 2815 | * Logs when a data stall event occurs. |
| 2816 | * |
| 2817 | * Log from: |
| 2818 | * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java |
| 2819 | */ |
| 2820 | message DataStallEvent { |
| 2821 | // Data stall evaluation type. |
| 2822 | // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java |
| 2823 | // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*. |
| 2824 | optional int32 evaluation_type = 1; |
| 2825 | // See definition in data_stall_event.proto. |
| 2826 | optional com.android.server.connectivity.ProbeResult validation_result = 2; |
| 2827 | // See definition in data_stall_event.proto. |
| 2828 | optional android.net.NetworkCapabilitiesProto.Transport network_type = 3; |
| 2829 | // See definition in data_stall_event.proto. |
| 2830 | optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES]; |
| 2831 | // See definition in data_stall_event.proto. |
| 2832 | optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES]; |
| 2833 | // See definition in data_stall_event.proto. |
| 2834 | optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES]; |
| 2835 | } |
Jack Yu | 6d421bc | 2019-01-23 17:42:54 +0800 | [diff] [blame] | 2836 | |
| 2837 | /** |
| 2838 | * Logs when a NFC device's error occurred. |
| 2839 | * Logged from: |
| 2840 | * system/nfc/src/nfc/nfc/nfc_ncif.cc |
| 2841 | * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java |
| 2842 | */ |
| 2843 | message NfcErrorOccurred { |
| 2844 | enum Type { |
| 2845 | UNKNOWN = 0; |
| 2846 | CMD_TIMEOUT = 1; |
| 2847 | ERROR_NOTIFICATION = 2; |
| 2848 | AID_OVERFLOW = 3; |
| 2849 | } |
| 2850 | optional Type type = 1; |
| 2851 | // If it's nci cmd timeout, log the timeout command. |
| 2852 | optional uint32 nci_cmd = 2; |
| 2853 | |
| 2854 | optional uint32 error_ntf_status_code = 3; |
| 2855 | } |
| 2856 | |
| 2857 | /** |
| 2858 | * Logs when a NFC device's state changed event |
| 2859 | * Logged from: |
| 2860 | * packages/apps/Nfc/src/com/android/nfc/NfcService.java |
| 2861 | */ |
| 2862 | message NfcStateChanged { |
| 2863 | enum State { |
| 2864 | UNKNOWN = 0; |
| 2865 | OFF = 1; |
| 2866 | ON = 2; |
| 2867 | ON_LOCKED = 3; // Secure Nfc enabled. |
| 2868 | CRASH_RESTART = 4; // NfcService watchdog timeout restart. |
| 2869 | } |
| 2870 | optional State state = 1; |
| 2871 | } |
| 2872 | |
| 2873 | /** |
| 2874 | * Logs when a NFC Beam Transaction occurred. |
| 2875 | * Logged from: |
| 2876 | * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java |
| 2877 | */ |
| 2878 | message NfcBeamOccurred { |
| 2879 | enum Operation { |
| 2880 | UNKNOWN = 0; |
| 2881 | SEND = 1; |
| 2882 | RECEIVE = 2; |
| 2883 | } |
| 2884 | optional Operation operation = 1; |
| 2885 | } |
| 2886 | |
| 2887 | /** |
| 2888 | * Logs when a NFC Card Emulation Transaction occurred. |
| 2889 | * Logged from: |
| 2890 | * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java |
| 2891 | * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java |
| 2892 | */ |
| 2893 | message NfcCardemulationOccurred { |
| 2894 | enum Category { |
| 2895 | UNKNOWN = 0; |
| 2896 | HCE_PAYMENT = 1; |
| 2897 | HCE_OTHER = 2; |
| 2898 | OFFHOST = 3; |
| 2899 | } |
| 2900 | // Transaction belongs to HCE payment or HCE other category, or offhost. |
| 2901 | optional Category category = 1; |
| 2902 | // SeName from transaction: SIMx, eSEx, HCE, HCEF. |
| 2903 | optional string se_name = 2; |
| 2904 | } |
| 2905 | |
| 2906 | /** |
| 2907 | * Logs when a NFC Tag event occurred. |
| 2908 | * Logged from: |
| 2909 | * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java |
| 2910 | */ |
| 2911 | message NfcTagOccurred { |
| 2912 | enum Type { |
| 2913 | UNKNOWN = 0; |
| 2914 | URL = 1; |
| 2915 | BT_PAIRING = 2; |
| 2916 | PROVISION = 3; |
| 2917 | WIFI_CONNECT = 4; |
| 2918 | APP_LAUNCH = 5; |
| 2919 | OTHERS = 6; |
| 2920 | } |
| 2921 | optional Type type = 1; |
| 2922 | } |
| 2923 | |
| 2924 | /** |
| 2925 | * Logs when Hce transaction triggered |
| 2926 | * Logged from: |
| 2927 | * system/nfc/src/nfc/nfc/nfc_ncif.cc |
| 2928 | */ |
| 2929 | message NfcHceTransactionOccurred { |
| 2930 | // The latency period(in microseconds) it took for the first HCE data |
| 2931 | // exchange. |
| 2932 | optional uint32 latency_micros = 1; |
| 2933 | } |
| 2934 | |
| 2935 | /** |
| 2936 | * Logs when SecureElement state event changed |
| 2937 | * Logged from: |
| 2938 | * packages/apps/SecureElement/src/com/android/se/Terminal.java |
| 2939 | */ |
| 2940 | message SeStateChanged { |
| 2941 | enum State { |
| 2942 | UNKNOWN = 0; |
| 2943 | INITIALIZED = 1; |
| 2944 | DISCONNECTED = 2; |
| 2945 | CONNECTED = 3; |
| 2946 | HALCRASH = 4; |
| 2947 | } |
| 2948 | optional State state = 1; |
| 2949 | |
| 2950 | optional string state_change_reason = 2; |
| 2951 | // SIMx or eSEx. |
| 2952 | optional string terminal = 3; |
| 2953 | } |
| 2954 | |
| 2955 | /** |
| 2956 | * Logs when Omapi API used |
| 2957 | * Logged from: |
| 2958 | * packages/apps/SecureElement/src/com/android/se/Terminal.java |
| 2959 | */ |
| 2960 | message SeOmapiReported { |
| 2961 | enum Operation { |
| 2962 | UNKNOWN = 0; |
| 2963 | OPEN_CHANNEL = 1; |
| 2964 | } |
| 2965 | optional Operation operation = 1; |
| 2966 | // SIMx or eSEx. |
| 2967 | optional string terminal = 2; |
| 2968 | |
| 2969 | optional string package_name = 3; |
| 2970 | } |