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