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

Commit 57af7c80 authored by Fiona Campbell's avatar Fiona Campbell
Browse files

Stop NaN being passed to brightness curve.

PowerManager.BRIGHTNESS_INVALID_FLOAT was being passed on when it shoudln't have been, if statement has been fixed to avoid this.

Bug: 152685837

Test: AutomaticBrightnessControllerTest, adb shell dumpsys display |
grep mBrightnessSpline (check no NaN values)

Change-Id: Ic2d22938ccc81cb2b9e2645b7e21acd89163b107
parent d80aee2e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -551,7 +551,8 @@ public final class DisplayManagerService extends SystemService {
        }
        if (state == Display.STATE_OFF) {
            brightnessState = PowerManager.BRIGHTNESS_OFF_FLOAT;
        } else if (brightnessState < PowerManager.BRIGHTNESS_MIN || Float.isNaN(brightnessState)) {
        } else if (brightnessState != PowerManager.BRIGHTNESS_OFF_FLOAT
                && brightnessState < PowerManager.BRIGHTNESS_MIN) {
            brightnessState = PowerManager.BRIGHTNESS_INVALID_FLOAT;
        } else if (brightnessState > PowerManager.BRIGHTNESS_MAX) {
            brightnessState = PowerManager.BRIGHTNESS_MAX;