Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2023 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 | #define LOG_TAG "PointerChoreographer" |
| 18 | |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 19 | #include <android-base/logging.h> |
| 20 | #include <input/PrintTools.h> |
| 21 | |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 22 | #include "PointerChoreographer.h" |
| 23 | |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 24 | #define INDENT " " |
| 25 | |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 26 | namespace android { |
| 27 | |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 28 | namespace { |
| 29 | bool isFromMouse(const NotifyMotionArgs& args) { |
| 30 | return isFromSource(args.source, AINPUT_SOURCE_MOUSE) && |
| 31 | args.pointerProperties[0].toolType == ToolType::MOUSE; |
| 32 | } |
| 33 | |
| 34 | } // namespace |
| 35 | |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 36 | // --- PointerChoreographer --- |
| 37 | |
| 38 | PointerChoreographer::PointerChoreographer(InputListenerInterface& listener, |
| 39 | PointerChoreographerPolicyInterface& policy) |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 40 | : mNextListener(listener), |
| 41 | mPolicy(policy), |
| 42 | mDefaultMouseDisplayId(ADISPLAY_ID_DEFAULT), |
Byoungho Jung | 6f5b16b | 2023-10-27 18:22:07 +0900 | [diff] [blame^] | 43 | mNotifiedPointerDisplayId(ADISPLAY_ID_NONE), |
| 44 | mShowTouchesEnabled(false) {} |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 45 | |
| 46 | void PointerChoreographer::notifyInputDevicesChanged(const NotifyInputDevicesChangedArgs& args) { |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 47 | std::scoped_lock _l(mLock); |
| 48 | |
| 49 | mInputDeviceInfos = args.inputDeviceInfos; |
| 50 | updatePointerControllersLocked(); |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 51 | mNextListener.notify(args); |
| 52 | } |
| 53 | |
| 54 | void PointerChoreographer::notifyConfigurationChanged(const NotifyConfigurationChangedArgs& args) { |
| 55 | mNextListener.notify(args); |
| 56 | } |
| 57 | |
| 58 | void PointerChoreographer::notifyKey(const NotifyKeyArgs& args) { |
| 59 | mNextListener.notify(args); |
| 60 | } |
| 61 | |
| 62 | void PointerChoreographer::notifyMotion(const NotifyMotionArgs& args) { |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 63 | NotifyMotionArgs newArgs = processMotion(args); |
| 64 | |
| 65 | mNextListener.notify(newArgs); |
| 66 | } |
| 67 | |
| 68 | NotifyMotionArgs PointerChoreographer::processMotion(const NotifyMotionArgs& args) { |
| 69 | std::scoped_lock _l(mLock); |
| 70 | |
| 71 | if (isFromMouse(args)) { |
| 72 | return processMouseEventLocked(args); |
| 73 | } else if (isFromSource(args.source, AINPUT_SOURCE_TOUCHSCREEN)) { |
Byoungho Jung | 6f5b16b | 2023-10-27 18:22:07 +0900 | [diff] [blame^] | 74 | processTouchscreenAndStylusEventLocked(args); |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 75 | } |
| 76 | return args; |
| 77 | } |
| 78 | |
| 79 | NotifyMotionArgs PointerChoreographer::processMouseEventLocked(const NotifyMotionArgs& args) { |
| 80 | if (args.getPointerCount() != 1) { |
Prabir Pradhan | 1976760 | 2023-11-03 16:53:31 +0000 | [diff] [blame] | 81 | LOG(FATAL) << "Only mouse events with a single pointer are currently supported: " |
| 82 | << args.dump(); |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | const int32_t displayId = getTargetMouseDisplayLocked(args.displayId); |
Prabir Pradhan | 1976760 | 2023-11-03 16:53:31 +0000 | [diff] [blame] | 86 | |
| 87 | // Get the mouse pointer controller for the display, or create one if it doesn't exist. |
| 88 | auto [it, emplaced] = |
| 89 | mMousePointersByDisplay.try_emplace(displayId, |
| 90 | getMouseControllerConstructor(displayId)); |
| 91 | if (emplaced) { |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 92 | notifyPointerDisplayIdChangedLocked(); |
| 93 | } |
| 94 | |
| 95 | PointerControllerInterface& pc = *it->second; |
| 96 | |
| 97 | const float deltaX = args.pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_RELATIVE_X); |
| 98 | const float deltaY = args.pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_RELATIVE_Y); |
| 99 | pc.move(deltaX, deltaY); |
| 100 | pc.unfade(PointerControllerInterface::Transition::IMMEDIATE); |
| 101 | |
| 102 | const auto [x, y] = pc.getPosition(); |
| 103 | NotifyMotionArgs newArgs(args); |
| 104 | newArgs.pointerCoords[0].setAxisValue(AMOTION_EVENT_AXIS_X, x); |
| 105 | newArgs.pointerCoords[0].setAxisValue(AMOTION_EVENT_AXIS_Y, y); |
| 106 | newArgs.xCursorPosition = x; |
| 107 | newArgs.yCursorPosition = y; |
| 108 | newArgs.displayId = displayId; |
| 109 | return newArgs; |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * When screen is touched, fade the mouse pointer on that display. We only call fade for |
| 114 | * ACTION_DOWN events.This would allow both mouse and touch to be used at the same time if the |
| 115 | * mouse device keeps moving and unfades the cursor. |
| 116 | * For touch events, we do not need to populate the cursor position. |
| 117 | */ |
Byoungho Jung | 6f5b16b | 2023-10-27 18:22:07 +0900 | [diff] [blame^] | 118 | void PointerChoreographer::processTouchscreenAndStylusEventLocked(const NotifyMotionArgs& args) { |
| 119 | if (args.displayId == ADISPLAY_ID_NONE) { |
| 120 | return; |
| 121 | } |
| 122 | |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 123 | if (const auto it = mMousePointersByDisplay.find(args.displayId); |
| 124 | it != mMousePointersByDisplay.end() && args.action == AMOTION_EVENT_ACTION_DOWN) { |
| 125 | it->second->fade(PointerControllerInterface::Transition::GRADUAL); |
| 126 | } |
Byoungho Jung | 6f5b16b | 2023-10-27 18:22:07 +0900 | [diff] [blame^] | 127 | |
| 128 | if (!mShowTouchesEnabled) { |
| 129 | return; |
| 130 | } |
| 131 | |
| 132 | // Get the touch pointer controller for the device, or create one if it doesn't exist. |
| 133 | auto [it, _] = |
| 134 | mTouchPointersByDevice.try_emplace(args.deviceId, getTouchControllerConstructor()); |
| 135 | |
| 136 | PointerControllerInterface& pc = *it->second; |
| 137 | |
| 138 | const PointerCoords* coords = args.pointerCoords.data(); |
| 139 | const int32_t maskedAction = MotionEvent::getActionMasked(args.action); |
| 140 | const uint8_t actionIndex = MotionEvent::getActionIndex(args.action); |
| 141 | std::array<uint32_t, MAX_POINTER_ID + 1> idToIndex; |
| 142 | BitSet32 idBits; |
| 143 | if (maskedAction != AMOTION_EVENT_ACTION_UP && maskedAction != AMOTION_EVENT_ACTION_CANCEL) { |
| 144 | for (size_t i = 0; i < args.getPointerCount(); i++) { |
| 145 | if (maskedAction == AMOTION_EVENT_ACTION_POINTER_UP && actionIndex == i) { |
| 146 | continue; |
| 147 | } |
| 148 | uint32_t id = args.pointerProperties[i].id; |
| 149 | idToIndex[id] = i; |
| 150 | idBits.markBit(id); |
| 151 | } |
| 152 | } |
| 153 | // The PointerController already handles setting spots per-display, so |
| 154 | // we do not need to manually manage display changes for touch spots for now. |
| 155 | pc.setSpots(coords, idToIndex.cbegin(), idBits, args.displayId); |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 156 | } |
| 157 | |
| 158 | void PointerChoreographer::notifySwitch(const NotifySwitchArgs& args) { |
| 159 | mNextListener.notify(args); |
| 160 | } |
| 161 | |
| 162 | void PointerChoreographer::notifySensor(const NotifySensorArgs& args) { |
| 163 | mNextListener.notify(args); |
| 164 | } |
| 165 | |
| 166 | void PointerChoreographer::notifyVibratorState(const NotifyVibratorStateArgs& args) { |
| 167 | mNextListener.notify(args); |
| 168 | } |
| 169 | |
| 170 | void PointerChoreographer::notifyDeviceReset(const NotifyDeviceResetArgs& args) { |
Byoungho Jung | 6f5b16b | 2023-10-27 18:22:07 +0900 | [diff] [blame^] | 171 | processDeviceReset(args); |
| 172 | |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 173 | mNextListener.notify(args); |
| 174 | } |
| 175 | |
Byoungho Jung | 6f5b16b | 2023-10-27 18:22:07 +0900 | [diff] [blame^] | 176 | void PointerChoreographer::processDeviceReset(const NotifyDeviceResetArgs& args) { |
| 177 | std::scoped_lock _l(mLock); |
| 178 | |
| 179 | const InputDeviceInfo* info = findInputDeviceLocked(args.deviceId); |
| 180 | if (info == nullptr) { |
| 181 | return; |
| 182 | } |
| 183 | |
| 184 | if (isFromSource(info->getSources(), AINPUT_SOURCE_TOUCHSCREEN) && mShowTouchesEnabled && |
| 185 | info->getAssociatedDisplayId() != ADISPLAY_ID_NONE) { |
| 186 | if (const auto it = mTouchPointersByDevice.find(args.deviceId); |
| 187 | it != mTouchPointersByDevice.end()) { |
| 188 | it->second->clearSpots(); |
| 189 | } |
| 190 | } |
| 191 | } |
| 192 | |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 193 | void PointerChoreographer::notifyPointerCaptureChanged( |
| 194 | const NotifyPointerCaptureChangedArgs& args) { |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 195 | if (args.request.enable) { |
| 196 | std::scoped_lock _l(mLock); |
| 197 | for (const auto& [_, mousePointerController] : mMousePointersByDisplay) { |
| 198 | mousePointerController->fade(PointerControllerInterface::Transition::IMMEDIATE); |
| 199 | } |
| 200 | } |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 201 | mNextListener.notify(args); |
| 202 | } |
| 203 | |
| 204 | void PointerChoreographer::dump(std::string& dump) { |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 205 | std::scoped_lock _l(mLock); |
| 206 | |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 207 | dump += "PointerChoreographer:\n"; |
Byoungho Jung | 6f5b16b | 2023-10-27 18:22:07 +0900 | [diff] [blame^] | 208 | dump += StringPrintf("show touches: %s\n", mShowTouchesEnabled ? "true" : "false"); |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 209 | |
| 210 | dump += INDENT "MousePointerControllers:\n"; |
| 211 | for (const auto& [displayId, mousePointerController] : mMousePointersByDisplay) { |
| 212 | std::string pointerControllerDump = addLinePrefix(mousePointerController->dump(), INDENT); |
| 213 | dump += INDENT + std::to_string(displayId) + " : " + pointerControllerDump; |
| 214 | } |
Byoungho Jung | 6f5b16b | 2023-10-27 18:22:07 +0900 | [diff] [blame^] | 215 | dump += INDENT "TouchPointerControllers:\n"; |
| 216 | for (const auto& [deviceId, touchPointerController] : mTouchPointersByDevice) { |
| 217 | std::string pointerControllerDump = addLinePrefix(touchPointerController->dump(), INDENT); |
| 218 | dump += INDENT + std::to_string(deviceId) + " : " + pointerControllerDump; |
| 219 | } |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 220 | dump += "\n"; |
| 221 | } |
| 222 | |
| 223 | const DisplayViewport* PointerChoreographer::findViewportByIdLocked(int32_t displayId) const { |
| 224 | for (auto& viewport : mViewports) { |
| 225 | if (viewport.displayId == displayId) { |
| 226 | return &viewport; |
| 227 | } |
| 228 | } |
| 229 | return nullptr; |
| 230 | } |
| 231 | |
| 232 | int32_t PointerChoreographer::getTargetMouseDisplayLocked(int32_t associatedDisplayId) const { |
| 233 | return associatedDisplayId == ADISPLAY_ID_NONE ? mDefaultMouseDisplayId : associatedDisplayId; |
| 234 | } |
| 235 | |
Byoungho Jung | 6f5b16b | 2023-10-27 18:22:07 +0900 | [diff] [blame^] | 236 | InputDeviceInfo* PointerChoreographer::findInputDeviceLocked(DeviceId deviceId) { |
| 237 | for (auto& info : mInputDeviceInfos) { |
| 238 | if (info.getId() == deviceId) { |
| 239 | return &info; |
| 240 | } |
| 241 | } |
| 242 | return nullptr; |
| 243 | } |
| 244 | |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 245 | void PointerChoreographer::updatePointerControllersLocked() { |
| 246 | std::set<int32_t /*displayId*/> mouseDisplaysToKeep; |
Byoungho Jung | 6f5b16b | 2023-10-27 18:22:07 +0900 | [diff] [blame^] | 247 | std::set<DeviceId> touchDevicesToKeep; |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 248 | |
| 249 | // Mark the displayIds or deviceIds of PointerControllers currently needed. |
| 250 | for (const auto& info : mInputDeviceInfos) { |
| 251 | const uint32_t sources = info.getSources(); |
| 252 | if (isFromSource(sources, AINPUT_SOURCE_MOUSE) || |
| 253 | isFromSource(sources, AINPUT_SOURCE_MOUSE_RELATIVE)) { |
| 254 | const int32_t resolvedDisplayId = |
| 255 | getTargetMouseDisplayLocked(info.getAssociatedDisplayId()); |
| 256 | mouseDisplaysToKeep.insert(resolvedDisplayId); |
| 257 | } |
Byoungho Jung | 6f5b16b | 2023-10-27 18:22:07 +0900 | [diff] [blame^] | 258 | if (isFromSource(sources, AINPUT_SOURCE_TOUCHSCREEN) && mShowTouchesEnabled && |
| 259 | info.getAssociatedDisplayId() != ADISPLAY_ID_NONE) { |
| 260 | touchDevicesToKeep.insert(info.getId()); |
| 261 | } |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | // Remove PointerControllers no longer needed. |
| 265 | // This has the side-effect of fading pointers or clearing spots before removal. |
Prabir Pradhan | 1976760 | 2023-11-03 16:53:31 +0000 | [diff] [blame] | 266 | std::erase_if(mMousePointersByDisplay, [&mouseDisplaysToKeep](const auto& pair) { |
| 267 | auto& [displayId, controller] = pair; |
| 268 | if (mouseDisplaysToKeep.find(displayId) == mouseDisplaysToKeep.end()) { |
| 269 | controller->fade(PointerControllerInterface::Transition::IMMEDIATE); |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 270 | return true; |
| 271 | } |
| 272 | return false; |
| 273 | }); |
Byoungho Jung | 6f5b16b | 2023-10-27 18:22:07 +0900 | [diff] [blame^] | 274 | std::erase_if(mTouchPointersByDevice, [&touchDevicesToKeep](const auto& pair) { |
| 275 | auto& [deviceId, controller] = pair; |
| 276 | if (touchDevicesToKeep.find(deviceId) == touchDevicesToKeep.end()) { |
| 277 | controller->clearSpots(); |
| 278 | return true; |
| 279 | } |
| 280 | return false; |
| 281 | }); |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 282 | |
| 283 | // Notify the policy if there's a change on the pointer display ID. |
| 284 | notifyPointerDisplayIdChangedLocked(); |
| 285 | } |
| 286 | |
| 287 | void PointerChoreographer::notifyPointerDisplayIdChangedLocked() { |
| 288 | int32_t displayIdToNotify = ADISPLAY_ID_NONE; |
| 289 | FloatPoint cursorPosition = {0, 0}; |
| 290 | if (const auto it = mMousePointersByDisplay.find(mDefaultMouseDisplayId); |
| 291 | it != mMousePointersByDisplay.end()) { |
Prabir Pradhan | 1976760 | 2023-11-03 16:53:31 +0000 | [diff] [blame] | 292 | const auto& pointerController = it->second; |
| 293 | // Use the displayId from the pointerController, because it accurately reflects whether |
| 294 | // the viewport has been added for that display. Otherwise, we would have to check if |
| 295 | // the viewport exists separately. |
| 296 | displayIdToNotify = pointerController->getDisplayId(); |
| 297 | cursorPosition = pointerController->getPosition(); |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 298 | } |
| 299 | |
| 300 | if (mNotifiedPointerDisplayId == displayIdToNotify) { |
| 301 | return; |
| 302 | } |
| 303 | mPolicy.notifyPointerDisplayIdChanged(displayIdToNotify, cursorPosition); |
| 304 | mNotifiedPointerDisplayId = displayIdToNotify; |
| 305 | } |
| 306 | |
| 307 | void PointerChoreographer::setDefaultMouseDisplayId(int32_t displayId) { |
| 308 | std::scoped_lock _l(mLock); |
| 309 | |
| 310 | mDefaultMouseDisplayId = displayId; |
| 311 | updatePointerControllersLocked(); |
| 312 | } |
| 313 | |
| 314 | void PointerChoreographer::setDisplayViewports(const std::vector<DisplayViewport>& viewports) { |
| 315 | std::scoped_lock _l(mLock); |
| 316 | for (const auto& viewport : viewports) { |
Prabir Pradhan | 1976760 | 2023-11-03 16:53:31 +0000 | [diff] [blame] | 317 | if (const auto it = mMousePointersByDisplay.find(viewport.displayId); |
Byoungho Jung | da10dd3 | 2023-10-06 17:03:45 +0900 | [diff] [blame] | 318 | it != mMousePointersByDisplay.end()) { |
| 319 | it->second->setDisplayViewport(viewport); |
| 320 | } |
| 321 | } |
| 322 | mViewports = viewports; |
| 323 | notifyPointerDisplayIdChangedLocked(); |
| 324 | } |
| 325 | |
| 326 | std::optional<DisplayViewport> PointerChoreographer::getViewportForPointerDevice( |
| 327 | int32_t associatedDisplayId) { |
| 328 | std::scoped_lock _l(mLock); |
| 329 | const int32_t resolvedDisplayId = getTargetMouseDisplayLocked(associatedDisplayId); |
| 330 | if (const auto viewport = findViewportByIdLocked(resolvedDisplayId); viewport) { |
| 331 | return *viewport; |
| 332 | } |
| 333 | return std::nullopt; |
| 334 | } |
| 335 | |
| 336 | FloatPoint PointerChoreographer::getMouseCursorPosition(int32_t displayId) { |
| 337 | std::scoped_lock _l(mLock); |
| 338 | const int32_t resolvedDisplayId = getTargetMouseDisplayLocked(displayId); |
| 339 | if (auto it = mMousePointersByDisplay.find(resolvedDisplayId); |
| 340 | it != mMousePointersByDisplay.end()) { |
| 341 | return it->second->getPosition(); |
| 342 | } |
| 343 | return {AMOTION_EVENT_INVALID_CURSOR_POSITION, AMOTION_EVENT_INVALID_CURSOR_POSITION}; |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 344 | } |
| 345 | |
Byoungho Jung | 6f5b16b | 2023-10-27 18:22:07 +0900 | [diff] [blame^] | 346 | void PointerChoreographer::setShowTouchesEnabled(bool enabled) { |
| 347 | std::scoped_lock _l(mLock); |
| 348 | if (mShowTouchesEnabled == enabled) { |
| 349 | return; |
| 350 | } |
| 351 | mShowTouchesEnabled = enabled; |
| 352 | updatePointerControllersLocked(); |
| 353 | } |
| 354 | |
Prabir Pradhan | 1976760 | 2023-11-03 16:53:31 +0000 | [diff] [blame] | 355 | PointerChoreographer::ControllerConstructor PointerChoreographer::getMouseControllerConstructor( |
| 356 | int32_t displayId) { |
| 357 | std::function<std::shared_ptr<PointerControllerInterface>()> ctor = |
| 358 | [this, displayId]() REQUIRES(mLock) { |
| 359 | auto pc = mPolicy.createPointerController( |
| 360 | PointerControllerInterface::ControllerType::MOUSE); |
| 361 | if (const auto viewport = findViewportByIdLocked(displayId); viewport) { |
| 362 | pc->setDisplayViewport(*viewport); |
| 363 | } |
| 364 | return pc; |
| 365 | }; |
| 366 | return ConstructorDelegate(std::move(ctor)); |
| 367 | } |
| 368 | |
Byoungho Jung | 6f5b16b | 2023-10-27 18:22:07 +0900 | [diff] [blame^] | 369 | PointerChoreographer::ControllerConstructor PointerChoreographer::getTouchControllerConstructor() { |
| 370 | std::function<std::shared_ptr<PointerControllerInterface>()> ctor = [this]() REQUIRES(mLock) { |
| 371 | return mPolicy.createPointerController(PointerControllerInterface::ControllerType::TOUCH); |
| 372 | }; |
| 373 | return ConstructorDelegate(std::move(ctor)); |
| 374 | } |
| 375 | |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 376 | } // namespace android |