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

Commit 2c09b786 authored by Prashant Malani's avatar Prashant Malani
Browse files

Revert "inputflinger: Add support for scaling and true value reporting"

This reverts commit ee03865f.
parent ee03865f
Loading
Loading
Loading
Loading
+2 −13
Original line number Diff line number Diff line
@@ -2751,18 +2751,7 @@ void RotaryEncoderInputMapper::populateDeviceInfo(InputDeviceInfo* info) {
    InputMapper::populateDeviceInfo(info);

    if (mRotaryEncoderScrollAccumulator.haveRelativeVWheel()) {
        float res = 0.0f;
        if (!mDevice->getConfiguration().tryGetProperty(String8("device.res"), res)) {
            ALOGW("Rotary Encoder device configuration file didn't specify resolution!\n");
        }
        if (!mDevice->getConfiguration().tryGetProperty(String8("device.scalingFactor"),
            mScalingFactor)) {
            ALOGW("Rotary Encoder device configuration file didn't specify scaling factor,"
              "default to 1.0!\n");
            mScalingFactor = 1.0f;
        }
        info->addMotionRange(AMOTION_EVENT_AXIS_SCROLL, mSource, -1.0f, 1.0f, 0.0f, 0.0f,
            res * mScalingFactor);
        info->addMotionRange(AMOTION_EVENT_AXIS_SCROLL, mSource, -1.0f, 1.0f, 0.0f, 0.0f, 0.0f);
    }
}

@@ -2818,7 +2807,7 @@ void RotaryEncoderInputMapper::sync(nsecs_t when) {
    // Send motion event.
    if (scrolled) {
        int32_t metaState = mContext->getGlobalMetaState();
        pointerCoords.setAxisValue(AMOTION_EVENT_AXIS_SCROLL, scroll * mScalingFactor);
        pointerCoords.setAxisValue(AMOTION_EVENT_AXIS_SCROLL, scroll);

        NotifyMotionArgs scrollArgs(when, getDeviceId(), mSource, policyFlags,
                AMOTION_EVENT_ACTION_SCROLL, 0, 0, metaState, 0,
+0 −1
Original line number Diff line number Diff line
@@ -1247,7 +1247,6 @@ private:
    CursorScrollAccumulator mRotaryEncoderScrollAccumulator;

    int32_t mSource;
    float mScalingFactor;

    void sync(nsecs_t when);
};