diff options
-rw-r--r-- | include/input/VelocityControl.h | 12 | ||||
-rw-r--r-- | libs/input/VelocityControl.cpp | 4 | ||||
-rw-r--r-- | services/inputflinger/reader/mapper/CursorInputMapper.cpp | 4 |
3 files changed, 20 insertions, 0 deletions
diff --git a/include/input/VelocityControl.h b/include/input/VelocityControl.h index f72a1bdded..f3c201e7c4 100644 --- a/include/input/VelocityControl.h +++ b/include/input/VelocityControl.h @@ -16,10 +16,13 @@ #pragma once +#include <android-base/stringprintf.h> #include <input/Input.h> #include <input/VelocityTracker.h> #include <utils/Timers.h> +using android::base::StringPrintf; + namespace android { /* @@ -69,6 +72,12 @@ struct VelocityControlParameters { scale(scale), lowThreshold(lowThreshold), highThreshold(highThreshold), acceleration(acceleration) { } + + std::string dump() const { + return StringPrintf("scale=%0.3f, lowThreshold=%0.3f, highThreshold=%0.3f, " + "acceleration=%0.3f\n", + scale, lowThreshold, highThreshold, acceleration); + } }; /* @@ -78,6 +87,9 @@ class VelocityControl { public: VelocityControl(); + /* Gets the various parameters. */ + VelocityControlParameters& getParameters(); + /* Sets the various parameters. */ void setParameters(const VelocityControlParameters& parameters); diff --git a/libs/input/VelocityControl.cpp b/libs/input/VelocityControl.cpp index e2bfb508e1..5c008b1158 100644 --- a/libs/input/VelocityControl.cpp +++ b/libs/input/VelocityControl.cpp @@ -37,6 +37,10 @@ VelocityControl::VelocityControl() { reset(); } +VelocityControlParameters& VelocityControl::getParameters() { + return mParameters; +} + void VelocityControl::setParameters(const VelocityControlParameters& parameters) { mParameters = parameters; reset(); diff --git a/services/inputflinger/reader/mapper/CursorInputMapper.cpp b/services/inputflinger/reader/mapper/CursorInputMapper.cpp index a4f257c4b6..5657d619d1 100644 --- a/services/inputflinger/reader/mapper/CursorInputMapper.cpp +++ b/services/inputflinger/reader/mapper/CursorInputMapper.cpp @@ -117,6 +117,10 @@ void CursorInputMapper::dump(std::string& dump) { toString(mCursorScrollAccumulator.haveRelativeVWheel())); dump += StringPrintf(INDENT3 "HaveHWheel: %s\n", toString(mCursorScrollAccumulator.haveRelativeHWheel())); + dump += StringPrintf(INDENT3 "WheelYVelocityControlParameters: %s", + mWheelYVelocityControl.getParameters().dump().c_str()); + dump += StringPrintf(INDENT3 "WheelXVelocityControlParameters: %s", + mWheelXVelocityControl.getParameters().dump().c_str()); dump += StringPrintf(INDENT3 "VWheelScale: %0.3f\n", mVWheelScale); dump += StringPrintf(INDENT3 "HWheelScale: %0.3f\n", mHWheelScale); dump += StringPrintf(INDENT3 "DisplayId: %s\n", toString(mDisplayId).c_str()); |