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