Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79b76d19 authored by Zixuan Qu's avatar Zixuan Qu
Browse files

Dump WheelVelocityControlParameters in individual CursorInputMappers.

This information is currently only dumped from InputReader as a global
state. However device can have different configurations in the related
CursorInputMapper.

Test: Manual - adb shell dumpsys input

Change-Id: Ibec2b5ff2533c74924a542fe98d13fa8a88e40ca
parent f8ebb5b5
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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);

+4 −0
Original line number Diff line number Diff line
@@ -37,6 +37,10 @@ VelocityControl::VelocityControl() {
    reset();
}

VelocityControlParameters& VelocityControl::getParameters() {
    return mParameters;
}

void VelocityControl::setParameters(const VelocityControlParameters& parameters) {
    mParameters = parameters;
    reset();
+4 −0
Original line number Diff line number Diff line
@@ -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());