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"; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 26 | import "frameworks/base/core/proto/android/bluetooth/enums.proto"; |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 27 | import "frameworks/base/core/proto/android/os/enums.proto"; |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 28 | import "frameworks/base/core/proto/android/server/enums.proto"; |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 29 | import "frameworks/base/core/proto/android/telecomm/enums.proto"; |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 30 | import "frameworks/base/core/proto/android/telephony/enums.proto"; |
| 31 | import "frameworks/base/core/proto/android/view/enums.proto"; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 32 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 33 | /** |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 34 | * The master atom class. This message defines all of the available |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 35 | * raw stats log events from the Android system, also known as "atoms." |
| 36 | * |
| 37 | * This field contains a single oneof with all of the available messages. |
| 38 | * The stats-log-api-gen tool runs as part of the Android build and |
| 39 | * generates the android.util.StatsLog class, which contains the constants |
| 40 | * and methods that Android uses to log. |
| 41 | * |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 42 | * This Atom class is not actually built into the Android system. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 43 | * Instead, statsd on Android constructs these messages synthetically, |
| 44 | * in the format defined here and in stats_log.proto. |
| 45 | */ |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 46 | message Atom { |
| 47 | // Pushed atoms start at 2. |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 48 | oneof pushed { |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 49 | // For StatsLog reasons, 1 is illegal and will not work. Must start at 2. |
| 50 | BleScanStateChanged ble_scan_state_changed = 2; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 51 | // 3 is available for use |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 52 | BleScanResultReceived ble_scan_result_received = 4; |
| 53 | SensorStateChanged sensor_state_changed = 5; |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 54 | GpsScanStateChanged gps_scan_state_changed = 6; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 55 | SyncStateChanged sync_state_changed = 7; |
| 56 | ScheduledJobStateChanged scheduled_job_state_changed = 8; |
| 57 | ScreenBrightnessChanged screen_brightness_changed = 9; |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 58 | WakelockStateChanged wakelock_state_changed = 10; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 59 | LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11; |
| 60 | MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12; |
| 61 | WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 62 | // 14 - 19 are available |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 63 | BatterySaverModeStateChanged battery_saver_mode_state_changed = 20; |
| 64 | DeviceIdleModeStateChanged device_idle_mode_state_changed = 21; |
| 65 | DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 66 | AudioStateChanged audio_state_changed = 23; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 67 | MediaCodecStateChanged media_codec_state_changed = 24; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 68 | CameraStateChanged camera_state_changed = 25; |
| 69 | FlashlightStateChanged flashlight_state_changed = 26; |
| 70 | UidProcessStateChanged uid_process_state_changed = 27; |
| 71 | ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28; |
| 72 | ScreenStateChanged screen_state_changed = 29; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 73 | BatteryLevelChanged battery_level_changed = 30; |
| 74 | ChargingStateChanged charging_state_changed = 31; |
| 75 | PluggedStateChanged plugged_state_changed = 32; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 76 | // 33 - 34 are available |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 77 | WakeupAlarmOccurred wakeup_alarm_occurred = 35; |
| 78 | KernelWakeupReported kernel_wakeup_reported = 36; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 79 | WifiLockStateChanged wifi_lock_state_changed = 37; |
| 80 | WifiSignalStrengthChanged wifi_signal_strength_changed = 38; |
| 81 | WifiScanStateChanged wifi_scan_state_changed = 39; |
| 82 | PhoneSignalStrengthChanged phone_signal_strength_changed = 40; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 83 | SettingChanged setting_changed = 41; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 84 | ActivityForegroundStateChanged activity_foreground_state_changed = 42; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 85 | IsolatedUidChanged isolated_uid_changed = 43; |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 86 | PacketWakeupOccurred packet_wakeup_occurred = 44; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 87 | // 45 is available |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 88 | AnomalyDetected anomaly_detected = 46; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 89 | AppBreadcrumbReported app_breadcrumb_reported = 47; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 90 | AppStartOccurred app_start_occurred = 48; |
| 91 | AppStartCanceled app_start_canceled = 49; |
| 92 | AppStartFullyDrawn app_start_fully_drawn = 50; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 93 | LmkKillOccurred lmk_kill_occurred = 51; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 94 | PictureInPictureStateChanged picture_in_picture_state_changed = 52; |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 95 | WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 96 | LmkStateChanged lmk_state_changed = 54; |
| 97 | AppStartMemoryStateCaptured app_start_memory_state_captured = 55; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 98 | ShutdownSequenceReported shutdown_sequence_reported = 56; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 99 | BootSequenceReported boot_sequence_reported = 57; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 100 | DaveyOccurred davey_occurred = 58; |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 101 | OverlayStateChanged overlay_state_changed = 59; |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 102 | ForegroundServiceStateChanged foreground_service_state_changed = 60; |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 103 | CallStateChanged call_state_changed = 61; |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 104 | KeyguardStateChanged keyguard_state_changed = 62; |
| 105 | KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63; |
| 106 | KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 107 | AppDied app_died = 65; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 108 | ResourceConfigurationChanged resource_configuration_changed = 66; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 109 | BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67; |
| 110 | BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68; |
Tej Singh | 02200f9 | 2018-04-02 19:37:59 -0700 | [diff] [blame] | 111 | // 69 is blank but need not be. |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 112 | UsbConnectorStateChanged usb_connector_state_changed = 70; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 113 | SpeakerImpedanceReported speaker_impedance_reported = 71; |
| 114 | HardwareFailed hardware_failed = 72; |
| 115 | PhysicalDropDetected physical_drop_detected = 73; |
| 116 | ChargeCyclesReported charge_cycles_reported = 74; |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 117 | MobileConnectionStateChanged mobile_connection_state_changed = 75; |
| 118 | MobileRadioTechnologyChanged mobile_radio_technology_changed = 76; |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 119 | UsbDeviceAttached usb_device_attached = 77; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 120 | AppCrashOccurred app_crash_occurred = 78; |
| 121 | ANROccurred anr_occurred = 79; |
| 122 | WTFOccurred wtf_occurred = 80; |
Yangster | 4ccebea | 2018-10-09 17:09:02 -0700 | [diff] [blame] | 123 | PhoneServiceStateChanged phone_service_state_changed = 94; |
| 124 | PhoneStateChanged phone_state_changed = 95; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 125 | LowMemReported low_mem_reported = 81; |
| 126 | |
| 127 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 128 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 129 | |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 130 | // Pulled events will start at field 10000. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 131 | // Next: 10022 |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 132 | oneof pulled { |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 133 | WifiBytesTransfer wifi_bytes_transfer = 10000; |
| 134 | WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001; |
| 135 | MobileBytesTransfer mobile_bytes_transfer = 10002; |
| 136 | MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 137 | BluetoothBytesTransfer bluetooth_bytes_transfer = 10006; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 138 | KernelWakelock kernel_wakelock = 10004; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 139 | SubsystemSleepState subsystem_sleep_state = 10005; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 140 | CpuTimePerFreq cpu_time_per_freq = 10008; |
| 141 | CpuTimePerUid cpu_time_per_uid = 10009; |
| 142 | CpuTimePerUidFreq cpu_time_per_uid_freq = 10010; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 143 | WifiActivityInfo wifi_activity_info = 10011; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 144 | ModemActivityInfo modem_activity_info = 10012; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 145 | BluetoothActivityInfo bluetooth_activity_info = 10007; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 146 | ProcessMemoryState process_memory_state = 10013; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 147 | SystemElapsedRealtime system_elapsed_realtime = 10014; |
| 148 | SystemUptime system_uptime = 10015; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 149 | CpuActiveTime cpu_active_time = 10016; |
| 150 | CpuClusterTime cpu_cluster_time = 10017; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame] | 151 | DiskSpace disk_space = 10018; |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 152 | RemainingBatteryCapacity remaining_battery_capacity = 10019; |
| 153 | FullBatteryCapacity full_battery_capacity = 10020; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 154 | Temperature temperature = 10021; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 155 | } |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 156 | |
Bookatz | 76aafcf | 2018-09-17 16:17:10 -0700 | [diff] [blame] | 157 | // DO NOT USE field numbers above 100,000 in AOSP. |
| 158 | // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use. |
| 159 | // 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] | 160 | } |
| 161 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 162 | /** |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 163 | * This proto represents a node of an attribution chain. |
| 164 | * Note: All attribution chains are represented as a repeated field of type |
| 165 | * AttributionNode. It is understood that in such arrays, the order is that |
| 166 | * 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] | 167 | */ |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 168 | message AttributionNode { |
| 169 | // The uid for a given element in the attribution chain. |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 170 | optional int32 uid = 1; |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 171 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 172 | // The (optional) string tag for an element in the attribution chain. If the |
| 173 | // element has no tag, it is encoded as an empty string. |
| 174 | optional string tag = 2; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 175 | } |
| 176 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 177 | /* |
| 178 | * ***************************************************************************** |
yro | de4ca10 | 2017-11-15 22:57:24 -0800 | [diff] [blame] | 179 | * 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] | 180 | * |
| 181 | * RULES: |
| 182 | * - The field ids for each atom must start at 1, and count upwards by 1. |
| 183 | * Skipping field ids is not allowed. |
| 184 | * - These form an API, so renaming, renumbering or removing fields is |
| 185 | * not allowed between android releases. (This is not currently enforced, |
| 186 | * but there will be a tool to enforce this restriction). |
| 187 | * - The types must be built-in protocol buffer types, namely, no sub-messages |
| 188 | * are allowed (yet). The bytes type is also not allowed. |
| 189 | * - The CamelCase name of the message type should match the |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 190 | * underscore_separated name as defined in Atom. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 191 | * - 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] | 192 | * be exactly one AttributionChain field. It must be field number 1. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 193 | * - A field that is a uid should be a string field, tagged with the [xxx] |
| 194 | * annotation. The generated code on android will be represented by UIDs, |
| 195 | * and those UIDs will be translated in xxx to those strings. |
| 196 | * |
| 197 | * CONVENTIONS: |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 198 | * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 199 | * - If there is a UID, it goes first. Think in an object-oriented fashion. |
| 200 | * ***************************************************************************** |
| 201 | */ |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 202 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 203 | /** |
| 204 | * Logs when the screen state changes. |
| 205 | * |
| 206 | * Logged from: |
| 207 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 208 | */ |
| 209 | message ScreenStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 210 | // New screen state, from frameworks/base/core/proto/android/view/enums.proto. |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 211 | optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE]; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 212 | } |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 213 | |
| 214 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 215 | * 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] | 216 | * |
| 217 | * Logged from: |
| 218 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 219 | */ |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 220 | message UidProcessStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 221 | optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 222 | |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 223 | // The state, from frameworks/base/core/proto/android/app/enums.proto. |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 224 | optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 225 | } |
| 226 | |
| 227 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 228 | * Logs that a process started, finished, crashed, or ANRed. |
| 229 | * |
| 230 | * Logged from: |
| 231 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 232 | */ |
| 233 | message ProcessLifeCycleStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 234 | optional int32 uid = 1 [(is_uid) = true]; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 235 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 236 | // The process name (usually same as the app name). |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 237 | optional string process_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 238 | |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 239 | // What lifecycle state the process changed to. |
| 240 | // This enum is specific to atoms.proto. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 241 | enum State { |
| 242 | FINISHED = 0; |
| 243 | STARTED = 1; |
| 244 | CRASHED = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 245 | } |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 246 | optional State state = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 247 | } |
| 248 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 249 | /** |
| 250 | * Logs when the ble scan state changes. |
| 251 | * |
| 252 | * Logged from: |
Bookatz | 17a879d | 2018-03-28 15:05:28 -0700 | [diff] [blame] | 253 | * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 254 | */ |
| 255 | message BleScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 256 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 257 | |
| 258 | enum State { |
| 259 | OFF = 0; |
| 260 | ON = 1; |
Bookatz | e5ec0b4 | 2018-03-26 13:34:56 -0700 | [diff] [blame] | 261 | // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes). |
| 262 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 263 | } |
| 264 | optional State state = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 265 | |
Bookatz | e5ec0b4 | 2018-03-26 13:34:56 -0700 | [diff] [blame] | 266 | // Does the scan have a filter. |
| 267 | optional bool is_filtered = 3; |
| 268 | // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally. |
| 269 | optional bool is_first_match = 4; |
| 270 | // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC). |
| 271 | optional bool is_opportunistic = 5; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 272 | } |
| 273 | |
| 274 | /** |
| 275 | * Logs reporting of a ble scan finding results. |
| 276 | * |
| 277 | * Logged from: |
Bookatz | ae6738e | 2018-09-13 11:38:56 -0700 | [diff] [blame] | 278 | * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 279 | */ |
Bookatz | ae6738e | 2018-09-13 11:38:56 -0700 | [diff] [blame] | 280 | // TODO: Consider also tracking per-scanner-id. |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 281 | message BleScanResultReceived { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 282 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 283 | |
| 284 | // Number of ble scan results returned. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 285 | optional int32 num_results = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 286 | } |
| 287 | |
| 288 | /** |
| 289 | * Logs when a sensor state changes. |
| 290 | * |
| 291 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 292 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 293 | */ |
| 294 | message SensorStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 295 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 296 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 297 | // The id (int) of the sensor. |
| 298 | optional int32 sensor_id = 2; |
| 299 | |
| 300 | enum State { |
| 301 | OFF = 0; |
| 302 | ON = 1; |
| 303 | } |
| 304 | optional State state = 3; |
| 305 | } |
| 306 | |
| 307 | |
| 308 | /** |
| 309 | * Logs when GPS state changes. |
| 310 | * |
| 311 | * Logged from: |
| 312 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 313 | */ |
| 314 | message GpsScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 315 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 316 | |
| 317 | enum State { |
| 318 | OFF = 0; |
| 319 | ON = 1; |
| 320 | } |
| 321 | optional State state = 2; |
| 322 | } |
| 323 | |
| 324 | |
| 325 | /** |
| 326 | * Logs when a sync manager sync state changes. |
| 327 | * |
| 328 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 329 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 330 | */ |
| 331 | message SyncStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 332 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 333 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 334 | // 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] | 335 | optional string sync_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 336 | |
| 337 | enum State { |
| 338 | OFF = 0; |
| 339 | ON = 1; |
| 340 | } |
| 341 | optional State state = 3; |
| 342 | } |
| 343 | |
| 344 | /** |
| 345 | * Logs when a job scheduler job state changes. |
| 346 | * |
| 347 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 348 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 349 | */ |
| 350 | message ScheduledJobStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 351 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 352 | |
| 353 | // Name of the job (as named in the app) |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 354 | optional string job_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 355 | |
| 356 | enum State { |
Tej Singh | d5747a6 | 2018-01-08 20:57:35 -0800 | [diff] [blame] | 357 | FINISHED = 0; |
| 358 | STARTED = 1; |
| 359 | SCHEDULED = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 360 | } |
| 361 | optional State state = 3; |
| 362 | |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 363 | // The reason a job has stopped. |
| 364 | // This is only applicable when the state is FINISHED. |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 365 | // The default value is STOP_REASON_UNKNOWN. |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 366 | optional android.app.job.StopReasonEnum stop_reason = 4; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 367 | } |
| 368 | |
| 369 | /** |
| 370 | * Logs when the audio state changes. |
| 371 | * |
| 372 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 373 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 374 | */ |
| 375 | message AudioStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 376 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 377 | |
| 378 | enum State { |
| 379 | OFF = 0; |
| 380 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 381 | // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes). |
| 382 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 383 | } |
| 384 | optional State state = 2; |
| 385 | } |
| 386 | |
| 387 | /** |
| 388 | * Logs when the video codec state changes. |
| 389 | * |
| 390 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 391 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 392 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 393 | message MediaCodecStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 394 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 395 | |
| 396 | enum State { |
| 397 | OFF = 0; |
| 398 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 399 | // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes). |
| 400 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 401 | } |
| 402 | optional State state = 2; |
| 403 | } |
| 404 | |
| 405 | /** |
| 406 | * Logs when the flashlight state changes. |
| 407 | * |
| 408 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 409 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 410 | */ |
| 411 | message FlashlightStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 412 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 413 | |
| 414 | enum State { |
| 415 | OFF = 0; |
| 416 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 417 | // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes). |
| 418 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 419 | } |
| 420 | optional State state = 2; |
| 421 | } |
| 422 | |
| 423 | /** |
| 424 | * Logs when the camera state changes. |
| 425 | * |
| 426 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 427 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 428 | */ |
| 429 | message CameraStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 430 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 431 | |
| 432 | enum State { |
| 433 | OFF = 0; |
| 434 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 435 | // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes). |
| 436 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 437 | } |
| 438 | optional State state = 2; |
| 439 | } |
| 440 | |
| 441 | /** |
| 442 | * 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] | 443 | * |
| 444 | * Logged from: |
| 445 | * TODO |
| 446 | */ |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 447 | message WakelockStateChanged { |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 448 | repeated AttributionNode attribution_node = 1; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 449 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 450 | // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock. |
| 451 | // From frameworks/base/core/proto/android/os/enums.proto. |
| 452 | optional android.os.WakeLockLevelEnum level = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 453 | |
| 454 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 455 | optional string tag = 3; |
| 456 | |
| 457 | enum State { |
Yangster-mac | cfdf3a4 | 2017-12-06 13:42:38 -0800 | [diff] [blame] | 458 | RELEASE = 0; |
| 459 | ACQUIRE = 1; |
| 460 | CHANGE_RELEASE = 2; |
| 461 | CHANGE_ACQUIRE = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 462 | } |
| 463 | optional State state = 4; |
| 464 | } |
| 465 | |
| 466 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 467 | * Logs when a partial wakelock is considered 'long' (over 1 min). |
| 468 | * |
| 469 | * Logged from: |
| 470 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 471 | */ |
| 472 | message LongPartialWakelockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 473 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 474 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 475 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 476 | optional string tag = 2; |
| 477 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 478 | // TODO: I have no idea what this is. |
| 479 | optional string history_tag = 3; |
| 480 | |
| 481 | enum State { |
| 482 | OFF = 0; |
| 483 | ON = 1; |
| 484 | } |
| 485 | optional State state = 4; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 486 | } |
| 487 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 488 | /** |
| 489 | * Logs Battery Saver state change. |
| 490 | * |
| 491 | * Logged from: |
| 492 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 493 | */ |
| 494 | message BatterySaverModeStateChanged { |
| 495 | enum State { |
| 496 | OFF = 0; |
| 497 | ON = 1; |
| 498 | } |
| 499 | optional State state = 1; |
| 500 | } |
| 501 | |
| 502 | /** |
| 503 | * Logs Doze mode state change. |
| 504 | * |
| 505 | * Logged from: |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 506 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 507 | */ |
| 508 | message DeviceIdleModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 509 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 510 | } |
| 511 | |
| 512 | |
| 513 | /** |
| 514 | * Logs state change of Doze mode including maintenance windows. |
| 515 | * |
| 516 | * Logged from: |
| 517 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 518 | */ |
| 519 | message DeviceIdlingModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 520 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 521 | } |
| 522 | |
| 523 | /** |
| 524 | * Logs screen brightness level. |
| 525 | * |
| 526 | * Logged from: |
| 527 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 528 | */ |
| 529 | message ScreenBrightnessChanged { |
| 530 | // Screen brightness level. Should be in [-1, 255] according to PowerManager.java. |
| 531 | optional int32 level = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 532 | } |
| 533 | |
| 534 | /** |
| 535 | * Logs battery level (percent full, from 0 to 100). |
| 536 | * |
| 537 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 538 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 539 | */ |
| 540 | message BatteryLevelChanged { |
| 541 | // Battery level. Should be in [0, 100]. |
| 542 | optional int32 battery_level = 1; |
| 543 | } |
| 544 | |
| 545 | /** |
| 546 | * Logs change in charging status of the device. |
| 547 | * |
| 548 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 549 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 550 | */ |
| 551 | message ChargingStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 552 | // State of the battery, from frameworks/base/core/proto/android/os/enums.proto. |
| 553 | optional android.os.BatteryStatusEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 554 | } |
| 555 | |
| 556 | /** |
| 557 | * Logs whether the device is plugged in, and what power source it is using. |
| 558 | * |
| 559 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 560 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 561 | */ |
| 562 | message PluggedStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 563 | // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto. |
| 564 | optional android.os.BatteryPluggedStateEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 565 | } |
| 566 | |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 567 | /** |
| 568 | * Logs when an app's wakeup alarm fires. |
| 569 | * |
| 570 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 571 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 572 | */ |
| 573 | message WakeupAlarmOccurred { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 574 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 575 | |
| 576 | // Name of the wakeup alarm. |
| 577 | optional string tag = 2; |
| 578 | } |
| 579 | |
| 580 | /** |
| 581 | * Logs when an an app causes the mobile radio to change state. |
| 582 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio. |
| 583 | * |
| 584 | * Logged from: |
| 585 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 586 | */ |
| 587 | message MobileRadioPowerStateChanged { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 588 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 589 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 590 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 591 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 592 | } |
| 593 | |
| 594 | /** |
| 595 | * Logs when an an app causes the wifi radio to change state. |
| 596 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio. |
| 597 | * |
| 598 | * Logged from: |
| 599 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 600 | */ |
| 601 | message WifiRadioPowerStateChanged { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 602 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 603 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 604 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 605 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 606 | } |
| 607 | |
| 608 | /** |
| 609 | * Logs kernel wakeup reasons and aborts. |
| 610 | * |
| 611 | * Logged from: |
| 612 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 613 | */ |
| 614 | message KernelWakeupReported { |
| 615 | // Name of the kernel wakeup reason (or abort). |
| 616 | optional string wakeup_reason_name = 1; |
| 617 | |
| 618 | // Duration (in microseconds) for the wake-up interrupt to be serviced. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 619 | optional int64 duration_micros = 2; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 620 | } |
| 621 | |
| 622 | /** |
| 623 | * Logs wifi locks held by an app. |
| 624 | * |
| 625 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 626 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 627 | */ |
| 628 | message WifiLockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 629 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 630 | |
| 631 | enum State { |
| 632 | OFF = 0; |
| 633 | ON = 1; |
| 634 | } |
| 635 | optional State state = 2; |
| 636 | } |
| 637 | |
| 638 | /** |
| 639 | * Logs wifi signal strength changes. |
| 640 | * |
| 641 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 642 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 643 | */ |
| 644 | message WifiSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 645 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 646 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 647 | } |
| 648 | |
| 649 | /** |
| 650 | * Logs wifi scans performed 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 WifiScanStateChanged { |
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 | /** |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 666 | * Logs wifi multicast locks held by an app |
| 667 | * |
| 668 | * Logged from: |
| 669 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 670 | */ |
| 671 | message WifiMulticastLockStateChanged { |
| 672 | repeated AttributionNode attribution_node = 1; |
| 673 | |
| 674 | enum State { |
| 675 | OFF = 0; |
| 676 | ON = 1; |
| 677 | } |
| 678 | optional State state = 2; |
| 679 | } |
| 680 | |
| 681 | /** |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 682 | * Logs shutdown reason and duration on next boot. |
| 683 | * |
| 684 | * Logged from: |
| 685 | * frameworks/base/core/java/com/android/server/BootReceiver.java |
| 686 | */ |
| 687 | message ShutdownSequenceReported { |
| 688 | // True if shutdown is for a reboot. Default: false if we do not know. |
| 689 | optional bool reboot = 1; |
| 690 | |
| 691 | // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>". |
| 692 | optional string reason = 2; |
| 693 | |
| 694 | // Beginning of shutdown time in ms using wall clock time since unix epoch. |
| 695 | // Default: 0 if no start time received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 696 | optional int64 start_time_millis = 3; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 697 | |
| 698 | // Duration of shutdown in ms. Default: 0 if no duration received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 699 | optional int64 duration_millis = 4; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 700 | } |
| 701 | |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 702 | |
| 703 | /** |
| 704 | * Logs boot reason and duration. |
| 705 | * |
| 706 | * Logged from: |
| 707 | * system/core/bootstat/bootstat.cpp |
| 708 | */ |
| 709 | message BootSequenceReported { |
| 710 | // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list |
| 711 | // Default: "<EMPTY>" if not available. |
| 712 | optional string bootloader_reason = 1; |
| 713 | |
| 714 | // Reason for system boot. Eg. bootloader, reboot,userrequested |
| 715 | // Default: "<EMPTY>" if not available. |
| 716 | optional string system_reason = 2; |
| 717 | |
| 718 | // 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] | 719 | optional int64 end_time_millis = 3; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 720 | |
| 721 | // Total boot duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 722 | optional int64 total_duration_millis = 4; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 723 | |
| 724 | // Bootloader duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 725 | optional int64 bootloader_duration_millis = 5; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 726 | |
| 727 | // Time since last boot in ms. Default: 0 if not available. |
| 728 | optional int64 time_since_last_boot = 6; |
| 729 | } |
| 730 | |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 731 | |
| 732 | /** |
| 733 | * Logs call state and disconnect cause (if applicable). |
| 734 | * |
| 735 | * Logged from: |
| 736 | * packages/services/Telecomm/src/com/android/server/telecom/Call.java |
| 737 | */ |
| 738 | message CallStateChanged { |
| 739 | // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED. |
| 740 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 741 | optional android.telecom.CallStateEnum call_state = 1; |
| 742 | |
| 743 | // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY. |
| 744 | // This value is only applicable when the call_state is DISCONNECTED, and |
| 745 | // should always be UNKNOWN if the call_state is not DISCONNECTED. |
| 746 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 747 | optional android.telecom.DisconnectCauseEnum disconnect_cause = 2; |
| 748 | |
| 749 | // True if the call is self-managed, which are apps that use the |
| 750 | // telecom infrastructure to make their own calls. |
| 751 | optional bool self_managed = 3; |
| 752 | |
| 753 | // True if call is external. External calls are calls on connected Wear |
| 754 | // devices but show up in Telecom so the user can pull them onto the device. |
| 755 | optional bool external_call = 4; |
| 756 | } |
| 757 | |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 758 | /** |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 759 | * Logs keyguard state. The keyguard is the lock screen. |
| 760 | * |
| 761 | * Logged from: |
| 762 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java |
| 763 | */ |
| 764 | message KeyguardStateChanged { |
| 765 | enum State { |
| 766 | UNKNOWN = 0; |
| 767 | // The keyguard is hidden when the phone is unlocked. |
| 768 | HIDDEN = 1; |
| 769 | // The keyguard is shown when the phone is locked (screen turns off). |
| 770 | SHOWN= 2; |
| 771 | // The keyguard is occluded when something is overlaying the keyguard. |
| 772 | // Eg. Opening the camera while on the lock screen. |
| 773 | OCCLUDED = 3; |
| 774 | } |
| 775 | optional State state = 1; |
| 776 | } |
| 777 | |
| 778 | /** |
| 779 | * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and |
| 780 | * prompts the user to enter a password (pattern, pin, etc). |
| 781 | * |
| 782 | * Logged from: |
| 783 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java |
| 784 | */ |
| 785 | |
| 786 | message KeyguardBouncerStateChanged { |
| 787 | enum State { |
| 788 | UNKNOWN = 0; |
| 789 | // Bouncer is hidden, either as a result of successfully entering the |
| 790 | // password, screen timing out, or user going back to lock screen. |
| 791 | HIDDEN = 1; |
| 792 | // This is when the user is being prompted to enter the password. |
| 793 | SHOWN = 2; |
| 794 | } |
| 795 | optional State state = 1; |
| 796 | } |
| 797 | |
| 798 | /** |
| 799 | * Logs the result of entering a password into the keyguard bouncer. |
| 800 | * |
| 801 | * Logged from: |
| 802 | * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java |
| 803 | */ |
| 804 | message KeyguardBouncerPasswordEntered { |
| 805 | enum BouncerResult { |
| 806 | UNKNOWN = 0; |
| 807 | // The password entered was incorrect. |
| 808 | FAILURE = 1; |
| 809 | // The password entered was correct. |
| 810 | SUCCESS = 2; |
| 811 | } |
| 812 | optional BouncerResult result = 1; |
| 813 | } |
| 814 | |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 815 | /* |
| 816 | * Logs changes to the configuration of the device. The configuration is defined |
| 817 | * in frameworks/base/core/java/android/content/res/Configuration.java |
| 818 | * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html |
| 819 | * Please go there to interpret the possible values each field can be. |
| 820 | * |
| 821 | * Logged from: |
| 822 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 823 | */ |
| 824 | message ResourceConfigurationChanged { |
| 825 | // Bit mask of color capabilities of the screen. |
| 826 | // Contains information about the color gamut and hdr mode of the screen. |
| 827 | // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode |
| 828 | optional int32 colorMode = 1; |
| 829 | |
| 830 | // The target screen density being rendered to. |
| 831 | // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi |
| 832 | optional int32 densityDpi = 2; |
| 833 | |
| 834 | // Current user preference for the scaling factor for fonts, |
| 835 | // relative to the base density scaling. |
| 836 | // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale |
| 837 | optional float fontScale = 3; |
| 838 | |
| 839 | // Flag indicating whether the hard keyboard is hidden. |
| 840 | // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden |
| 841 | optional int32 hardKeyboardHidden = 4; |
| 842 | |
| 843 | // The type of keyboard attached to the device. |
| 844 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard |
| 845 | optional int32 keyboard = 5; |
| 846 | |
| 847 | // Flag indicating whether any keyboard is available. Takes soft keyboards into account. |
| 848 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden |
| 849 | optional int32 keyboardHideen = 6; |
| 850 | |
| 851 | // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier. |
| 852 | // 0 if undefined. |
| 853 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc |
| 854 | optional int32 mcc = 7; |
| 855 | |
| 856 | // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier. |
| 857 | // 0 if undefined. Note: the actual MNC may be 0, to check for this use the |
| 858 | // MNC_ZERO symbol defined in Configuration.java. |
| 859 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc |
| 860 | optional int32 mnc = 8; |
| 861 | |
| 862 | // The kind of navigation available on the device. |
| 863 | // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation |
| 864 | optional int32 navigation = 9; |
| 865 | |
| 866 | // Flag indicating whether the navigation is available. |
| 867 | // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden |
| 868 | optional int32 navigationHidden = 10; |
| 869 | |
| 870 | // Overall orientation of the screen. |
| 871 | // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation |
| 872 | optional int32 orientation = 11; |
| 873 | |
| 874 | // The current height of the available screen space, in dp units. |
| 875 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp |
| 876 | optional int32 screenHeightDp = 12; |
| 877 | |
| 878 | // Bit mask of overall layout of the screen. |
| 879 | // Contains information about screen size, whether the screen is wider/taller |
| 880 | // than normal, whether the screen layout is right-tl-left or left-to-right, |
| 881 | // and whether the screen has a rounded shape. |
| 882 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout |
| 883 | optional int32 screenLayout = 13; |
| 884 | |
| 885 | // Current width of the available screen space, in dp units. |
| 886 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp |
| 887 | optional int32 screenWidthDp = 14; |
| 888 | |
| 889 | // The smallest screen size an application will see in normal operation. |
| 890 | // This is the smallest value of both screenWidthDp and screenHeightDp |
| 891 | // in portrait and landscape. |
| 892 | // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp |
| 893 | optional int32 smallestScreenWidthDp = 15; |
| 894 | |
| 895 | // The type of touch screen attached to the device. |
| 896 | // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen |
| 897 | optional int32 touchscreen = 16; |
| 898 | |
| 899 | // Bit mask of the ui mode. |
| 900 | // Contains information about the overall ui mode of the device. |
| 901 | // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET |
| 902 | // Also contains information about whether the device is in night mode. |
| 903 | // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode |
| 904 | optional int32 uiMode = 17; |
| 905 | } |
| 906 | |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 907 | |
| 908 | /** |
| 909 | * Logs changes in the connection state of the mobile radio. |
| 910 | * |
| 911 | * Logged from: |
| 912 | * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java |
| 913 | */ |
| 914 | message MobileConnectionStateChanged { |
| 915 | // States are from the state machine DataConnection.java. |
| 916 | enum State { |
| 917 | UNKNOWN = 0; |
| 918 | // The connection is inactive, or disconnected. |
| 919 | INACTIVE = 1; |
| 920 | // The connection is being activated, or connecting. |
| 921 | ACTIVATING = 2; |
| 922 | // The connection is active, or connected. |
| 923 | ACTIVE = 3; |
| 924 | // The connection is disconnecting. |
| 925 | DISCONNECTING = 4; |
| 926 | // The connection is disconnecting after creating a connection. |
| 927 | DISCONNECTION_ERROR_CREATING_CONNECTION = 5; |
| 928 | } |
| 929 | optional State state = 1; |
| 930 | // For multi-sim phones, this distinguishes between the sim cards. |
| 931 | optional int32 sim_slot_index = 2; |
| 932 | // Used to identify the connection. Starts at 0 and increments by 1 for |
| 933 | // every new network created. Resets whenever the device reboots. |
| 934 | optional int32 data_connection_id = 3; |
| 935 | // A bitmask for the capabilities of this connection. |
| 936 | // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS. |
| 937 | // Default value (if we have no information): 0 |
| 938 | optional int64 capabilities = 4; |
| 939 | // If this connection has internet. |
| 940 | // This just checks if the DEFAULT bit of capabilities is set. |
| 941 | optional bool has_internet = 5; |
| 942 | } |
| 943 | |
| 944 | /** |
| 945 | * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA. |
| 946 | * |
| 947 | * Logged from: |
| 948 | * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java |
| 949 | */ |
| 950 | message MobileRadioTechnologyChanged { |
| 951 | optional android.telephony.NetworkTypeEnum state = 1; |
| 952 | // For multi-sim phones, this distinguishes between the sim cards. |
| 953 | optional int32 sim_slot_index = 2; |
| 954 | } |
| 955 | |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 956 | /** |
| 957 | * Logs the VID and PID of any connected USB devices. |
| 958 | * |
| 959 | * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present. |
| 960 | * |
| 961 | * Logged by Vendor. |
| 962 | */ |
| 963 | message UsbDeviceAttached { |
| 964 | optional int32 vid = 1; |
| 965 | optional int32 pid = 2; |
| 966 | optional bool has_audio = 3; |
| 967 | optional bool has_hid = 4; |
| 968 | optional bool has_storage = 5; |
| 969 | } |
| 970 | |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 971 | |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 972 | /** |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 973 | * Logs when Bluetooth is enabled and disabled. |
| 974 | * |
| 975 | * Logged from: |
| 976 | * services/core/java/com/android/server/BluetoothManagerService.java |
| 977 | */ |
| 978 | message BluetoothEnabledStateChanged { |
| 979 | repeated AttributionNode attribution_node = 1; |
| 980 | // Whether or not bluetooth is enabled on the device. |
| 981 | enum State { |
| 982 | UNKNOWN = 0; |
| 983 | ENABLED = 1; |
| 984 | DISABLED = 2; |
| 985 | } |
| 986 | optional State state = 2; |
| 987 | // The reason for being enabled/disabled. |
| 988 | // Eg. Airplane mode, crash, application request. |
| 989 | optional android.bluetooth.EnableDisableReasonEnum reason = 3; |
| 990 | // If the reason is an application request, this will be the package name. |
| 991 | optional string pkgName = 4; |
| 992 | } |
| 993 | |
| 994 | /** |
| 995 | * Logs when a Bluetooth device connects and disconnects. |
| 996 | * |
| 997 | * Logged from: |
| 998 | * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java |
| 999 | */ |
| 1000 | message BluetoothConnectionStateChanged { |
| 1001 | // The state of the connection. |
| 1002 | // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED. |
| 1003 | optional android.bluetooth.ConnectionStateEnum state = 1; |
| 1004 | // An identifier that can be used to match connect and disconnect events. |
| 1005 | // Currently is last two bytes of a hash of a device level ID and |
| 1006 | // the mac address of the bluetooth device that is connected. |
| 1007 | optional int32 obfuscated_id = 2; |
| 1008 | // The profile that is connected. Eg. GATT, A2DP, HEADSET. |
| 1009 | // From android.bluetooth.BluetoothAdapter.java |
| 1010 | optional int32 bt_profile = 3; |
| 1011 | } |
| 1012 | |
| 1013 | /** |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1014 | * Logs when something is plugged into or removed from the USB-C connector. |
| 1015 | * |
| 1016 | * Logged from: |
| 1017 | * Vendor USB HAL. |
| 1018 | */ |
| 1019 | message UsbConnectorStateChanged { |
| 1020 | enum State { |
| 1021 | DISCONNECTED = 0; |
| 1022 | CONNECTED = 1; |
| 1023 | } |
| 1024 | optional State state = 1; |
| 1025 | } |
| 1026 | |
| 1027 | /** |
| 1028 | * Logs the reported speaker impedance. |
| 1029 | * |
| 1030 | * Logged from: |
| 1031 | * Vendor audio implementation. |
| 1032 | */ |
| 1033 | message SpeakerImpedanceReported { |
| 1034 | optional int32 speaker_location = 1; |
| 1035 | optional int32 impedance = 2; |
| 1036 | } |
| 1037 | |
| 1038 | /** |
| 1039 | * Logs the report of a failed hardware. |
| 1040 | * |
| 1041 | * Logged from: |
| 1042 | * Vendor HALs. |
| 1043 | * |
| 1044 | */ |
| 1045 | message HardwareFailed { |
| 1046 | enum HardwareType { |
| 1047 | HARDWARE_FAILED_UNKNOWN = 0; |
| 1048 | HARDWARE_FAILED_MICROPHONE = 1; |
| 1049 | HARDWARE_FAILED_CODEC = 2; |
| 1050 | HARDWARE_FAILED_SPEAKER = 3; |
| 1051 | HARDWARE_FAILED_FINGERPRINT = 4; |
| 1052 | } |
| 1053 | optional HardwareType hardware_type = 1; |
| 1054 | |
| 1055 | /* hardware_location allows vendors to differentiate between multiple instances of |
| 1056 | * the same hardware_type. The specific locations are vendor defined integers, |
| 1057 | * referring to board-specific numbering schemes. |
| 1058 | */ |
| 1059 | optional int32 hardware_location = 2; |
| 1060 | |
| 1061 | /* failure_code is specific to the HardwareType of the failed hardware. |
| 1062 | * It should use the enum values defined below. |
| 1063 | */ |
| 1064 | enum MicrophoneFailureCode { |
| 1065 | MICROPHONE_FAILURE_COMPLETE = 0; |
| 1066 | } |
| 1067 | enum CodecFailureCode { |
| 1068 | CODEC_FAILURE_COMPLETE = 0; |
| 1069 | } |
| 1070 | enum SpeakerFailureCode { |
| 1071 | SPEAKER_FAILURE_COMPLETE = 0; |
| 1072 | SPEAKER_FAILURE_HIGH_Z = 1; |
| 1073 | SPEAKER_FAILURE_SHORT = 2; |
| 1074 | } |
| 1075 | enum FingerprintFailureCode { |
| 1076 | FINGERPRINT_FAILURE_COMPLETE = 0; |
| 1077 | FINGERPRINT_SENSOR_BROKEN = 1; |
| 1078 | FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2; |
| 1079 | } |
| 1080 | optional int32 failure_code = 3; |
| 1081 | } |
| 1082 | |
| 1083 | /** |
| 1084 | * Log an event when the device has been physically dropped. |
| 1085 | * Reported from the /vendor partition. |
| 1086 | */ |
| 1087 | message PhysicalDropDetected { |
| 1088 | // Confidence that the event was actually a drop, 0 -> 100 |
| 1089 | optional int32 confidence_pctg = 1; |
| 1090 | // Peak acceleration of the drop, in 1/1000s of a g. |
| 1091 | optional int32 accel_peak_thousandths_g = 2; |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 1092 | // Duration of freefall in ms |
| 1093 | optional int32 freefall_time_millis = 3; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1094 | } |
| 1095 | |
| 1096 | /** |
| 1097 | * Log bucketed battery charge cycles. |
| 1098 | * |
| 1099 | * Each bucket represents cycles of the battery past |
| 1100 | * a given charge point. For example, bucket 1 is the |
| 1101 | * lowest 1/8th of the battery, and bucket 8 is 100%. |
| 1102 | * |
| 1103 | * Logged from: |
| 1104 | * /sys/class/power_supply/bms/cycle_count, via Vendor. |
| 1105 | */ |
| 1106 | message ChargeCyclesReported { |
| 1107 | optional int32 cycle_bucket_1 = 1; |
| 1108 | optional int32 cycle_bucket_2 = 2; |
| 1109 | optional int32 cycle_bucket_3 = 3; |
| 1110 | optional int32 cycle_bucket_4 = 4; |
| 1111 | optional int32 cycle_bucket_5 = 5; |
| 1112 | optional int32 cycle_bucket_6 = 6; |
| 1113 | optional int32 cycle_bucket_7 = 7; |
| 1114 | optional int32 cycle_bucket_8 = 8; |
| 1115 | } |
| 1116 | |
| 1117 | /** |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1118 | * Logs the duration of a davey (jank of >=700ms) when it occurs |
| 1119 | * |
| 1120 | * Logged from: |
| 1121 | * frameworks/base/libs/hwui/JankTracker.cpp |
| 1122 | */ |
| 1123 | message DaveyOccurred { |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1124 | // The UID that logged this atom. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1125 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1126 | |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1127 | // Amount of time it took to render the frame. Should be >=700ms. |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1128 | optional int64 jank_duration_millis = 2; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1129 | } |
| 1130 | |
| 1131 | /** |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 1132 | * Logs phone signal strength changes. |
| 1133 | * |
| 1134 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1135 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 1136 | */ |
| 1137 | message PhoneSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 1138 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 1139 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1140 | } |
| 1141 | |
Yangster | 4ccebea | 2018-10-09 17:09:02 -0700 | [diff] [blame] | 1142 | |
| 1143 | /** |
| 1144 | * Logs when the phone state, sim state or signal strength changes |
| 1145 | * |
| 1146 | * Logged from: |
| 1147 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 1148 | */ |
| 1149 | message PhoneServiceStateChanged { |
| 1150 | optional android.telephony.ServiceStateEnum state = 1; |
| 1151 | optional android.telephony.SimStateEnum sim_state = 2; |
| 1152 | optional android.telephony.SignalStrengthEnum signal_strength = 3; |
| 1153 | } |
| 1154 | |
| 1155 | /** |
| 1156 | * Logs when the phone becomes on or off. |
| 1157 | * |
| 1158 | * Logged from: |
| 1159 | * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java |
| 1160 | */ |
| 1161 | message PhoneStateChanged { |
| 1162 | enum State { |
| 1163 | OFF = 0; |
| 1164 | ON = 1; |
| 1165 | } |
| 1166 | optional State state = 1; |
| 1167 | } |
| 1168 | |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1169 | /** |
| 1170 | * Logs that a setting was updated. |
| 1171 | * Logged from: |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1172 | * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1173 | * The tag and is_default allow resetting of settings to default values based on the specified |
| 1174 | * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details. |
| 1175 | */ |
| 1176 | message SettingChanged { |
| 1177 | // The name of the setting. |
| 1178 | optional string setting = 1; |
| 1179 | |
| 1180 | // The change being imposed on this setting. May represent a number, eg "3". |
| 1181 | optional string value = 2; |
| 1182 | |
| 1183 | // The new value of this setting. For most settings, this is same as value. For some settings, |
| 1184 | // value is +X or -X where X represents an element in a set. For example, if the previous value |
| 1185 | // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C. |
| 1186 | // The +/- feature is currently only used for location_providers_allowed. |
| 1187 | optional string new_value = 3; |
| 1188 | |
| 1189 | // The previous value of this setting. |
| 1190 | optional string prev_value = 4; |
| 1191 | |
| 1192 | // The tag used with the is_default for resetting sets of settings. This is generally null. |
| 1193 | optional string tag = 5; |
| 1194 | |
Bookatz | 9086762 | 2018-01-31 15:05:57 -0800 | [diff] [blame] | 1195 | // True if this setting with tag should be resettable. |
| 1196 | optional bool is_default = 6; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1197 | |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1198 | // 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] | 1199 | optional int32 user = 7; |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1200 | |
| 1201 | enum ChangeReason { |
| 1202 | UPDATED = 1; // Updated can be an insertion or an update. |
| 1203 | DELETED = 2; |
| 1204 | } |
| 1205 | optional ChangeReason reason = 8; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1206 | } |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 1207 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1208 | /** |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1209 | * Logs activity going to foreground or background |
| 1210 | * |
| 1211 | * Logged from: |
| 1212 | * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java |
| 1213 | */ |
| 1214 | message ActivityForegroundStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1215 | optional int32 uid = 1 [(is_uid) = true]; |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 1216 | optional string pkg_name = 2; |
| 1217 | optional string class_name = 3; |
| 1218 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1219 | enum State { |
| 1220 | BACKGROUND = 0; |
| 1221 | FOREGROUND = 1; |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1222 | } |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1223 | optional State state = 4; |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1224 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1225 | |
| 1226 | /** |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1227 | * Logs when an app crashes. |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1228 | * Logged from: |
| 1229 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1230 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1231 | message AppCrashOccurred { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1232 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1233 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1234 | optional string event_type = 2; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1235 | |
| 1236 | // The name of the process. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1237 | // system_server if it is not by an app |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1238 | optional string process_name = 3; |
| 1239 | |
| 1240 | // The pid if available. -1 means not available. |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 1241 | optional sint32 pid = 4; |
Chenjie Yu | f17bf62 | 2018-04-02 14:22:19 -0700 | [diff] [blame] | 1242 | |
| 1243 | optional string package_name = 5; |
| 1244 | |
| 1245 | enum InstantApp { |
| 1246 | UNAVAILABLE = 0; |
| 1247 | FALSE = 1; |
| 1248 | TRUE = 2; |
| 1249 | } |
| 1250 | optional InstantApp is_instant_app = 6; |
| 1251 | |
| 1252 | enum ForegroundState { |
| 1253 | UNKNOWN = 0; |
| 1254 | BACKGROUND = 1; |
| 1255 | FOREGROUND = 2; |
| 1256 | } |
| 1257 | optional ForegroundState foreground_state = 7; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1258 | } |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1259 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1260 | /** |
| 1261 | * Logs when a WTF (What a Terrible Failure) happened. |
| 1262 | * Logged from: |
| 1263 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1264 | */ |
| 1265 | message WTFOccurred { |
| 1266 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1267 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1268 | optional string tag = 2; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1269 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1270 | // The name of the process. |
| 1271 | // system_server if it is not by an app |
| 1272 | optional string process_name = 3; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 1273 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1274 | // The pid if available. -1 means not available. |
| 1275 | optional sint32 pid = 4; |
| 1276 | } |
| 1277 | |
| 1278 | /** |
| 1279 | * Logs when system server reports low memory. |
| 1280 | * Logged from: |
| 1281 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1282 | */ |
| 1283 | message LowMemReported { |
| 1284 | } |
| 1285 | |
| 1286 | /** |
| 1287 | * Logs when an app ANR (App Not Responding) occurs. |
| 1288 | * Logged from: |
| 1289 | * frameworks/base/services/core/java/com/android/server/am/AppErrors.java |
| 1290 | */ |
| 1291 | message ANROccurred { |
| 1292 | optional int32 uid = 1 [(is_uid) = true]; |
| 1293 | |
| 1294 | optional string process_name = 2; |
| 1295 | |
| 1296 | optional string short_component_name = 3; |
| 1297 | |
| 1298 | optional string reason = 4; |
Chenjie Yu | f17bf62 | 2018-04-02 14:22:19 -0700 | [diff] [blame] | 1299 | |
| 1300 | enum InstantApp { |
| 1301 | UNAVAILABLE = 0; |
| 1302 | FALSE = 1; |
| 1303 | TRUE = 2; |
| 1304 | } |
| 1305 | optional InstantApp is_instant_app = 5; |
| 1306 | |
| 1307 | enum ForegroundState { |
| 1308 | UNKNOWN = 0; |
| 1309 | BACKGROUND = 1; |
| 1310 | FOREGROUND = 2; |
| 1311 | } |
| 1312 | optional ForegroundState foreground_state = 6; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1313 | } |
| 1314 | |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 1315 | /* |
| 1316 | * Allows other apps to push events into statsd. |
| 1317 | * Logged from: |
| 1318 | * frameworks/base/core/java/android/util/StatsLog.java |
| 1319 | */ |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1320 | message AppBreadcrumbReported { |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 1321 | // The uid of the application that sent this custom atom. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1322 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 1323 | |
| 1324 | // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16). |
| 1325 | optional int32 label = 2; |
| 1326 | |
| 1327 | // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom |
| 1328 | // predicates for the metrics). |
| 1329 | enum State { |
| 1330 | UNKNOWN = 0; |
| 1331 | UNSPECIFIED = 1; // For events that are known to not represent START/STOP. |
| 1332 | STOP = 2; |
| 1333 | START = 3; |
| 1334 | } |
| 1335 | optional State state = 3; |
| 1336 | } |
| 1337 | |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1338 | /** |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1339 | * Logs when statsd detects an anomaly. |
| 1340 | * |
| 1341 | * Logged from: |
| 1342 | * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp |
| 1343 | */ |
| 1344 | message AnomalyDetected { |
| 1345 | // Uid that owns the config whose anomaly detection alert fired. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1346 | optional int32 config_uid = 1 [(is_uid) = true]; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1347 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 1348 | // Id of the config whose anomaly detection alert fired. |
| 1349 | optional int64 config_id = 2; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1350 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 1351 | // Id of the alert (i.e. name of the anomaly that was detected). |
| 1352 | optional int64 alert_id = 3; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1353 | } |
| 1354 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1355 | message AppStartOccurred { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1356 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1357 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1358 | |
| 1359 | // The app package name. |
| 1360 | optional string pkg_name = 2; |
| 1361 | |
| 1362 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1363 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1364 | WARM = 1; |
| 1365 | HOT = 2; |
| 1366 | COLD = 3; |
| 1367 | } |
| 1368 | // The transition type. |
| 1369 | optional TransitionType type = 3; |
| 1370 | |
| 1371 | // The activity name. |
| 1372 | optional string activity_name = 4; |
| 1373 | |
| 1374 | // The name of the calling app. Empty if not set. |
| 1375 | optional string calling_pkg_name = 5; |
| 1376 | |
| 1377 | // Whether the app is an instant app. |
| 1378 | optional bool is_instant_app = 6; |
| 1379 | |
| 1380 | // Device uptime when activity started. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1381 | optional int64 activity_start_millis = 7; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1382 | |
Bookatz | 80d11a0 | 2018-01-16 10:46:35 -0800 | [diff] [blame] | 1383 | optional android.app.AppTransitionReasonEnum reason = 8; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1384 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1385 | optional int32 transition_delay_millis = 9; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1386 | // -1 if not set. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1387 | optional int32 starting_window_delay_millis = 10; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1388 | // -1 if not set. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1389 | optional int32 bind_application_delay_millis = 11; |
| 1390 | optional int32 windows_drawn_delay_millis = 12; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1391 | |
| 1392 | // Empty if not set. |
| 1393 | optional string launch_token = 13; |
| 1394 | |
Calin Juravle | 759fbda | 2018-02-20 19:52:30 +0000 | [diff] [blame] | 1395 | // The compiler filter used when when the package was optimized. |
Calin Juravle | a86783b | 2018-03-21 14:25:59 -0700 | [diff] [blame] | 1396 | optional int32 package_optimization_compilation_filter = 14; |
Calin Juravle | 759fbda | 2018-02-20 19:52:30 +0000 | [diff] [blame] | 1397 | |
| 1398 | // The reason why the package was optimized. |
Calin Juravle | a86783b | 2018-03-21 14:25:59 -0700 | [diff] [blame] | 1399 | optional int32 package_optimization_compilation_reason = 15; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1400 | } |
| 1401 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1402 | message AppStartCanceled { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1403 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1404 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1405 | |
| 1406 | // The app package name. |
| 1407 | optional string pkg_name = 2; |
| 1408 | |
| 1409 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1410 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1411 | WARM = 1; |
| 1412 | HOT = 2; |
| 1413 | COLD = 3; |
| 1414 | } |
| 1415 | // The transition type. |
| 1416 | optional TransitionType type = 3; |
| 1417 | |
| 1418 | // The activity name. |
| 1419 | optional string activity_name = 4; |
| 1420 | } |
| 1421 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1422 | message AppStartFullyDrawn { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1423 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1424 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1425 | |
| 1426 | // The app package name. |
| 1427 | optional string pkg_name = 2; |
| 1428 | |
| 1429 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1430 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1431 | WITH_BUNDLE = 1; |
| 1432 | WITHOUT_BUNDLE = 2; |
| 1433 | } |
| 1434 | // The transition type. |
| 1435 | optional TransitionType type = 3; |
| 1436 | |
| 1437 | // The activity name. |
| 1438 | optional string activity_name = 4; |
| 1439 | |
| 1440 | optional bool transition_process_running = 5; |
| 1441 | |
| 1442 | // App startup time (until call to Activity#reportFullyDrawn()). |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1443 | optional int64 app_startup_time_millis = 6; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1444 | } |
| 1445 | |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1446 | /** |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1447 | * Logs a picture-in-picture action |
| 1448 | * Logged from: |
| 1449 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1450 | * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java |
| 1451 | * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java |
| 1452 | */ |
| 1453 | message PictureInPictureStateChanged { |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 1454 | // -1 if it is not available |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1455 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1456 | |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 1457 | optional string short_name = 2; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1458 | |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1459 | enum State { |
| 1460 | ENTERED = 1; |
| 1461 | EXPANDED_TO_FULL_SCREEN = 2; |
| 1462 | MINIMIZED = 3; |
| 1463 | DISMISSED = 4; |
| 1464 | } |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 1465 | optional State state = 3; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1466 | } |
| 1467 | |
| 1468 | /** |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 1469 | * Logs overlay action |
| 1470 | * Logged from: |
| 1471 | * services/core/java/com/android/server/wm/Session.java |
| 1472 | */ |
| 1473 | message OverlayStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1474 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 1475 | |
| 1476 | optional string package_name = 2; |
| 1477 | |
| 1478 | optional bool using_alert_window = 3; |
| 1479 | |
| 1480 | enum State { |
| 1481 | ENTERED = 1; |
| 1482 | EXITED = 2; |
| 1483 | } |
| 1484 | optional State state = 4; |
| 1485 | } |
| 1486 | |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 1487 | /* |
| 1488 | * Logs foreground service starts and stops. |
| 1489 | * Note that this is not when a service starts or stops, but when it is |
| 1490 | * considered foreground. |
| 1491 | * Logged from |
| 1492 | * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java |
| 1493 | */ |
| 1494 | message ForegroundServiceStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1495 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 1496 | // package_name + "/" + class_name |
| 1497 | optional string short_name = 2; |
| 1498 | |
| 1499 | enum State { |
| 1500 | ENTER = 1; |
| 1501 | EXIT = 2; |
| 1502 | } |
| 1503 | optional State state = 3; |
| 1504 | } |
| 1505 | |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 1506 | /** |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1507 | * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky |
| 1508 | * behavior in its own uid. However, the metrics of these isolated uid's almost always should be |
| 1509 | * attributed back to the parent (host) uid. One example is Chrome. |
| 1510 | * |
| 1511 | * Logged from: |
| 1512 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 1513 | */ |
| 1514 | message IsolatedUidChanged { |
| 1515 | // 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] | 1516 | // 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] | 1517 | optional int32 parent_uid = 1; |
| 1518 | |
| 1519 | optional int32 isolated_uid = 2; |
| 1520 | |
| 1521 | // We expect an isolated uid to be removed before if it's used for another parent uid. |
| 1522 | enum Event { |
| 1523 | REMOVED = 0; |
| 1524 | CREATED = 1; |
| 1525 | } |
| 1526 | optional Event event = 3; |
| 1527 | } |
| 1528 | |
| 1529 | /* |
| 1530 | * Logs the reception of an incoming network packet causing the main system to wake up for |
| 1531 | * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd |
| 1532 | * and processed by WakeupController.cpp. |
| 1533 | */ |
| 1534 | message PacketWakeupOccurred { |
| 1535 | // The uid owning the socket into which the packet was delivered, or -1 if the packet was |
| 1536 | // delivered nowhere. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1537 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1538 | // The interface name on which the packet was received. |
| 1539 | optional string iface = 2; |
| 1540 | // The ethertype value of the packet. |
| 1541 | optional int32 ethertype = 3; |
| 1542 | // String representation of the destination MAC address of the packet. |
| 1543 | optional string destination_hardware_address = 4; |
| 1544 | // String representation of the source address of the packet if this was an IP packet. |
| 1545 | optional string source_ip = 5; |
| 1546 | // String representation of the destination address of the packet if this was an IP packet. |
| 1547 | optional string destination_ip = 6; |
| 1548 | // The value of the protocol field if this was an IPv4 packet or the value of the Next Header |
| 1549 | // field if this was an IPv6 packet. The range of possible values is the same for both IP |
| 1550 | // families. |
| 1551 | optional int32 ip_next_header = 7; |
| 1552 | // The source port if this was a TCP or UDP packet. |
| 1553 | optional int32 source_port = 8; |
| 1554 | // The destination port if this was a TCP or UDP packet. |
| 1555 | optional int32 destination_port = 9; |
| 1556 | } |
| 1557 | |
| 1558 | /* |
| 1559 | * Logs the memory stats for an app on startup. |
| 1560 | * Logged from: |
| 1561 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1562 | */ |
| 1563 | message AppStartMemoryStateCaptured { |
| 1564 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1565 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1566 | |
| 1567 | // The process name. |
| 1568 | optional string process_name = 2; |
| 1569 | |
| 1570 | // The activity name. |
| 1571 | optional string activity_name = 3; |
| 1572 | |
| 1573 | // # of page-faults |
| 1574 | optional int64 pgfault = 4; |
| 1575 | |
| 1576 | // # of major page-faults |
| 1577 | optional int64 pgmajfault = 5; |
| 1578 | |
| 1579 | // RSS |
| 1580 | optional int64 rss_in_bytes = 6; |
| 1581 | |
| 1582 | // CACHE |
| 1583 | optional int64 cache_in_bytes = 7; |
| 1584 | |
| 1585 | // SWAP |
| 1586 | optional int64 swap_in_bytes = 8; |
| 1587 | } |
| 1588 | |
| 1589 | /* |
| 1590 | * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries |
| 1591 | * for LMK event. |
| 1592 | * Logged from: |
| 1593 | * system/core/lmkd/lmkd.c |
| 1594 | */ |
| 1595 | message LmkStateChanged { |
| 1596 | enum State { |
| 1597 | UNKNOWN = 0; |
| 1598 | START = 1; |
| 1599 | STOP = 2; |
| 1600 | } |
| 1601 | optional State state = 1; |
| 1602 | } |
| 1603 | |
| 1604 | /* |
| 1605 | * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure. |
| 1606 | * Logged from: |
| 1607 | * system/core/lmkd/lmkd.c |
| 1608 | */ |
| 1609 | message LmkKillOccurred { |
| 1610 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1611 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1612 | |
| 1613 | // The process name. |
| 1614 | optional string process_name = 2; |
| 1615 | |
| 1616 | // oom adj score. |
| 1617 | optional int32 oom_score = 3; |
| 1618 | |
| 1619 | // # of page-faults |
| 1620 | optional int64 pgfault = 4; |
| 1621 | |
| 1622 | // # of major page-faults |
| 1623 | optional int64 pgmajfault = 5; |
| 1624 | |
| 1625 | // RSS |
| 1626 | optional int64 rss_in_bytes = 6; |
| 1627 | |
| 1628 | // CACHE |
| 1629 | optional int64 cache_in_bytes = 7; |
| 1630 | |
| 1631 | // SWAP |
| 1632 | optional int64 swap_in_bytes = 8; |
| 1633 | } |
| 1634 | |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 1635 | /* |
| 1636 | * Logs when the ActivityManagerService detects that an app died. |
| 1637 | * |
| 1638 | * Logged from: |
| 1639 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1640 | */ |
| 1641 | message AppDied { |
| 1642 | // timestamp(elapsedRealtime) of record creation |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1643 | optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE]; |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 1644 | } |
| 1645 | |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1646 | ////////////////////////////////////////////////////////////////////// |
| 1647 | // Pulled atoms below this line // |
| 1648 | ////////////////////////////////////////////////////////////////////// |
| 1649 | |
| 1650 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1651 | * Pulls bytes transferred via wifi (Sum of foreground and background usage). |
| 1652 | * |
| 1653 | * Pulled from: |
| 1654 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 1655 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1656 | message WifiBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1657 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1658 | |
| 1659 | optional int64 rx_bytes = 2; |
| 1660 | |
| 1661 | optional int64 rx_packets = 3; |
| 1662 | |
| 1663 | optional int64 tx_bytes = 4; |
| 1664 | |
| 1665 | optional int64 tx_packets = 5; |
| 1666 | } |
| 1667 | |
| 1668 | /** |
| 1669 | * Pulls bytes transferred via wifi (separated by foreground and background usage). |
| 1670 | * |
| 1671 | * Pulled from: |
| 1672 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 1673 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1674 | message WifiBytesTransferByFgBg { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1675 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1676 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1677 | // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats. |
| 1678 | optional bool is_foreground = 2; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1679 | |
| 1680 | optional int64 rx_bytes = 3; |
| 1681 | |
| 1682 | optional int64 rx_packets = 4; |
| 1683 | |
| 1684 | optional int64 tx_bytes = 5; |
| 1685 | |
| 1686 | optional int64 tx_packets = 6; |
| 1687 | } |
| 1688 | |
| 1689 | /** |
| 1690 | * Pulls bytes transferred via mobile networks (Sum of foreground and background usage). |
| 1691 | * |
| 1692 | * Pulled from: |
| 1693 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 1694 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1695 | message MobileBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1696 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1697 | |
| 1698 | optional int64 rx_bytes = 2; |
| 1699 | |
| 1700 | optional int64 rx_packets = 3; |
| 1701 | |
| 1702 | optional int64 tx_bytes = 4; |
| 1703 | |
| 1704 | optional int64 tx_packets = 5; |
| 1705 | } |
| 1706 | |
| 1707 | /** |
| 1708 | * Pulls bytes transferred via mobile networks (separated by foreground and background usage). |
| 1709 | * |
| 1710 | * Pulled from: |
| 1711 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 1712 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1713 | message MobileBytesTransferByFgBg { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1714 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1715 | |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1716 | // 1 denotes foreground and 0 denotes background. This is called Set in |
| 1717 | // NetworkStats. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1718 | optional bool is_foreground = 2; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1719 | |
| 1720 | optional int64 rx_bytes = 3; |
| 1721 | |
| 1722 | optional int64 rx_packets = 4; |
| 1723 | |
| 1724 | optional int64 tx_bytes = 5; |
| 1725 | |
| 1726 | optional int64 tx_packets = 6; |
| 1727 | } |
| 1728 | |
| 1729 | /** |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1730 | * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller. |
| 1731 | * |
| 1732 | * Pulled from: |
| 1733 | * StatsCompanionService |
| 1734 | */ |
| 1735 | message BluetoothBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1736 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1737 | |
| 1738 | optional int64 rx_bytes = 2; |
| 1739 | |
| 1740 | optional int64 tx_bytes = 3; |
| 1741 | } |
| 1742 | |
| 1743 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1744 | * Pulls the kernel wakelock durations. This atom is adapted from |
| 1745 | * android/internal/os/KernelWakelockStats.java |
| 1746 | * |
| 1747 | * Pulled from: |
| 1748 | * StatsCompanionService using KernelWakelockReader. |
| 1749 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1750 | message KernelWakelock { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1751 | optional string name = 1; |
| 1752 | |
| 1753 | optional int32 count = 2; |
| 1754 | |
| 1755 | optional int32 version = 3; |
| 1756 | |
| 1757 | optional int64 time = 4; |
| 1758 | } |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1759 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1760 | /** |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1761 | * Pulls low power state information. This includes platform and subsystem sleep state information, |
| 1762 | * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1763 | * hardware/interfaces/power/1.0/types.hal |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1764 | * hardware/interfaces/power/1.1/types.hal |
| 1765 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1766 | message SubsystemSleepState { |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1767 | // Subsystem name |
| 1768 | optional string subsystem_name = 1; |
| 1769 | // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty. |
| 1770 | // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name. |
| 1771 | optional string subname = 2; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1772 | // 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] | 1773 | optional uint64 count = 3; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1774 | // 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] | 1775 | optional uint64 time_millis = 4; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 1776 | } |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1777 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1778 | /** |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1779 | * Pulls Cpu time per frequency. |
Chenjie Yu | 1ee9b74 | 2018-01-10 16:02:57 -0800 | [diff] [blame] | 1780 | * Pulls the time the cpu spend on the frequency index. Frequency index |
| 1781 | * starts from highest to lowest. The value should be monotonically |
| 1782 | * increasing since boot. However, if there is a cpu |
| 1783 | * hotplug event, the value would be reset as well. |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1784 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1785 | message CpuTimePerFreq { |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1786 | optional uint32 cluster = 1; |
| 1787 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1788 | optional uint64 time_millis = 3; |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1789 | } |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1790 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1791 | /** |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1792 | * Pulls Cpu Time Per Uid. |
| 1793 | * Note that isolated process uid time should be attributed to host uids. |
| 1794 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1795 | message CpuTimePerUid { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1796 | optional int32 uid = 1 [(is_uid) = true]; |
Misha Wagner | 6bc6c91 | 2018-11-16 13:19:54 +0000 | [diff] [blame^] | 1797 | optional uint64 user_time_micros = 2; |
| 1798 | optional uint64 sys_time_micros = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1799 | } |
| 1800 | |
| 1801 | /** |
| 1802 | * Pulls Cpu Time Per Uid per frequency. |
| 1803 | * Note that isolated process uid time should be attributed to host uids. |
| 1804 | * For each uid, we order the time by descending frequencies. |
| 1805 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1806 | message CpuTimePerUidFreq { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1807 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 1808 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1809 | optional uint64 time_millis = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1810 | } |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 1811 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1812 | /** |
| 1813 | * Pulls Wifi Controller Activity Energy Info |
| 1814 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1815 | message WifiActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1816 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1817 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1818 | // stack reported state |
| 1819 | // TODO: replace this with proto enum |
| 1820 | optional int32 stack_state = 2; |
| 1821 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1822 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1823 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1824 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1825 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1826 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1827 | // product of current(mA), voltage(V) and time(ms) |
| 1828 | optional uint64 controller_energy_used = 6; |
| 1829 | } |
| 1830 | |
| 1831 | /** |
| 1832 | * Pulls Modem Activity Energy Info |
| 1833 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1834 | message ModemActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1835 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1836 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1837 | // sleep time in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1838 | optional uint64 sleep_time_millis = 2; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1839 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1840 | optional uint64 controller_idle_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1841 | /** |
| 1842 | * Tx power index |
| 1843 | * index 0 = tx_power < 0dBm |
| 1844 | * index 1 = 0dBm < tx_power < 5dBm |
| 1845 | * index 2 = 5dBm < tx_power < 15dBm |
| 1846 | * index 3 = 15dBm < tx_power < 20dBm |
| 1847 | * index 4 = tx_power > 20dBm |
| 1848 | */ |
| 1849 | // tx time in ms at power level 0 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1850 | optional uint64 controller_tx_time_pl0_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1851 | // tx time in ms at power level 1 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1852 | optional uint64 controller_tx_time_pl1_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1853 | // tx time in ms at power level 2 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1854 | optional uint64 controller_tx_time_pl2_millis = 6; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1855 | // tx time in ms at power level 3 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1856 | optional uint64 controller_tx_time_pl3_millis = 7; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1857 | // tx time in ms at power level 4 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1858 | optional uint64 controller_tx_time_pl4_millis = 8; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1859 | // rx time in ms at power level 5 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1860 | optional uint64 controller_rx_time_millis = 9; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1861 | // product of current(mA), voltage(V) and time(ms) |
| 1862 | optional uint64 energy_used = 10; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 1863 | } |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 1864 | |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1865 | /** |
| 1866 | * Pulls Bluetooth Activity Energy Info |
| 1867 | * Note: BluetoothBytesTransfer is pulled at the same time from the controller. |
| 1868 | */ |
| 1869 | message BluetoothActivityInfo { |
| 1870 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1871 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1872 | // bluetooth stack state |
| 1873 | optional int32 bluetooth_stack_state = 2; |
| 1874 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1875 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1876 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1877 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1878 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1879 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1880 | // product of current(mA), voltage(V) and time(ms) |
| 1881 | optional uint64 energy_used = 6; |
| 1882 | } |
| 1883 | |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 1884 | /* |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 1885 | * Logs the memory stats for a process. |
| 1886 | */ |
| 1887 | message ProcessMemoryState { |
| 1888 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1889 | optional int32 uid = 1 [(is_uid) = true]; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 1890 | |
| 1891 | // The process name. |
| 1892 | optional string process_name = 2; |
| 1893 | |
| 1894 | // oom adj score. |
| 1895 | optional int32 oom_score = 3; |
| 1896 | |
| 1897 | // # of page-faults |
| 1898 | optional int64 pgfault = 4; |
| 1899 | |
| 1900 | // # of major page-faults |
| 1901 | optional int64 pgmajfault = 5; |
| 1902 | |
Rajeev Kumar | 9023599 | 2018-01-29 11:06:48 -0800 | [diff] [blame] | 1903 | // RSS |
| 1904 | optional int64 rss_in_bytes = 6; |
| 1905 | |
| 1906 | // CACHE |
| 1907 | optional int64 cache_in_bytes = 7; |
| 1908 | |
| 1909 | // SWAP |
| 1910 | optional int64 swap_in_bytes = 8; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 1911 | } |
| 1912 | |
| 1913 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1914 | * Elapsed real time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1915 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1916 | message SystemElapsedRealtime { |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1917 | optional uint64 time_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1918 | } |
| 1919 | |
| 1920 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1921 | * Up time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1922 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1923 | message SystemUptime { |
| 1924 | // Milliseconds since the system was booted. |
| 1925 | // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting |
| 1926 | // for external input). |
| 1927 | // 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] | 1928 | optional uint64 uptime_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1929 | } |
| 1930 | |
| 1931 | /* |
| 1932 | * Reads from /proc/uid_concurrent_active_time which has the format: |
| 1933 | * active: X (X is # cores) |
| 1934 | * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores) |
| 1935 | * [uid1]: [time-0] [time-1] [time-2] ... ... |
| 1936 | * ... |
| 1937 | * Time-N means the CPU time a UID spent running concurrently with N other processes. |
| 1938 | * The file contains a monotonically increasing count of time for a single boot. |
| 1939 | */ |
| 1940 | message CpuActiveTime { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1941 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 1942 | optional uint64 time_millis = 2; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1943 | } |
| 1944 | |
| 1945 | /** |
| 1946 | * Reads from /proc/uid_concurrent_policy_time which has the format: |
| 1947 | * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4) |
| 1948 | * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 1949 | * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 1950 | * ... |
| 1951 | * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes. |
| 1952 | * The file contains a monotonically increasing count of time for a single boot. |
| 1953 | */ |
| 1954 | message CpuClusterTime { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1955 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 1956 | optional int32 cluster_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1957 | optional uint64 time_millis = 3; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame] | 1958 | } |
| 1959 | |
| 1960 | /* |
| 1961 | * Pulls free disk space, for data, system partition and temporary directory. |
| 1962 | */ |
| 1963 | message DiskSpace { |
| 1964 | // available bytes in data partition |
| 1965 | optional uint64 data_available_bytes = 1; |
| 1966 | // available bytes in system partition |
| 1967 | optional uint64 system_available_bytes = 2; |
| 1968 | // available bytes in download cache or temp directories |
| 1969 | optional uint64 temp_available_bytes = 3; |
| 1970 | } |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 1971 | |
| 1972 | /** |
| 1973 | * Pulls battery coulomb counter, which is the remaining battery charge in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 1974 | * Pulled from: |
| 1975 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 1976 | */ |
| 1977 | message RemainingBatteryCapacity { |
| 1978 | optional int32 charge_uAh = 1; |
| 1979 | } |
| 1980 | |
| 1981 | /** |
| 1982 | * Pulls battery capacity, which is the battery capacity when full in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 1983 | * Pulled from: |
| 1984 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 1985 | */ |
| 1986 | message FullBatteryCapacity { |
| 1987 | optional int32 capacity_uAh = 1; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 1988 | } |
| 1989 | |
| 1990 | /** |
Tej Singh | d89137e | 2018-03-26 14:51:40 -0700 | [diff] [blame] | 1991 | * Pulls the temperature of various parts of the device. |
| 1992 | * 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] | 1993 | * |
| 1994 | * Pulled from: |
| 1995 | * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp |
| 1996 | */ |
| 1997 | message Temperature { |
| 1998 | // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY. |
| 1999 | optional android.os.TemperatureTypeEnum sensor_location = 1; |
| 2000 | |
| 2001 | // The name of the temperature source. Eg. CPU0 |
| 2002 | optional string sensor_name = 2; |
| 2003 | |
Tej Singh | d89137e | 2018-03-26 14:51:40 -0700 | [diff] [blame] | 2004 | // Temperature in tenths of a degree C. |
| 2005 | optional int32 temperature_dC = 3; |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 2006 | } |