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

Commit 11e290e5 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "Fix button backlights that depend on ALS" into gingerbread

parents dc4811e2 37780370
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1676,7 +1676,7 @@ class PowerManagerService extends IPowerManager.Stub
        if (err == 0) {
            mLastScreenOnTime = (on ? SystemClock.elapsedRealtime() : 0);
            if (mUseSoftwareAutoBrightness) {
                enableLightSensor(on && mAutoBrightessEnabled);
                enableLightSensor(on);
                if (!on) {
                    // make sure button and key backlights are off too
                    mButtonLight.turnOff();
@@ -1689,6 +1689,12 @@ class PowerManagerService extends IPowerManager.Stub
                    lightFilterStop();
                    resetLastLightValues();
                }
                else if (!mAutoBrightessEnabled) {
                    /* Force a light sensor reset since we enabled it
                       when the screen came on */
                    mAutoBrightessEnabled = true;
                    setScreenBrightnessMode(Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
                }
            }
        }
        return err;
@@ -2573,6 +2579,7 @@ class PowerManagerService extends IPowerManager.Stub
            return;
        }


        // do not allow light sensor value to decrease unless
        // user has actively permitted it
        if (mLightDecrease) {