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

Commit 8b1c67ae authored by PaulW's avatar PaulW
Browse files

Revert Change I5ec0e757: Don't enable the light sensor if it's not being used

Light sensor is only used anyway in changed function if mUseSoftwareAutoBrightness is true.  Setting mAutoBrightnessEnabled to true and checking that flag also will make no difference to the end result.

Change-Id: Iaf78a908f22fb8a52661385def602aabbbbf5643
parent 0867a021
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -246,7 +246,7 @@ class PowerManagerService extends IPowerManager.Stub
    private int mScreenBrightnessOverride = -1;
    private int mButtonBrightnessOverride = -1;
    private boolean mUseSoftwareAutoBrightness;
    private boolean mAutoBrightessEnabled = true;
    private boolean mAutoBrightessEnabled;
    private int[] mAutoBrightnessLevels;
    private int[] mLcdBacklightValues;
    private int[] mButtonBacklightValues;
@@ -482,7 +482,6 @@ class PowerManagerService extends IPowerManager.Stub
        }

        public void update(Observable o, Object arg) {

            synchronized (mLocks) {
                // STAY_ON_WHILE_PLUGGED_IN, default to when plugged into AC
                mStayOnConditions = getInt(STAY_ON_WHILE_PLUGGED_IN,
@@ -1676,7 +1675,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();