Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 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 | |
Prabir Pradhan | 4810866 | 2022-09-09 21:22:04 +0000 | [diff] [blame] | 17 | #pragma once |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 18 | |
| 19 | #include "InjectionState.h" |
Siarhei Vishniakou | 18cbdb8 | 2024-01-31 17:58:13 -0800 | [diff] [blame] | 20 | #include "InputTargetFlags.h" |
Prabir Pradhan | abcdf5c | 2023-12-15 07:30:22 +0000 | [diff] [blame] | 21 | #include "trace/EventTrackerInterface.h" |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 22 | |
chaviw | 3277faf | 2021-05-19 16:45:23 -0500 | [diff] [blame] | 23 | #include <gui/InputApplication.h> |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 24 | #include <input/Input.h> |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 25 | #include <stdint.h> |
| 26 | #include <utils/Timers.h> |
| 27 | #include <functional> |
Siarhei Vishniakou | 72945a0 | 2023-09-18 18:30:25 -0700 | [diff] [blame] | 28 | #include <ostream> |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 29 | #include <string> |
| 30 | |
| 31 | namespace android::inputdispatcher { |
| 32 | |
| 33 | struct EventEntry { |
Siarhei Vishniakou | f1035d4 | 2019-09-20 16:32:01 +0100 | [diff] [blame] | 34 | enum class Type { |
| 35 | CONFIGURATION_CHANGED, |
| 36 | DEVICE_RESET, |
| 37 | FOCUS, |
| 38 | KEY, |
| 39 | MOTION, |
Chris Ye | f59a2f4 | 2020-10-16 12:55:26 -0700 | [diff] [blame] | 40 | SENSOR, |
Prabir Pradhan | 9998771 | 2020-11-10 18:43:05 -0800 | [diff] [blame] | 41 | POINTER_CAPTURE_CHANGED, |
arthurhung | b89ccb0 | 2020-12-30 16:19:01 +0800 | [diff] [blame] | 42 | DRAG, |
Antonio Kantek | 7242d8b | 2021-08-05 16:07:20 -0700 | [diff] [blame] | 43 | TOUCH_MODE_CHANGED, |
Dominik Laskowski | 7578845 | 2021-02-09 18:51:25 -0800 | [diff] [blame] | 44 | |
| 45 | ftl_last = TOUCH_MODE_CHANGED |
Siarhei Vishniakou | f1035d4 | 2019-09-20 16:32:01 +0100 | [diff] [blame] | 46 | }; |
Siarhei Vishniakou | 4948327 | 2019-10-22 13:13:47 -0700 | [diff] [blame] | 47 | |
Garfield Tan | 6a5a14e | 2020-01-28 13:24:04 -0800 | [diff] [blame] | 48 | int32_t id; |
Siarhei Vishniakou | 4948327 | 2019-10-22 13:13:47 -0700 | [diff] [blame] | 49 | Type type; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 50 | nsecs_t eventTime; |
| 51 | uint32_t policyFlags; |
Prabir Pradhan | a8cdbe1 | 2023-11-01 21:30:02 +0000 | [diff] [blame] | 52 | std::shared_ptr<InjectionState> injectionState; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 53 | |
Prabir Pradhan | 2404754 | 2023-11-02 17:14:59 +0000 | [diff] [blame] | 54 | mutable bool dispatchInProgress; // initially false, set to true while dispatching |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 55 | |
Siarhei Vishniakou | de4bf15 | 2019-08-16 11:12:52 -0500 | [diff] [blame] | 56 | /** |
| 57 | * Injected keys are events from an external (probably untrusted) application |
| 58 | * and are not related to real hardware state. They come in via |
| 59 | * InputDispatcher::injectInputEvent, which sets policy flag POLICY_FLAG_INJECTED. |
| 60 | */ |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 61 | inline bool isInjected() const { return injectionState != nullptr; } |
| 62 | |
Siarhei Vishniakou | de4bf15 | 2019-08-16 11:12:52 -0500 | [diff] [blame] | 63 | /** |
| 64 | * Synthesized events are either injected events, or events that come |
| 65 | * from real hardware, but aren't directly attributable to a specific hardware event. |
| 66 | * Key repeat is a synthesized event, because it is related to an actual hardware state |
| 67 | * (a key is currently pressed), but the repeat itself is generated by the framework. |
| 68 | */ |
Garfield Tan | ff1f1bb | 2020-01-28 13:24:04 -0800 | [diff] [blame] | 69 | inline bool isSynthesized() const { |
| 70 | return isInjected() || IdGenerator::getSource(id) != IdGenerator::Source::INPUT_READER; |
| 71 | } |
Siarhei Vishniakou | de4bf15 | 2019-08-16 11:12:52 -0500 | [diff] [blame] | 72 | |
Siarhei Vishniakou | 14411c9 | 2020-09-18 21:15:05 -0500 | [diff] [blame] | 73 | virtual std::string getDescription() const = 0; |
Siarhei Vishniakou | 4cb50ca | 2020-05-26 21:43:02 -0700 | [diff] [blame] | 74 | |
Garfield Tan | 6a5a14e | 2020-01-28 13:24:04 -0800 | [diff] [blame] | 75 | EventEntry(int32_t id, Type type, nsecs_t eventTime, uint32_t policyFlags); |
Prabir Pradhan | 2404754 | 2023-11-02 17:14:59 +0000 | [diff] [blame] | 76 | EventEntry(const EventEntry&) = delete; |
| 77 | EventEntry& operator=(const EventEntry&) = delete; |
Prabir Pradhan | a8cdbe1 | 2023-11-01 21:30:02 +0000 | [diff] [blame] | 78 | virtual ~EventEntry() = default; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 79 | }; |
| 80 | |
| 81 | struct ConfigurationChangedEntry : EventEntry { |
Garfield Tan | 6a5a14e | 2020-01-28 13:24:04 -0800 | [diff] [blame] | 82 | explicit ConfigurationChangedEntry(int32_t id, nsecs_t eventTime); |
Siarhei Vishniakou | 14411c9 | 2020-09-18 21:15:05 -0500 | [diff] [blame] | 83 | std::string getDescription() const override; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 84 | }; |
| 85 | |
| 86 | struct DeviceResetEntry : EventEntry { |
| 87 | int32_t deviceId; |
| 88 | |
Garfield Tan | 6a5a14e | 2020-01-28 13:24:04 -0800 | [diff] [blame] | 89 | DeviceResetEntry(int32_t id, nsecs_t eventTime, int32_t deviceId); |
Siarhei Vishniakou | 14411c9 | 2020-09-18 21:15:05 -0500 | [diff] [blame] | 90 | std::string getDescription() const override; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 91 | }; |
| 92 | |
Siarhei Vishniakou | f1035d4 | 2019-09-20 16:32:01 +0100 | [diff] [blame] | 93 | struct FocusEntry : EventEntry { |
| 94 | sp<IBinder> connectionToken; |
| 95 | bool hasFocus; |
Vishnu Nair | c519ff7 | 2021-01-21 08:23:08 -0800 | [diff] [blame] | 96 | std::string reason; |
Siarhei Vishniakou | f1035d4 | 2019-09-20 16:32:01 +0100 | [diff] [blame] | 97 | |
Vishnu Nair | 7d3d00d | 2020-08-03 11:20:42 -0700 | [diff] [blame] | 98 | FocusEntry(int32_t id, nsecs_t eventTime, sp<IBinder> connectionToken, bool hasFocus, |
Vishnu Nair | c519ff7 | 2021-01-21 08:23:08 -0800 | [diff] [blame] | 99 | const std::string& reason); |
Siarhei Vishniakou | 14411c9 | 2020-09-18 21:15:05 -0500 | [diff] [blame] | 100 | std::string getDescription() const override; |
Siarhei Vishniakou | f1035d4 | 2019-09-20 16:32:01 +0100 | [diff] [blame] | 101 | }; |
| 102 | |
Prabir Pradhan | 9998771 | 2020-11-10 18:43:05 -0800 | [diff] [blame] | 103 | struct PointerCaptureChangedEntry : EventEntry { |
Prabir Pradhan | 5cc1a69 | 2021-08-06 14:01:18 +0000 | [diff] [blame] | 104 | const PointerCaptureRequest pointerCaptureRequest; |
Prabir Pradhan | 9998771 | 2020-11-10 18:43:05 -0800 | [diff] [blame] | 105 | |
Prabir Pradhan | 5cc1a69 | 2021-08-06 14:01:18 +0000 | [diff] [blame] | 106 | PointerCaptureChangedEntry(int32_t id, nsecs_t eventTime, const PointerCaptureRequest&); |
Prabir Pradhan | 9998771 | 2020-11-10 18:43:05 -0800 | [diff] [blame] | 107 | std::string getDescription() const override; |
Prabir Pradhan | 9998771 | 2020-11-10 18:43:05 -0800 | [diff] [blame] | 108 | }; |
| 109 | |
arthurhung | b89ccb0 | 2020-12-30 16:19:01 +0800 | [diff] [blame] | 110 | struct DragEntry : EventEntry { |
| 111 | sp<IBinder> connectionToken; |
| 112 | bool isExiting; |
| 113 | float x, y; |
| 114 | |
| 115 | DragEntry(int32_t id, nsecs_t eventTime, sp<IBinder> connectionToken, bool isExiting, float x, |
| 116 | float y); |
| 117 | std::string getDescription() const override; |
arthurhung | b89ccb0 | 2020-12-30 16:19:01 +0800 | [diff] [blame] | 118 | }; |
| 119 | |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 120 | struct KeyEntry : EventEntry { |
| 121 | int32_t deviceId; |
| 122 | uint32_t source; |
Linnan Li | 13bf76a | 2024-05-05 19:18:02 +0800 | [diff] [blame^] | 123 | ui::LogicalDisplayId displayId; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 124 | int32_t action; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 125 | int32_t keyCode; |
| 126 | int32_t scanCode; |
| 127 | int32_t metaState; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 128 | nsecs_t downTime; |
Prabir Pradhan | abcdf5c | 2023-12-15 07:30:22 +0000 | [diff] [blame] | 129 | std::unique_ptr<trace::EventTrackerInterface> traceTracker; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 130 | |
| 131 | bool syntheticRepeat; // set to true for synthetic key repeats |
| 132 | |
Michael Wright | 5caf55a | 2022-11-24 22:31:42 +0000 | [diff] [blame] | 133 | enum class InterceptKeyResult { |
| 134 | UNKNOWN, |
| 135 | SKIP, |
| 136 | CONTINUE, |
| 137 | TRY_AGAIN_LATER, |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 138 | }; |
Prabir Pradhan | 2404754 | 2023-11-02 17:14:59 +0000 | [diff] [blame] | 139 | // These are special fields that may need to be modified while the event is being dispatched. |
| 140 | mutable InterceptKeyResult interceptKeyResult; // set based on the interception result |
| 141 | mutable nsecs_t interceptKeyWakeupTime; // used with INTERCEPT_KEY_RESULT_TRY_AGAIN_LATER |
| 142 | mutable int32_t flags; |
Prabir Pradhan | 560d0d1 | 2024-03-07 18:08:27 +0000 | [diff] [blame] | 143 | // TODO(b/328618922): Refactor key repeat generation to make repeatCount non-mutable. |
Prabir Pradhan | 2404754 | 2023-11-02 17:14:59 +0000 | [diff] [blame] | 144 | mutable int32_t repeatCount; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 145 | |
Prabir Pradhan | a8cdbe1 | 2023-11-01 21:30:02 +0000 | [diff] [blame] | 146 | KeyEntry(int32_t id, std::shared_ptr<InjectionState> injectionState, nsecs_t eventTime, |
Linnan Li | 13bf76a | 2024-05-05 19:18:02 +0800 | [diff] [blame^] | 147 | int32_t deviceId, uint32_t source, ui::LogicalDisplayId displayId, |
| 148 | uint32_t policyFlags, int32_t action, int32_t flags, int32_t keyCode, int32_t scanCode, |
| 149 | int32_t metaState, int32_t repeatCount, nsecs_t downTime); |
Siarhei Vishniakou | 14411c9 | 2020-09-18 21:15:05 -0500 | [diff] [blame] | 150 | std::string getDescription() const override; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 151 | }; |
| 152 | |
Prabir Pradhan | abcdf5c | 2023-12-15 07:30:22 +0000 | [diff] [blame] | 153 | std::ostream& operator<<(std::ostream& out, const KeyEntry& motionEntry); |
| 154 | |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 155 | struct MotionEntry : EventEntry { |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 156 | int32_t deviceId; |
| 157 | uint32_t source; |
Linnan Li | 13bf76a | 2024-05-05 19:18:02 +0800 | [diff] [blame^] | 158 | ui::LogicalDisplayId displayId; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 159 | int32_t action; |
| 160 | int32_t actionButton; |
| 161 | int32_t flags; |
| 162 | int32_t metaState; |
| 163 | int32_t buttonState; |
| 164 | MotionClassification classification; |
| 165 | int32_t edgeFlags; |
| 166 | float xPrecision; |
| 167 | float yPrecision; |
| 168 | float xCursorPosition; |
| 169 | float yCursorPosition; |
| 170 | nsecs_t downTime; |
Siarhei Vishniakou | edd6120 | 2023-10-18 11:22:40 -0700 | [diff] [blame] | 171 | std::vector<PointerProperties> pointerProperties; |
| 172 | std::vector<PointerCoords> pointerCoords; |
Prabir Pradhan | abcdf5c | 2023-12-15 07:30:22 +0000 | [diff] [blame] | 173 | std::unique_ptr<trace::EventTrackerInterface> traceTracker; |
Siarhei Vishniakou | edd6120 | 2023-10-18 11:22:40 -0700 | [diff] [blame] | 174 | |
| 175 | size_t getPointerCount() const { return pointerProperties.size(); } |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 176 | |
Prabir Pradhan | a8cdbe1 | 2023-11-01 21:30:02 +0000 | [diff] [blame] | 177 | MotionEntry(int32_t id, std::shared_ptr<InjectionState> injectionState, nsecs_t eventTime, |
Linnan Li | 13bf76a | 2024-05-05 19:18:02 +0800 | [diff] [blame^] | 178 | int32_t deviceId, uint32_t source, ui::LogicalDisplayId displayId, |
| 179 | uint32_t policyFlags, int32_t action, int32_t actionButton, int32_t flags, |
| 180 | int32_t metaState, int32_t buttonState, MotionClassification classification, |
| 181 | int32_t edgeFlags, float xPrecision, float yPrecision, float xCursorPosition, |
| 182 | float yCursorPosition, nsecs_t downTime, |
| 183 | const std::vector<PointerProperties>& pointerProperties, |
Siarhei Vishniakou | edd6120 | 2023-10-18 11:22:40 -0700 | [diff] [blame] | 184 | const std::vector<PointerCoords>& pointerCoords); |
Siarhei Vishniakou | 14411c9 | 2020-09-18 21:15:05 -0500 | [diff] [blame] | 185 | std::string getDescription() const override; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 186 | }; |
| 187 | |
Siarhei Vishniakou | 72945a0 | 2023-09-18 18:30:25 -0700 | [diff] [blame] | 188 | std::ostream& operator<<(std::ostream& out, const MotionEntry& motionEntry); |
| 189 | |
Chris Ye | f59a2f4 | 2020-10-16 12:55:26 -0700 | [diff] [blame] | 190 | struct SensorEntry : EventEntry { |
| 191 | int32_t deviceId; |
| 192 | uint32_t source; |
| 193 | InputDeviceSensorType sensorType; |
| 194 | InputDeviceSensorAccuracy accuracy; |
| 195 | bool accuracyChanged; |
| 196 | nsecs_t hwTimestamp; |
| 197 | |
| 198 | std::vector<float> values; |
| 199 | |
| 200 | SensorEntry(int32_t id, nsecs_t eventTime, int32_t deviceId, uint32_t source, |
| 201 | uint32_t policyFlags, nsecs_t hwTimestamp, InputDeviceSensorType sensorType, |
| 202 | InputDeviceSensorAccuracy accuracy, bool accuracyChanged, |
| 203 | std::vector<float> values); |
| 204 | std::string getDescription() const override; |
Chris Ye | f59a2f4 | 2020-10-16 12:55:26 -0700 | [diff] [blame] | 205 | }; |
| 206 | |
Antonio Kantek | 7242d8b | 2021-08-05 16:07:20 -0700 | [diff] [blame] | 207 | struct TouchModeEntry : EventEntry { |
| 208 | bool inTouchMode; |
Linnan Li | 13bf76a | 2024-05-05 19:18:02 +0800 | [diff] [blame^] | 209 | ui::LogicalDisplayId displayId; |
Antonio Kantek | 7242d8b | 2021-08-05 16:07:20 -0700 | [diff] [blame] | 210 | |
Linnan Li | 13bf76a | 2024-05-05 19:18:02 +0800 | [diff] [blame^] | 211 | TouchModeEntry(int32_t id, nsecs_t eventTime, bool inTouchMode, ui::LogicalDisplayId displayId); |
Antonio Kantek | 7242d8b | 2021-08-05 16:07:20 -0700 | [diff] [blame] | 212 | std::string getDescription() const override; |
Antonio Kantek | 7242d8b | 2021-08-05 16:07:20 -0700 | [diff] [blame] | 213 | }; |
| 214 | |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 215 | // Tracks the progress of dispatching a particular event to a particular connection. |
| 216 | struct DispatchEntry { |
| 217 | const uint32_t seq; // unique sequence number, never 0 |
| 218 | |
Prabir Pradhan | 2404754 | 2023-11-02 17:14:59 +0000 | [diff] [blame] | 219 | std::shared_ptr<const EventEntry> eventEntry; // the event to dispatch |
Siarhei Vishniakou | 18cbdb8 | 2024-01-31 17:58:13 -0800 | [diff] [blame] | 220 | const ftl::Flags<InputTargetFlags> targetFlags; |
chaviw | 1ff3d1e | 2020-07-01 15:53:47 -0700 | [diff] [blame] | 221 | ui::Transform transform; |
Prabir Pradhan | b9b1850 | 2021-08-26 12:30:32 -0700 | [diff] [blame] | 222 | ui::Transform rawTransform; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 223 | float globalScaleFactor; |
Siarhei Vishniakou | d44dddf | 2020-03-25 16:16:40 -0700 | [diff] [blame] | 224 | // Both deliveryTime and timeoutTime are only populated when the entry is sent to the app, |
| 225 | // and will be undefined before that. |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 226 | nsecs_t deliveryTime; // time when the event was actually delivered |
Siarhei Vishniakou | d44dddf | 2020-03-25 16:16:40 -0700 | [diff] [blame] | 227 | // An ANR will be triggered if a response for this entry is not received by timeoutTime |
| 228 | nsecs_t timeoutTime; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 229 | |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 230 | int32_t resolvedFlags; |
| 231 | |
Prabir Pradhan | adc59b4 | 2023-12-15 05:34:11 +0000 | [diff] [blame] | 232 | // Information about the dispatch window used for tracing. We avoid holding a window handle |
| 233 | // here because information in a window handle may be dynamically updated within the lifespan |
| 234 | // of this dispatch entry. |
| 235 | gui::Uid targetUid; |
| 236 | int64_t vsyncId; |
| 237 | // The window that this event is targeting. The only case when this windowId is not populated |
| 238 | // is when dispatching an event to a global monitor. |
| 239 | std::optional<int32_t> windowId; |
| 240 | |
Prabir Pradhan | 2404754 | 2023-11-02 17:14:59 +0000 | [diff] [blame] | 241 | DispatchEntry(std::shared_ptr<const EventEntry> eventEntry, |
Siarhei Vishniakou | 18cbdb8 | 2024-01-31 17:58:13 -0800 | [diff] [blame] | 242 | ftl::Flags<InputTargetFlags> targetFlags, const ui::Transform& transform, |
Prabir Pradhan | adc59b4 | 2023-12-15 05:34:11 +0000 | [diff] [blame] | 243 | const ui::Transform& rawTransform, float globalScaleFactor, gui::Uid targetUid, |
| 244 | int64_t vsyncId, std::optional<int32_t> windowId); |
Prabir Pradhan | 8c90d78 | 2023-09-15 21:16:44 +0000 | [diff] [blame] | 245 | DispatchEntry(const DispatchEntry&) = delete; |
| 246 | DispatchEntry& operator=(const DispatchEntry&) = delete; |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 247 | |
Siarhei Vishniakou | 253f464 | 2022-11-09 13:42:06 -0800 | [diff] [blame] | 248 | inline bool hasForegroundTarget() const { |
Siarhei Vishniakou | 18cbdb8 | 2024-01-31 17:58:13 -0800 | [diff] [blame] | 249 | return targetFlags.test(InputTargetFlags::FOREGROUND); |
Siarhei Vishniakou | 253f464 | 2022-11-09 13:42:06 -0800 | [diff] [blame] | 250 | } |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 251 | |
Siarhei Vishniakou | 18cbdb8 | 2024-01-31 17:58:13 -0800 | [diff] [blame] | 252 | inline bool isSplit() const { return targetFlags.test(InputTargetFlags::SPLIT); } |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 253 | |
| 254 | private: |
| 255 | static volatile int32_t sNextSeqAtomic; |
| 256 | |
| 257 | static uint32_t nextSeq(); |
| 258 | }; |
| 259 | |
Siarhei Vishniakou | d010b01 | 2023-01-18 15:00:53 -0800 | [diff] [blame] | 260 | std::ostream& operator<<(std::ostream& out, const DispatchEntry& entry); |
| 261 | |
Gang Wang | e908789 | 2020-01-07 12:17:14 -0500 | [diff] [blame] | 262 | VerifiedKeyEvent verifiedKeyEventFromKeyEntry(const KeyEntry& entry); |
Prabir Pradhan | b5cb957 | 2021-09-24 06:35:16 -0700 | [diff] [blame] | 263 | VerifiedMotionEvent verifiedMotionEventFromMotionEntry(const MotionEntry& entry, |
| 264 | const ui::Transform& rawTransform); |
Gang Wang | e908789 | 2020-01-07 12:17:14 -0500 | [diff] [blame] | 265 | |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 266 | } // namespace android::inputdispatcher |