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

Commit 93145fb1 authored by Harry Cutts's avatar Harry Cutts
Browse files

SlopController: fix formatting of logged values

While checking b/396858976 I noticed some of these log messages with
strange formatting of the values:

    InputReader: SlopController: dropping event with value .-1.000000
    InputReader: SlopController: dropping event with value .3.000000

It looks like these format strings were intended to specify the
precision after the decimal point, rather than the field width.

Bug: 245989146
Change-Id: I71691d025cc5f03b26e95f96f90ab0a2281ed43b
Test: TreeHugger
Flag: EXEMPT logs only change
parent 00ff6287
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -54,13 +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);
        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);
    ALOGD("SlopController: dropping event with value %.3f", value);
    return 0;
}