Loading services/inputflinger/include/InputReaderBase.h +0 −11 Original line number Diff line number Diff line Loading @@ -61,9 +61,6 @@ struct InputReaderConfiguration { // The display size or orientation changed. DISPLAY_INFO = 1u << 2, // The visible touches option changed. SHOW_TOUCHES = 1u << 3, // The keyboard layouts must be reloaded. KEYBOARD_LAYOUTS = 1u << 4, Loading Loading @@ -214,9 +211,6 @@ struct InputReaderConfiguration { // will cover this portion of the display diagonal. float pointerGestureZoomSpeedRatio; // True to show the location of touches on the touch screen as spots. bool showTouches; // The latest request to enable or disable Pointer Capture. PointerCaptureRequest pointerCaptureRequest; Loading Loading @@ -268,7 +262,6 @@ struct InputReaderConfiguration { pointerGestureSwipeMaxWidthRatio(0.25f), pointerGestureMovementSpeedRatio(0.8f), pointerGestureZoomSpeedRatio(0.3f), showTouches(false), pointerCaptureRequest(), touchpadPointerSpeed(0), touchpadNaturalScrollingEnabled(true), Loading Loading @@ -449,10 +442,6 @@ public: /* Gets the input reader configuration. */ virtual void getReaderConfiguration(InputReaderConfiguration* outConfig) = 0; /* Gets a pointer controller associated with the specified cursor device (ie. a mouse). */ virtual std::shared_ptr<PointerControllerInterface> obtainPointerController( int32_t deviceId) = 0; /* Notifies the input reader policy that some input devices have changed * and provides information about all current input devices. */ Loading services/inputflinger/reader/InputReader.cpp +0 −56 Original line number Diff line number Diff line Loading @@ -402,10 +402,6 @@ void InputReader::refreshConfigurationLocked(ConfigurationChanges changes) { ALOGI("Reconfiguring input devices, changes=%s", changes.string().c_str()); nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); if (changes.test(Change::DISPLAY_INFO)) { updatePointerDisplayLocked(); } if (changes.test(Change::MUST_REOPEN)) { mEventHub->requestReopenDevices(); } else { Loading Loading @@ -490,47 +486,6 @@ bool InputReader::shouldDropVirtualKeyLocked(nsecs_t now, int32_t keyCode, int32 } } std::shared_ptr<PointerControllerInterface> InputReader::getPointerControllerLocked( int32_t deviceId) { std::shared_ptr<PointerControllerInterface> controller = mPointerController.lock(); if (controller == nullptr) { controller = mPolicy->obtainPointerController(deviceId); mPointerController = controller; updatePointerDisplayLocked(); } return controller; } void InputReader::updatePointerDisplayLocked() { std::shared_ptr<PointerControllerInterface> controller = mPointerController.lock(); if (controller == nullptr) { return; } std::optional<DisplayViewport> viewport = mConfig.getDisplayViewportById(mConfig.defaultPointerDisplayId); if (!viewport) { ALOGW("Can't find the designated viewport with ID %" PRId32 " to update cursor input " "mapper. Fall back to default display", mConfig.defaultPointerDisplayId); viewport = mConfig.getDisplayViewportById(ADISPLAY_ID_DEFAULT); } if (!viewport) { ALOGE("Still can't find a viable viewport to update cursor input mapper. Skip setting it to" " PointerController."); return; } controller->setDisplayViewport(*viewport); } void InputReader::fadePointerLocked() { std::shared_ptr<PointerControllerInterface> controller = mPointerController.lock(); if (controller != nullptr) { controller->fade(PointerControllerInterface::Transition::GRADUAL); } } void InputReader::requestTimeoutAtTimeLocked(nsecs_t when) { if (when < mNextTimeout) { mNextTimeout = when; Loading Loading @@ -1067,17 +1022,6 @@ bool InputReader::ContextImpl::shouldDropVirtualKey(nsecs_t now, int32_t keyCode return mReader->shouldDropVirtualKeyLocked(now, keyCode, scanCode); } void InputReader::ContextImpl::fadePointer() { // lock is already held by the input loop mReader->fadePointerLocked(); } std::shared_ptr<PointerControllerInterface> InputReader::ContextImpl::getPointerController( int32_t deviceId) { // lock is already held by the input loop return mReader->getPointerControllerLocked(deviceId); } void InputReader::ContextImpl::requestTimeoutAtTime(nsecs_t when) { // lock is already held by the input loop mReader->requestTimeoutAtTimeLocked(when); Loading services/inputflinger/reader/include/InputReader.h +0 −11 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ #pragma once #include <PointerControllerInterface.h> #include <android-base/thread_annotations.h> #include <utils/Condition.h> #include <utils/Mutex.h> Loading Loading @@ -141,9 +140,6 @@ protected: void disableVirtualKeysUntil(nsecs_t time) REQUIRES(mReader->mLock) override; bool shouldDropVirtualKey(nsecs_t now, int32_t keyCode, int32_t scanCode) REQUIRES(mReader->mLock) override; void fadePointer() REQUIRES(mReader->mLock) override; std::shared_ptr<PointerControllerInterface> getPointerController(int32_t deviceId) REQUIRES(mReader->mLock) override; void requestTimeoutAtTime(nsecs_t when) REQUIRES(mReader->mLock) override; int32_t bumpGeneration() NO_THREAD_SAFETY_ANALYSIS override; void getExternalStylusDevices(std::vector<InputDeviceInfo>& outDevices) Loading Loading @@ -230,13 +226,6 @@ private: [[nodiscard]] std::list<NotifyArgs> dispatchExternalStylusStateLocked(const StylusState& state) REQUIRES(mLock); // The PointerController that is shared among all the input devices that need it. std::weak_ptr<PointerControllerInterface> mPointerController; std::shared_ptr<PointerControllerInterface> getPointerControllerLocked(int32_t deviceId) REQUIRES(mLock); void updatePointerDisplayLocked() REQUIRES(mLock); void fadePointerLocked() REQUIRES(mLock); int32_t mGeneration GUARDED_BY(mLock); int32_t bumpGenerationLocked() REQUIRES(mLock); Loading services/inputflinger/reader/include/InputReaderContext.h +0 −4 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ class InputDevice; class InputListenerInterface; class InputMapper; class InputReaderPolicyInterface; class PointerControllerInterface; struct StylusState; /* Internal interface used by individual input devices to access global input device state Loading @@ -45,9 +44,6 @@ public: virtual void disableVirtualKeysUntil(nsecs_t time) = 0; virtual bool shouldDropVirtualKey(nsecs_t now, int32_t keyCode, int32_t scanCode) = 0; virtual void fadePointer() = 0; virtual std::shared_ptr<PointerControllerInterface> getPointerController(int32_t deviceId) = 0; virtual void requestTimeoutAtTime(nsecs_t when) = 0; virtual int32_t bumpGeneration() = 0; Loading services/inputflinger/reader/mapper/KeyboardInputMapper.cpp +1 −6 Original line number Diff line number Diff line Loading @@ -483,16 +483,11 @@ std::list<NotifyArgs> KeyboardInputMapper::cancelAllDownKeys(nsecs_t when) { void KeyboardInputMapper::onKeyDownProcessed(nsecs_t downTime) { InputReaderContext& context = *getContext(); context.setLastKeyDownTimestamp(downTime); if (context.isPreventingTouchpadTaps()) { // avoid pinging java service unnecessarily, just fade pointer again if it became visible context.fadePointer(); return; } // TODO(b/338652288): Move cursor fading logic into PointerChoreographer. // Ignore meta keys or multiple simultaneous down keys as they are likely to be keyboard // shortcuts bool shouldHideCursor = mKeyDowns.size() == 1 && !isMetaKey(mKeyDowns[0].keyCode); if (shouldHideCursor && context.getPolicy()->isInputMethodConnectionActive()) { context.fadePointer(); context.setPreventingTouchpadTaps(true); } } Loading Loading
services/inputflinger/include/InputReaderBase.h +0 −11 Original line number Diff line number Diff line Loading @@ -61,9 +61,6 @@ struct InputReaderConfiguration { // The display size or orientation changed. DISPLAY_INFO = 1u << 2, // The visible touches option changed. SHOW_TOUCHES = 1u << 3, // The keyboard layouts must be reloaded. KEYBOARD_LAYOUTS = 1u << 4, Loading Loading @@ -214,9 +211,6 @@ struct InputReaderConfiguration { // will cover this portion of the display diagonal. float pointerGestureZoomSpeedRatio; // True to show the location of touches on the touch screen as spots. bool showTouches; // The latest request to enable or disable Pointer Capture. PointerCaptureRequest pointerCaptureRequest; Loading Loading @@ -268,7 +262,6 @@ struct InputReaderConfiguration { pointerGestureSwipeMaxWidthRatio(0.25f), pointerGestureMovementSpeedRatio(0.8f), pointerGestureZoomSpeedRatio(0.3f), showTouches(false), pointerCaptureRequest(), touchpadPointerSpeed(0), touchpadNaturalScrollingEnabled(true), Loading Loading @@ -449,10 +442,6 @@ public: /* Gets the input reader configuration. */ virtual void getReaderConfiguration(InputReaderConfiguration* outConfig) = 0; /* Gets a pointer controller associated with the specified cursor device (ie. a mouse). */ virtual std::shared_ptr<PointerControllerInterface> obtainPointerController( int32_t deviceId) = 0; /* Notifies the input reader policy that some input devices have changed * and provides information about all current input devices. */ Loading
services/inputflinger/reader/InputReader.cpp +0 −56 Original line number Diff line number Diff line Loading @@ -402,10 +402,6 @@ void InputReader::refreshConfigurationLocked(ConfigurationChanges changes) { ALOGI("Reconfiguring input devices, changes=%s", changes.string().c_str()); nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); if (changes.test(Change::DISPLAY_INFO)) { updatePointerDisplayLocked(); } if (changes.test(Change::MUST_REOPEN)) { mEventHub->requestReopenDevices(); } else { Loading Loading @@ -490,47 +486,6 @@ bool InputReader::shouldDropVirtualKeyLocked(nsecs_t now, int32_t keyCode, int32 } } std::shared_ptr<PointerControllerInterface> InputReader::getPointerControllerLocked( int32_t deviceId) { std::shared_ptr<PointerControllerInterface> controller = mPointerController.lock(); if (controller == nullptr) { controller = mPolicy->obtainPointerController(deviceId); mPointerController = controller; updatePointerDisplayLocked(); } return controller; } void InputReader::updatePointerDisplayLocked() { std::shared_ptr<PointerControllerInterface> controller = mPointerController.lock(); if (controller == nullptr) { return; } std::optional<DisplayViewport> viewport = mConfig.getDisplayViewportById(mConfig.defaultPointerDisplayId); if (!viewport) { ALOGW("Can't find the designated viewport with ID %" PRId32 " to update cursor input " "mapper. Fall back to default display", mConfig.defaultPointerDisplayId); viewport = mConfig.getDisplayViewportById(ADISPLAY_ID_DEFAULT); } if (!viewport) { ALOGE("Still can't find a viable viewport to update cursor input mapper. Skip setting it to" " PointerController."); return; } controller->setDisplayViewport(*viewport); } void InputReader::fadePointerLocked() { std::shared_ptr<PointerControllerInterface> controller = mPointerController.lock(); if (controller != nullptr) { controller->fade(PointerControllerInterface::Transition::GRADUAL); } } void InputReader::requestTimeoutAtTimeLocked(nsecs_t when) { if (when < mNextTimeout) { mNextTimeout = when; Loading Loading @@ -1067,17 +1022,6 @@ bool InputReader::ContextImpl::shouldDropVirtualKey(nsecs_t now, int32_t keyCode return mReader->shouldDropVirtualKeyLocked(now, keyCode, scanCode); } void InputReader::ContextImpl::fadePointer() { // lock is already held by the input loop mReader->fadePointerLocked(); } std::shared_ptr<PointerControllerInterface> InputReader::ContextImpl::getPointerController( int32_t deviceId) { // lock is already held by the input loop return mReader->getPointerControllerLocked(deviceId); } void InputReader::ContextImpl::requestTimeoutAtTime(nsecs_t when) { // lock is already held by the input loop mReader->requestTimeoutAtTimeLocked(when); Loading
services/inputflinger/reader/include/InputReader.h +0 −11 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ #pragma once #include <PointerControllerInterface.h> #include <android-base/thread_annotations.h> #include <utils/Condition.h> #include <utils/Mutex.h> Loading Loading @@ -141,9 +140,6 @@ protected: void disableVirtualKeysUntil(nsecs_t time) REQUIRES(mReader->mLock) override; bool shouldDropVirtualKey(nsecs_t now, int32_t keyCode, int32_t scanCode) REQUIRES(mReader->mLock) override; void fadePointer() REQUIRES(mReader->mLock) override; std::shared_ptr<PointerControllerInterface> getPointerController(int32_t deviceId) REQUIRES(mReader->mLock) override; void requestTimeoutAtTime(nsecs_t when) REQUIRES(mReader->mLock) override; int32_t bumpGeneration() NO_THREAD_SAFETY_ANALYSIS override; void getExternalStylusDevices(std::vector<InputDeviceInfo>& outDevices) Loading Loading @@ -230,13 +226,6 @@ private: [[nodiscard]] std::list<NotifyArgs> dispatchExternalStylusStateLocked(const StylusState& state) REQUIRES(mLock); // The PointerController that is shared among all the input devices that need it. std::weak_ptr<PointerControllerInterface> mPointerController; std::shared_ptr<PointerControllerInterface> getPointerControllerLocked(int32_t deviceId) REQUIRES(mLock); void updatePointerDisplayLocked() REQUIRES(mLock); void fadePointerLocked() REQUIRES(mLock); int32_t mGeneration GUARDED_BY(mLock); int32_t bumpGenerationLocked() REQUIRES(mLock); Loading
services/inputflinger/reader/include/InputReaderContext.h +0 −4 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ class InputDevice; class InputListenerInterface; class InputMapper; class InputReaderPolicyInterface; class PointerControllerInterface; struct StylusState; /* Internal interface used by individual input devices to access global input device state Loading @@ -45,9 +44,6 @@ public: virtual void disableVirtualKeysUntil(nsecs_t time) = 0; virtual bool shouldDropVirtualKey(nsecs_t now, int32_t keyCode, int32_t scanCode) = 0; virtual void fadePointer() = 0; virtual std::shared_ptr<PointerControllerInterface> getPointerController(int32_t deviceId) = 0; virtual void requestTimeoutAtTime(nsecs_t when) = 0; virtual int32_t bumpGeneration() = 0; Loading
services/inputflinger/reader/mapper/KeyboardInputMapper.cpp +1 −6 Original line number Diff line number Diff line Loading @@ -483,16 +483,11 @@ std::list<NotifyArgs> KeyboardInputMapper::cancelAllDownKeys(nsecs_t when) { void KeyboardInputMapper::onKeyDownProcessed(nsecs_t downTime) { InputReaderContext& context = *getContext(); context.setLastKeyDownTimestamp(downTime); if (context.isPreventingTouchpadTaps()) { // avoid pinging java service unnecessarily, just fade pointer again if it became visible context.fadePointer(); return; } // TODO(b/338652288): Move cursor fading logic into PointerChoreographer. // Ignore meta keys or multiple simultaneous down keys as they are likely to be keyboard // shortcuts bool shouldHideCursor = mKeyDowns.size() == 1 && !isMetaKey(mKeyDowns[0].keyCode); if (shouldHideCursor && context.getPolicy()->isInputMethodConnectionActive()) { context.fadePointer(); context.setPreventingTouchpadTaps(true); } } Loading