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

Commit 31c3bd25 authored by Glenn Maynard's avatar Glenn Maynard Committed by Steve Kondik
Browse files

Fix brightness set incorrectly for out-of-range values.

Don't mask the value, clamp it, so brightness values don't wrap around.
Fixes the backlight being turned down when callers set it too bright.

http://code.google.com/p/cyanogenmod/issues/detail?id=1496
parent 4995cddc
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -280,7 +280,9 @@ public class HardwareService extends IHardwareService.Stub {
    }

    void setLightBrightness_UNCHECKED(int light, int brightness, int brightnessMode) {
        int b = brightness & 0x000000ff;
        int b = brightness;
        if(b > 0xFF)
            b = 0xFF;
        b = 0xff000000 | (b << 16) | (b << 8) | b;
        setLight_native(mNativePointer, light, b, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
    }