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