diff options
Diffstat (limited to 'services/inputflinger/InputManager.cpp')
| -rw-r--r-- | services/inputflinger/InputManager.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/services/inputflinger/InputManager.cpp b/services/inputflinger/InputManager.cpp index 0733a1c7c6..0567a32550 100644 --- a/services/inputflinger/InputManager.cpp +++ b/services/inputflinger/InputManager.cpp @@ -38,6 +38,9 @@ namespace { const bool ENABLE_INPUT_DEVICE_USAGE_METRICS = sysprop::InputProperties::enable_input_device_usage_metrics().value_or(true); +const bool ENABLE_POINTER_CHOREOGRAPHER = + sysprop::InputProperties::enable_pointer_choreographer().value_or(false); + int32_t exceptionCodeFromStatusT(status_t status) { switch (status) { case OK: @@ -113,12 +116,14 @@ std::shared_ptr<IInputFlingerRust> createInputFlingerRust() { * The event flow is via the "InputListener" interface, as follows: * InputReader * -> UnwantedInteractionBlocker + * -> PointerChoreographer * -> InputProcessor * -> InputDeviceMetricsCollector * -> InputDispatcher */ InputManager::InputManager(const sp<InputReaderPolicyInterface>& readerPolicy, - InputDispatcherPolicyInterface& dispatcherPolicy) { + InputDispatcherPolicyInterface& dispatcherPolicy, + PointerChoreographerPolicyInterface& choreographerPolicy) { mInputFlingerRust = createInputFlingerRust(); mDispatcher = createInputDispatcher(dispatcherPolicy); @@ -135,6 +140,13 @@ InputManager::InputManager(const sp<InputReaderPolicyInterface>& readerPolicy, mTracingStages.emplace_back( std::make_unique<TracedInputListener>("InputProcessor", *mProcessor)); + if (ENABLE_POINTER_CHOREOGRAPHER) { + mChoreographer = + std::make_unique<PointerChoreographer>(*mTracingStages.back(), choreographerPolicy); + mTracingStages.emplace_back( + std::make_unique<TracedInputListener>("PointerChoreographer", *mChoreographer)); + } + mBlocker = std::make_unique<UnwantedInteractionBlocker>(*mTracingStages.back()); mTracingStages.emplace_back( std::make_unique<TracedInputListener>("UnwantedInteractionBlocker", *mBlocker)); @@ -186,6 +198,10 @@ InputReaderInterface& InputManager::getReader() { return *mReader; } +PointerChoreographerInterface& InputManager::getChoreographer() { + return *mChoreographer; +} + InputProcessorInterface& InputManager::getProcessor() { return *mProcessor; } @@ -210,6 +226,10 @@ void InputManager::dump(std::string& dump) { dump += '\n'; mBlocker->dump(dump); dump += '\n'; + if (ENABLE_POINTER_CHOREOGRAPHER) { + mChoreographer->dump(dump); + dump += '\n'; + } mProcessor->dump(dump); dump += '\n'; if (ENABLE_INPUT_DEVICE_USAGE_METRICS) { |