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

Commit 3eff280e authored by Fiona Campbell's avatar Fiona Campbell Committed by Automerger Merge Worker
Browse files

Merge "Remove precision loss on brightness slider." into rvc-dev am: b204ade3

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11595231

Change-Id: I262d471bbad78a619519fe5bce2a11154011aaa7
parents ba68b71a b204ade3
Loading
Loading
Loading
Loading
+3 −7
Original line number Original line Diff line number Diff line
@@ -443,14 +443,10 @@ public class BrightnessController implements ToggleSlider.Listener {
            max = mMaximumBacklight;
            max = mMaximumBacklight;
        }
        }
        // convertGammaToLinearFloat returns 0-1
        // convertGammaToLinearFloat returns 0-1
        if (BrightnessSynchronizer.brightnessFloatToInt(mContext, brightnessValue)
        if (BrightnessSynchronizer.floatEquals(brightnessValue,
                == BrightnessSynchronizer.brightnessFloatToInt(mContext,
                convertGammaToLinearFloat(mControl.getValue(), min, max))) {
                convertGammaToLinearFloat(mControl.getValue(), min, max))) {
            // If we have more resolution on the slider than we do in the actual setting, then
            // If the value in the slider is equal to the value on the current brightness
            // multiple slider positions will map to the same setting value. Thus, if we see a
            // then the slider does not need to animate, since the brightness will not change.
            // setting value here that maps to the current slider position, we don't bother to
            // calculate the new slider position since it may differ and look like a brightness
            // change to the user even though it isn't one.
            return;
            return;
        }
        }
        // Returns GAMMA_SPACE_MIN - GAMMA_SPACE_MAX
        // Returns GAMMA_SPACE_MIN - GAMMA_SPACE_MAX