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