Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2022 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 | */ |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 16 | #pragma once |
| 17 | |
| 18 | #include <InputDevice.h> |
| 19 | #include <InputMapper.h> |
| 20 | #include <InputReader.h> |
Aditya Wazir | eea5be0 | 2022-10-31 12:40:10 +0530 | [diff] [blame] | 21 | #include <ThreadSafeFuzzedDataProvider.h> |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 22 | |
| 23 | constexpr size_t kValidTypes[] = {EV_SW, |
| 24 | EV_SYN, |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 25 | EV_ABS, |
| 26 | EV_KEY, |
| 27 | EV_MSC, |
| 28 | EV_REL, |
| 29 | android::EventHubInterface::DEVICE_ADDED, |
| 30 | android::EventHubInterface::DEVICE_REMOVED, |
| 31 | android::EventHubInterface::FINISHED_DEVICE_SCAN}; |
| 32 | |
| 33 | constexpr size_t kValidCodes[] = { |
| 34 | SYN_REPORT, |
| 35 | ABS_MT_SLOT, |
| 36 | SYN_MT_REPORT, |
| 37 | ABS_MT_POSITION_X, |
| 38 | ABS_MT_POSITION_Y, |
| 39 | ABS_MT_TOUCH_MAJOR, |
| 40 | ABS_MT_TOUCH_MINOR, |
| 41 | ABS_MT_WIDTH_MAJOR, |
| 42 | ABS_MT_WIDTH_MINOR, |
| 43 | ABS_MT_ORIENTATION, |
| 44 | ABS_MT_TRACKING_ID, |
| 45 | ABS_MT_PRESSURE, |
| 46 | ABS_MT_DISTANCE, |
| 47 | ABS_MT_TOOL_TYPE, |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 48 | MSC_SCAN, |
| 49 | REL_X, |
| 50 | REL_Y, |
| 51 | REL_WHEEL, |
| 52 | REL_HWHEEL, |
| 53 | BTN_LEFT, |
| 54 | BTN_RIGHT, |
| 55 | BTN_MIDDLE, |
| 56 | BTN_BACK, |
| 57 | BTN_SIDE, |
| 58 | BTN_FORWARD, |
| 59 | BTN_EXTRA, |
| 60 | BTN_TASK, |
| 61 | }; |
| 62 | |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 63 | constexpr size_t kMaxSize = 256; |
| 64 | |
| 65 | namespace android { |
| 66 | |
Siarhei Vishniakou | 6d73f83 | 2022-07-21 17:27:03 -0700 | [diff] [blame] | 67 | template<class Fdp> |
| 68 | ToolType getFuzzedToolType(Fdp& fdp) { |
| 69 | const int32_t toolType = fdp.template ConsumeIntegralInRange<int32_t>( |
| 70 | static_cast<int32_t>(ToolType::ftl_first), |
| 71 | static_cast<int32_t>(ToolType::ftl_last)); |
| 72 | return static_cast<ToolType>(toolType); |
| 73 | } |
| 74 | |
Harry Cutts | 656e0ad | 2023-06-16 16:39:55 +0000 | [diff] [blame] | 75 | template <class Fdp> |
| 76 | RawEvent getFuzzedRawEvent(Fdp& fdp) { |
| 77 | const int32_t type = fdp.ConsumeBool() ? fdp.PickValueInArray(kValidTypes) |
| 78 | : fdp.template ConsumeIntegral<int32_t>(); |
| 79 | const int32_t code = fdp.ConsumeBool() ? fdp.PickValueInArray(kValidCodes) |
| 80 | : fdp.template ConsumeIntegral<int32_t>(); |
| 81 | return RawEvent{ |
| 82 | .when = fdp.template ConsumeIntegral<nsecs_t>(), |
| 83 | .readTime = fdp.template ConsumeIntegral<nsecs_t>(), |
| 84 | .deviceId = fdp.template ConsumeIntegral<int32_t>(), |
| 85 | .type = type, |
| 86 | .code = code, |
| 87 | .value = fdp.template ConsumeIntegral<int32_t>(), |
| 88 | }; |
| 89 | } |
| 90 | |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 91 | class FuzzEventHub : public EventHubInterface { |
| 92 | InputDeviceIdentifier mIdentifier; |
| 93 | std::vector<TouchVideoFrame> mVideoFrames; |
| 94 | PropertyMap mFuzzConfig; |
Aditya Wazir | eea5be0 | 2022-10-31 12:40:10 +0530 | [diff] [blame] | 95 | std::shared_ptr<ThreadSafeFuzzedDataProvider> mFdp; |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 96 | |
| 97 | public: |
Aditya Wazir | eea5be0 | 2022-10-31 12:40:10 +0530 | [diff] [blame] | 98 | FuzzEventHub(std::shared_ptr<ThreadSafeFuzzedDataProvider> fdp) : mFdp(std::move(fdp)) {} |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 99 | ~FuzzEventHub() {} |
| 100 | void addProperty(std::string key, std::string value) { mFuzzConfig.addProperty(key, value); } |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 101 | |
| 102 | ftl::Flags<InputDeviceClass> getDeviceClasses(int32_t deviceId) const override { |
| 103 | return ftl::Flags<InputDeviceClass>(mFdp->ConsumeIntegral<uint32_t>()); |
| 104 | } |
| 105 | InputDeviceIdentifier getDeviceIdentifier(int32_t deviceId) const override { |
| 106 | return mIdentifier; |
| 107 | } |
| 108 | int32_t getDeviceControllerNumber(int32_t deviceId) const override { |
| 109 | return mFdp->ConsumeIntegral<int32_t>(); |
| 110 | } |
Harry Cutts | c34f758 | 2023-03-07 16:23:30 +0000 | [diff] [blame] | 111 | std::optional<PropertyMap> getConfiguration(int32_t deviceId) const override { |
| 112 | return mFuzzConfig; |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 113 | } |
| 114 | status_t getAbsoluteAxisInfo(int32_t deviceId, int axis, |
| 115 | RawAbsoluteAxisInfo* outAxisInfo) const override { |
| 116 | return mFdp->ConsumeIntegral<status_t>(); |
| 117 | } |
| 118 | bool hasRelativeAxis(int32_t deviceId, int axis) const override { return mFdp->ConsumeBool(); } |
| 119 | bool hasInputProperty(int32_t deviceId, int property) const override { |
| 120 | return mFdp->ConsumeBool(); |
| 121 | } |
| 122 | bool hasMscEvent(int32_t deviceId, int mscEvent) const override { return mFdp->ConsumeBool(); } |
| 123 | status_t mapKey(int32_t deviceId, int32_t scanCode, int32_t usageCode, int32_t metaState, |
| 124 | int32_t* outKeycode, int32_t* outMetaState, uint32_t* outFlags) const override { |
| 125 | return mFdp->ConsumeIntegral<status_t>(); |
| 126 | } |
| 127 | status_t mapAxis(int32_t deviceId, int32_t scanCode, AxisInfo* outAxisInfo) const override { |
| 128 | return mFdp->ConsumeIntegral<status_t>(); |
| 129 | } |
| 130 | void setExcludedDevices(const std::vector<std::string>& devices) override {} |
Siarhei Vishniakou | 7b3ea0b | 2022-09-16 14:23:20 -0700 | [diff] [blame] | 131 | std::vector<RawEvent> getEvents(int timeoutMillis) override { |
| 132 | std::vector<RawEvent> events; |
| 133 | const size_t count = mFdp->ConsumeIntegralInRange<size_t>(0, kMaxSize); |
| 134 | for (size_t i = 0; i < count; ++i) { |
Harry Cutts | 656e0ad | 2023-06-16 16:39:55 +0000 | [diff] [blame] | 135 | events.push_back(getFuzzedRawEvent(*mFdp)); |
Siarhei Vishniakou | 7b3ea0b | 2022-09-16 14:23:20 -0700 | [diff] [blame] | 136 | } |
| 137 | return events; |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 138 | } |
| 139 | std::vector<TouchVideoFrame> getVideoFrames(int32_t deviceId) override { return mVideoFrames; } |
| 140 | |
| 141 | base::Result<std::pair<InputDeviceSensorType, int32_t>> mapSensor( |
| 142 | int32_t deviceId, int32_t absCode) const override { |
| 143 | return base::ResultError("Fuzzer", UNKNOWN_ERROR); |
| 144 | }; |
| 145 | // Raw batteries are sysfs power_supply nodes we found from the EventHub device sysfs node, |
| 146 | // containing the raw info of the sysfs node structure. |
| 147 | std::vector<int32_t> getRawBatteryIds(int32_t deviceId) const override { return {}; } |
| 148 | std::optional<RawBatteryInfo> getRawBatteryInfo(int32_t deviceId, |
| 149 | int32_t BatteryId) const override { |
| 150 | return std::nullopt; |
| 151 | }; |
| 152 | |
| 153 | std::vector<int32_t> getRawLightIds(int32_t deviceId) const override { return {}; }; |
| 154 | std::optional<RawLightInfo> getRawLightInfo(int32_t deviceId, int32_t lightId) const override { |
| 155 | return std::nullopt; |
| 156 | }; |
| 157 | std::optional<int32_t> getLightBrightness(int32_t deviceId, int32_t lightId) const override { |
| 158 | return std::nullopt; |
| 159 | }; |
| 160 | void setLightBrightness(int32_t deviceId, int32_t lightId, int32_t brightness) override{}; |
| 161 | std::optional<std::unordered_map<LightColor, int32_t>> getLightIntensities( |
| 162 | int32_t deviceId, int32_t lightId) const override { |
| 163 | return std::nullopt; |
| 164 | }; |
| 165 | void setLightIntensities(int32_t deviceId, int32_t lightId, |
| 166 | std::unordered_map<LightColor, int32_t> intensities) override{}; |
| 167 | |
Vaibhav Devmurari | 7fb4113 | 2023-01-02 13:30:26 +0000 | [diff] [blame] | 168 | std::optional<RawLayoutInfo> getRawLayoutInfo(int32_t deviceId) const override { |
| 169 | return std::nullopt; |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 170 | }; |
| 171 | |
| 172 | int32_t getScanCodeState(int32_t deviceId, int32_t scanCode) const override { |
| 173 | return mFdp->ConsumeIntegral<int32_t>(); |
| 174 | } |
| 175 | int32_t getKeyCodeState(int32_t deviceId, int32_t keyCode) const override { |
| 176 | return mFdp->ConsumeIntegral<int32_t>(); |
| 177 | } |
| 178 | int32_t getSwitchState(int32_t deviceId, int32_t sw) const override { |
| 179 | return mFdp->ConsumeIntegral<int32_t>(); |
| 180 | } |
Vaibhav Devmurari | cbba14c | 2022-10-10 16:54:49 +0000 | [diff] [blame] | 181 | void addKeyRemapping(int32_t deviceId, int32_t fromKeyCode, int32_t toKeyCode) const override {} |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 182 | int32_t getKeyCodeForKeyLocation(int32_t deviceId, int32_t locationKeyCode) const override { |
| 183 | return mFdp->ConsumeIntegral<int32_t>(); |
| 184 | } |
| 185 | status_t getAbsoluteAxisValue(int32_t deviceId, int32_t axis, |
| 186 | int32_t* outValue) const override { |
| 187 | return mFdp->ConsumeIntegral<status_t>(); |
| 188 | } |
| 189 | bool markSupportedKeyCodes(int32_t deviceId, const std::vector<int32_t>& keyCodes, |
| 190 | uint8_t* outFlags) const override { |
| 191 | return mFdp->ConsumeBool(); |
| 192 | } |
| 193 | bool hasScanCode(int32_t deviceId, int32_t scanCode) const override { |
| 194 | return mFdp->ConsumeBool(); |
| 195 | } |
| 196 | bool hasKeyCode(int32_t deviceId, int32_t keyCode) const override { |
| 197 | return mFdp->ConsumeBool(); |
| 198 | } |
| 199 | bool hasLed(int32_t deviceId, int32_t led) const override { return mFdp->ConsumeBool(); } |
| 200 | void setLedState(int32_t deviceId, int32_t led, bool on) override {} |
| 201 | void getVirtualKeyDefinitions( |
| 202 | int32_t deviceId, std::vector<VirtualKeyDefinition>& outVirtualKeys) const override {} |
| 203 | const std::shared_ptr<KeyCharacterMap> getKeyCharacterMap(int32_t deviceId) const override { |
| 204 | return nullptr; |
| 205 | } |
| 206 | bool setKeyboardLayoutOverlay(int32_t deviceId, std::shared_ptr<KeyCharacterMap> map) override { |
| 207 | return mFdp->ConsumeBool(); |
| 208 | } |
| 209 | void vibrate(int32_t deviceId, const VibrationElement& effect) override {} |
| 210 | void cancelVibrate(int32_t deviceId) override {} |
| 211 | |
| 212 | std::vector<int32_t> getVibratorIds(int32_t deviceId) const override { return {}; }; |
| 213 | |
| 214 | /* Query battery level. */ |
| 215 | std::optional<int32_t> getBatteryCapacity(int32_t deviceId, int32_t batteryId) const override { |
| 216 | return std::nullopt; |
| 217 | }; |
| 218 | |
| 219 | /* Query battery status. */ |
| 220 | std::optional<int32_t> getBatteryStatus(int32_t deviceId, int32_t batteryId) const override { |
| 221 | return std::nullopt; |
| 222 | }; |
| 223 | |
| 224 | void requestReopenDevices() override {} |
| 225 | void wake() override {} |
| 226 | void dump(std::string& dump) const override {} |
| 227 | void monitor() const override {} |
| 228 | bool isDeviceEnabled(int32_t deviceId) const override { return mFdp->ConsumeBool(); } |
| 229 | status_t enableDevice(int32_t deviceId) override { return mFdp->ConsumeIntegral<status_t>(); } |
| 230 | status_t disableDevice(int32_t deviceId) override { return mFdp->ConsumeIntegral<status_t>(); } |
Vaibhav Devmurari | 5fc7d85 | 2023-03-17 18:43:33 +0000 | [diff] [blame] | 231 | void sysfsNodeChanged(const std::string& sysfsNodePath) override {} |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 232 | }; |
| 233 | |
| 234 | class FuzzPointerController : public PointerControllerInterface { |
Aditya Wazir | eea5be0 | 2022-10-31 12:40:10 +0530 | [diff] [blame] | 235 | std::shared_ptr<ThreadSafeFuzzedDataProvider> mFdp; |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 236 | |
| 237 | public: |
Aditya Wazir | eea5be0 | 2022-10-31 12:40:10 +0530 | [diff] [blame] | 238 | FuzzPointerController(std::shared_ptr<ThreadSafeFuzzedDataProvider> mFdp) : mFdp(mFdp) {} |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 239 | ~FuzzPointerController() {} |
Prabir Pradhan | 2719e82 | 2023-02-28 17:39:36 +0000 | [diff] [blame] | 240 | std::optional<FloatRect> getBounds() const override { |
| 241 | if (mFdp->ConsumeBool()) { |
| 242 | return {}; |
| 243 | } else { |
| 244 | return FloatRect{mFdp->ConsumeFloatingPoint<float>(), |
| 245 | mFdp->ConsumeFloatingPoint<float>(), |
| 246 | mFdp->ConsumeFloatingPoint<float>(), |
| 247 | mFdp->ConsumeFloatingPoint<float>()}; |
| 248 | } |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 249 | } |
| 250 | void move(float deltaX, float deltaY) override {} |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 251 | void setPosition(float x, float y) override {} |
Prabir Pradhan | 2719e82 | 2023-02-28 17:39:36 +0000 | [diff] [blame] | 252 | FloatPoint getPosition() const override { |
| 253 | return {mFdp->ConsumeFloatingPoint<float>(), mFdp->ConsumeFloatingPoint<float>()}; |
| 254 | } |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 255 | void fade(Transition transition) override {} |
| 256 | void unfade(Transition transition) override {} |
| 257 | void setPresentation(Presentation presentation) override {} |
| 258 | void setSpots(const PointerCoords* spotCoords, const uint32_t* spotIdToIndex, |
| 259 | BitSet32 spotIdBits, int32_t displayId) override {} |
| 260 | void clearSpots() override {} |
| 261 | int32_t getDisplayId() const override { return mFdp->ConsumeIntegral<int32_t>(); } |
| 262 | void setDisplayViewport(const DisplayViewport& displayViewport) override {} |
| 263 | }; |
| 264 | |
| 265 | class FuzzInputReaderPolicy : public InputReaderPolicyInterface { |
| 266 | TouchAffineTransformation mTransform; |
| 267 | std::shared_ptr<FuzzPointerController> mPointerController; |
Aditya Wazir | eea5be0 | 2022-10-31 12:40:10 +0530 | [diff] [blame] | 268 | std::shared_ptr<ThreadSafeFuzzedDataProvider> mFdp; |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 269 | |
| 270 | protected: |
| 271 | ~FuzzInputReaderPolicy() {} |
| 272 | |
| 273 | public: |
Aditya Wazir | eea5be0 | 2022-10-31 12:40:10 +0530 | [diff] [blame] | 274 | FuzzInputReaderPolicy(std::shared_ptr<ThreadSafeFuzzedDataProvider> mFdp) : mFdp(mFdp) { |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 275 | mPointerController = std::make_shared<FuzzPointerController>(mFdp); |
| 276 | } |
| 277 | void getReaderConfiguration(InputReaderConfiguration* outConfig) override {} |
| 278 | std::shared_ptr<PointerControllerInterface> obtainPointerController(int32_t deviceId) override { |
| 279 | return mPointerController; |
| 280 | } |
| 281 | void notifyInputDevicesChanged(const std::vector<InputDeviceInfo>& inputDevices) override {} |
| 282 | std::shared_ptr<KeyCharacterMap> getKeyboardLayoutOverlay( |
| 283 | const InputDeviceIdentifier& identifier) override { |
| 284 | return nullptr; |
| 285 | } |
| 286 | std::string getDeviceAlias(const InputDeviceIdentifier& identifier) { |
| 287 | return mFdp->ConsumeRandomLengthString(32); |
| 288 | } |
| 289 | TouchAffineTransformation getTouchAffineTransformation(const std::string& inputDeviceDescriptor, |
Michael Wright | a9cf419 | 2022-12-01 23:46:39 +0000 | [diff] [blame] | 290 | ui::Rotation surfaceRotation) override { |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 291 | return mTransform; |
| 292 | } |
| 293 | void setTouchAffineTransformation(const TouchAffineTransformation t) { mTransform = t; } |
Prabir Pradhan | da20b17 | 2022-09-26 17:01:18 +0000 | [diff] [blame] | 294 | void notifyStylusGestureStarted(int32_t, nsecs_t) {} |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 295 | }; |
| 296 | |
| 297 | class FuzzInputListener : public virtual InputListenerInterface { |
| 298 | public: |
Prabir Pradhan | e3da4bb | 2023-04-05 23:51:23 +0000 | [diff] [blame] | 299 | void notifyInputDevicesChanged(const NotifyInputDevicesChangedArgs& args) override {} |
Prabir Pradhan | c392d8f | 2023-04-13 19:32:51 +0000 | [diff] [blame] | 300 | void notifyConfigurationChanged(const NotifyConfigurationChangedArgs& args) override {} |
| 301 | void notifyKey(const NotifyKeyArgs& args) override {} |
| 302 | void notifyMotion(const NotifyMotionArgs& args) override {} |
| 303 | void notifySwitch(const NotifySwitchArgs& args) override {} |
| 304 | void notifySensor(const NotifySensorArgs& args) override{}; |
| 305 | void notifyVibratorState(const NotifyVibratorStateArgs& args) override{}; |
| 306 | void notifyDeviceReset(const NotifyDeviceResetArgs& args) override {} |
| 307 | void notifyPointerCaptureChanged(const NotifyPointerCaptureChangedArgs& args) override{}; |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 308 | }; |
| 309 | |
| 310 | class FuzzInputReaderContext : public InputReaderContext { |
| 311 | std::shared_ptr<EventHubInterface> mEventHub; |
| 312 | sp<InputReaderPolicyInterface> mPolicy; |
Aditya Wazir | eea5be0 | 2022-10-31 12:40:10 +0530 | [diff] [blame] | 313 | std::shared_ptr<ThreadSafeFuzzedDataProvider> mFdp; |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 314 | |
| 315 | public: |
| 316 | FuzzInputReaderContext(std::shared_ptr<EventHubInterface> eventHub, |
| 317 | const sp<InputReaderPolicyInterface>& policy, |
| 318 | InputListenerInterface& listener, |
Aditya Wazir | eea5be0 | 2022-10-31 12:40:10 +0530 | [diff] [blame] | 319 | std::shared_ptr<ThreadSafeFuzzedDataProvider> mFdp) |
Siarhei Vishniakou | 2935db7 | 2022-09-22 13:35:22 -0700 | [diff] [blame] | 320 | : mEventHub(eventHub), mPolicy(policy), mFdp(mFdp) {} |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 321 | ~FuzzInputReaderContext() {} |
| 322 | void updateGlobalMetaState() override {} |
| 323 | int32_t getGlobalMetaState() { return mFdp->ConsumeIntegral<int32_t>(); } |
| 324 | void disableVirtualKeysUntil(nsecs_t time) override {} |
| 325 | bool shouldDropVirtualKey(nsecs_t now, int32_t keyCode, int32_t scanCode) override { |
| 326 | return mFdp->ConsumeBool(); |
| 327 | } |
| 328 | void fadePointer() override {} |
| 329 | std::shared_ptr<PointerControllerInterface> getPointerController(int32_t deviceId) override { |
| 330 | return mPolicy->obtainPointerController(0); |
| 331 | } |
| 332 | void requestTimeoutAtTime(nsecs_t when) override {} |
| 333 | int32_t bumpGeneration() override { return mFdp->ConsumeIntegral<int32_t>(); } |
| 334 | void getExternalStylusDevices(std::vector<InputDeviceInfo>& outDevices) override {} |
Siarhei Vishniakou | 2935db7 | 2022-09-22 13:35:22 -0700 | [diff] [blame] | 335 | std::list<NotifyArgs> dispatchExternalStylusState(const StylusState& outState) override { |
| 336 | return {}; |
| 337 | } |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 338 | InputReaderPolicyInterface* getPolicy() override { return mPolicy.get(); } |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 339 | EventHubInterface* getEventHub() override { return mEventHub.get(); } |
| 340 | int32_t getNextId() override { return mFdp->ConsumeIntegral<int32_t>(); } |
| 341 | |
| 342 | void updateLedMetaState(int32_t metaState) override{}; |
| 343 | int32_t getLedMetaState() override { return mFdp->ConsumeIntegral<int32_t>(); }; |
Prabir Pradhan | da20b17 | 2022-09-26 17:01:18 +0000 | [diff] [blame] | 344 | void notifyStylusGestureStarted(int32_t, nsecs_t) {} |
Michael Ensing | b8d9326 | 2020-05-12 00:41:30 -0700 | [diff] [blame] | 345 | }; |
| 346 | |
| 347 | } // namespace android |