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

Commit 734f92fe authored by Yeabkal Wubshit's avatar Yeabkal Wubshit
Browse files

Add Rotary Encoder Slop Logs

Add logs for when a slop is applied to a rotary input, and for the first
input that passed the slop threshold.

Bug: 293649303
Bug: 288913283
Test: manual
Change-Id: I5b6462860786eebf9d0b6940297145e1d1100e18
(cherry picked from commit 30bee3735da8284485bc6e9c95fb13f1477f20bf)
parent 8af3ec98
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -54,11 +54,13 @@ float SlopController::consumeEvent(nsecs_t eventTimeNanos, float value) {
    mCumulativeValue += value;

    if (abs(mCumulativeValue) >= mSlopThreshold) {
        ALOGD("SlopController: did not drop event with value .%3f", value);
        mHasSlopBeenMet = true;
        // Return the amount of value that exceeds the slop.
        return signOf(value) * (abs(mCumulativeValue) - mSlopThreshold);
    }

    ALOGD("SlopController: dropping event with value .%3f", value);
    return 0;
}