Loading services/inputflinger/reader/mapper/TouchpadInputMapper.cpp +5 −40 Original line number Diff line number Diff line Loading @@ -47,8 +47,6 @@ namespace android { namespace { static const bool ENABLE_POINTER_CHOREOGRAPHER = input_flags::enable_pointer_choreographer(); /** * Log details of each gesture output by the gestures library. * Enable this via "adb shell setprop log.tag.TouchpadInputMapperGestures DEBUG" (requires Loading Loading @@ -237,20 +235,13 @@ private: TouchpadInputMapper::TouchpadInputMapper(InputDeviceContext& deviceContext, const InputReaderConfiguration& readerConfig) : TouchpadInputMapper(deviceContext, readerConfig, ENABLE_POINTER_CHOREOGRAPHER) {} TouchpadInputMapper::TouchpadInputMapper(InputDeviceContext& deviceContext, const InputReaderConfiguration& readerConfig, bool enablePointerChoreographer) : InputMapper(deviceContext, readerConfig), mGestureInterpreter(NewGestureInterpreter(), DeleteGestureInterpreter), mPointerController(getContext()->getPointerController(getDeviceId())), mTimerProvider(*getContext()), mStateConverter(deviceContext, mMotionAccumulator), mGestureConverter(*getContext(), deviceContext, getDeviceId()), mCapturedEventConverter(*getContext(), deviceContext, mMotionAccumulator, getDeviceId()), mMetricsId(metricsIdFromInputDeviceIdentifier(deviceContext.getDeviceIdentifier())), mEnablePointerChoreographer(enablePointerChoreographer) { mMetricsId(metricsIdFromInputDeviceIdentifier(deviceContext.getDeviceIdentifier())) { RawAbsoluteAxisInfo slotAxisInfo; deviceContext.getAbsoluteAxisInfo(ABS_MT_SLOT, &slotAxisInfo); if (!slotAxisInfo.valid || slotAxisInfo.maxValue <= 0) { Loading @@ -277,10 +268,6 @@ TouchpadInputMapper::TouchpadInputMapper(InputDeviceContext& deviceContext, } TouchpadInputMapper::~TouchpadInputMapper() { if (mPointerController != nullptr) { mPointerController->fade(PointerControllerInterface::Transition::IMMEDIATE); } // The gesture interpreter's destructor will try to free its property and timer providers, // calling PropertyProvider::freeProperty and TimerProvider::freeTimer using a raw pointers. // Depending on the declaration order in TouchpadInputMapper.h, those providers may have already Loading Loading @@ -342,33 +329,12 @@ std::list<NotifyArgs> TouchpadInputMapper::reconfigure(nsecs_t when, // Only generate events for the associated display. mDisplayId = assocViewport->displayId; resolvedViewport = *assocViewport; if (!mEnablePointerChoreographer) { const bool mismatchedPointerDisplay = (assocViewport->displayId != mPointerController->getDisplayId()); if (mismatchedPointerDisplay) { ALOGW("Touchpad \"%s\" associated viewport display does not match pointer " "controller", mDeviceContext.getName().c_str()); mDisplayId.reset(); } } } else { // The InputDevice is not associated with a viewport, but it controls the mouse pointer. if (mEnablePointerChoreographer) { // Always use DISPLAY_ID_NONE for touchpad events. // PointerChoreographer will make it target the correct the displayId later. resolvedViewport = getContext()->getPolicy()->getPointerViewportForAssociatedDisplay(); resolvedViewport = getContext()->getPolicy()->getPointerViewportForAssociatedDisplay(); mDisplayId = resolvedViewport ? std::make_optional(ADISPLAY_ID_NONE) : std::nullopt; } else { mDisplayId = mPointerController->getDisplayId(); if (auto v = config.getDisplayViewportById(*mDisplayId); v) { resolvedViewport = *v; } if (auto bounds = mPointerController->getBounds(); bounds) { boundsInLogicalDisplay = *bounds; } } } mGestureConverter.setDisplayId(mDisplayId); Loading Loading @@ -422,7 +388,6 @@ std::list<NotifyArgs> TouchpadInputMapper::reconfigure(nsecs_t when, // The touchpad is being captured, so we need to tidy up any fake fingers etc. that are // still being reported for a gesture in progress. out += reset(when); mPointerController->fade(PointerControllerInterface::Transition::IMMEDIATE); } else { // We're transitioning from captured to uncaptured. mCapturedEventConverter.reset(); Loading services/inputflinger/reader/mapper/TouchpadInputMapper.h +0 −7 Original line number Diff line number Diff line Loading @@ -72,10 +72,6 @@ private: void resetGestureInterpreter(nsecs_t when); explicit TouchpadInputMapper(InputDeviceContext& deviceContext, const InputReaderConfiguration& readerConfig); // Constructor for testing. explicit TouchpadInputMapper(InputDeviceContext& deviceContext, const InputReaderConfiguration& readerConfig, bool enablePointerChoreographer); void updatePalmDetectionMetrics(); [[nodiscard]] std::list<NotifyArgs> sendHardwareState(nsecs_t when, nsecs_t readTime, SelfContainedHardwareState schs); Loading @@ -83,7 +79,6 @@ private: std::unique_ptr<gestures::GestureInterpreter, void (*)(gestures::GestureInterpreter*)> mGestureInterpreter; std::shared_ptr<PointerControllerInterface> mPointerController; PropertyProvider mPropertyProvider; TimerProvider mTimerProvider; Loading Loading @@ -111,8 +106,6 @@ private: // Tracking IDs for touches that have at some point been reported as palms by the touchpad. std::set<int32_t> mPalmTrackingIds; const bool mEnablePointerChoreographer; // The display that events generated by this mapper should target. This can be set to // ADISPLAY_ID_NONE to target the focused display. If there is no display target (i.e. // std::nullopt), all events will be ignored. Loading Loading
services/inputflinger/reader/mapper/TouchpadInputMapper.cpp +5 −40 Original line number Diff line number Diff line Loading @@ -47,8 +47,6 @@ namespace android { namespace { static const bool ENABLE_POINTER_CHOREOGRAPHER = input_flags::enable_pointer_choreographer(); /** * Log details of each gesture output by the gestures library. * Enable this via "adb shell setprop log.tag.TouchpadInputMapperGestures DEBUG" (requires Loading Loading @@ -237,20 +235,13 @@ private: TouchpadInputMapper::TouchpadInputMapper(InputDeviceContext& deviceContext, const InputReaderConfiguration& readerConfig) : TouchpadInputMapper(deviceContext, readerConfig, ENABLE_POINTER_CHOREOGRAPHER) {} TouchpadInputMapper::TouchpadInputMapper(InputDeviceContext& deviceContext, const InputReaderConfiguration& readerConfig, bool enablePointerChoreographer) : InputMapper(deviceContext, readerConfig), mGestureInterpreter(NewGestureInterpreter(), DeleteGestureInterpreter), mPointerController(getContext()->getPointerController(getDeviceId())), mTimerProvider(*getContext()), mStateConverter(deviceContext, mMotionAccumulator), mGestureConverter(*getContext(), deviceContext, getDeviceId()), mCapturedEventConverter(*getContext(), deviceContext, mMotionAccumulator, getDeviceId()), mMetricsId(metricsIdFromInputDeviceIdentifier(deviceContext.getDeviceIdentifier())), mEnablePointerChoreographer(enablePointerChoreographer) { mMetricsId(metricsIdFromInputDeviceIdentifier(deviceContext.getDeviceIdentifier())) { RawAbsoluteAxisInfo slotAxisInfo; deviceContext.getAbsoluteAxisInfo(ABS_MT_SLOT, &slotAxisInfo); if (!slotAxisInfo.valid || slotAxisInfo.maxValue <= 0) { Loading @@ -277,10 +268,6 @@ TouchpadInputMapper::TouchpadInputMapper(InputDeviceContext& deviceContext, } TouchpadInputMapper::~TouchpadInputMapper() { if (mPointerController != nullptr) { mPointerController->fade(PointerControllerInterface::Transition::IMMEDIATE); } // The gesture interpreter's destructor will try to free its property and timer providers, // calling PropertyProvider::freeProperty and TimerProvider::freeTimer using a raw pointers. // Depending on the declaration order in TouchpadInputMapper.h, those providers may have already Loading Loading @@ -342,33 +329,12 @@ std::list<NotifyArgs> TouchpadInputMapper::reconfigure(nsecs_t when, // Only generate events for the associated display. mDisplayId = assocViewport->displayId; resolvedViewport = *assocViewport; if (!mEnablePointerChoreographer) { const bool mismatchedPointerDisplay = (assocViewport->displayId != mPointerController->getDisplayId()); if (mismatchedPointerDisplay) { ALOGW("Touchpad \"%s\" associated viewport display does not match pointer " "controller", mDeviceContext.getName().c_str()); mDisplayId.reset(); } } } else { // The InputDevice is not associated with a viewport, but it controls the mouse pointer. if (mEnablePointerChoreographer) { // Always use DISPLAY_ID_NONE for touchpad events. // PointerChoreographer will make it target the correct the displayId later. resolvedViewport = getContext()->getPolicy()->getPointerViewportForAssociatedDisplay(); resolvedViewport = getContext()->getPolicy()->getPointerViewportForAssociatedDisplay(); mDisplayId = resolvedViewport ? std::make_optional(ADISPLAY_ID_NONE) : std::nullopt; } else { mDisplayId = mPointerController->getDisplayId(); if (auto v = config.getDisplayViewportById(*mDisplayId); v) { resolvedViewport = *v; } if (auto bounds = mPointerController->getBounds(); bounds) { boundsInLogicalDisplay = *bounds; } } } mGestureConverter.setDisplayId(mDisplayId); Loading Loading @@ -422,7 +388,6 @@ std::list<NotifyArgs> TouchpadInputMapper::reconfigure(nsecs_t when, // The touchpad is being captured, so we need to tidy up any fake fingers etc. that are // still being reported for a gesture in progress. out += reset(when); mPointerController->fade(PointerControllerInterface::Transition::IMMEDIATE); } else { // We're transitioning from captured to uncaptured. mCapturedEventConverter.reset(); Loading
services/inputflinger/reader/mapper/TouchpadInputMapper.h +0 −7 Original line number Diff line number Diff line Loading @@ -72,10 +72,6 @@ private: void resetGestureInterpreter(nsecs_t when); explicit TouchpadInputMapper(InputDeviceContext& deviceContext, const InputReaderConfiguration& readerConfig); // Constructor for testing. explicit TouchpadInputMapper(InputDeviceContext& deviceContext, const InputReaderConfiguration& readerConfig, bool enablePointerChoreographer); void updatePalmDetectionMetrics(); [[nodiscard]] std::list<NotifyArgs> sendHardwareState(nsecs_t when, nsecs_t readTime, SelfContainedHardwareState schs); Loading @@ -83,7 +79,6 @@ private: std::unique_ptr<gestures::GestureInterpreter, void (*)(gestures::GestureInterpreter*)> mGestureInterpreter; std::shared_ptr<PointerControllerInterface> mPointerController; PropertyProvider mPropertyProvider; TimerProvider mTimerProvider; Loading Loading @@ -111,8 +106,6 @@ private: // Tracking IDs for touches that have at some point been reported as palms by the touchpad. std::set<int32_t> mPalmTrackingIds; const bool mEnablePointerChoreographer; // The display that events generated by this mapper should target. This can be set to // ADISPLAY_ID_NONE to target the focused display. If there is no display target (i.e. // std::nullopt), all events will be ignored. Loading