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

Commit daa107c8 authored by Mike Lockwood's avatar Mike Lockwood Committed by Android Git Automerger
Browse files

am 3110bf6d: Merge "Fix inconsistency in how we handle light sensor when...

am 3110bf6d: Merge "Fix inconsistency in how we handle light sensor when battery is low." into froyo

Merge commit '3110bf6d' into froyo-plus-aosp

* commit '3110bf6d':
  Fix inconsistency in how we handle light sensor when battery is low.
parents c2093636 3110bf6d
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -1730,7 +1730,7 @@ class PowerManagerService extends IPowerManager.Stub
        }

        if (offMask != 0) {
            //Slog.i(TAG, "Setting brightess off: " + offMask);
            if (mSpew) Slog.i(TAG, "Setting brightess off: " + offMask);
            setLightBrightness(offMask, Power.BRIGHTNESS_OFF);
        }
        if (dimMask != 0) {
@@ -1739,7 +1739,7 @@ class PowerManagerService extends IPowerManager.Stub
                    brightness > Power.BRIGHTNESS_LOW_BATTERY) {
                brightness = Power.BRIGHTNESS_LOW_BATTERY;
            }
            //Slog.i(TAG, "Setting brightess dim " + brightness + ": " + offMask);
            if (mSpew) Slog.i(TAG, "Setting brightess dim " + brightness + ": " + dimMask);
            setLightBrightness(dimMask, brightness);
        }
        if (onMask != 0) {
@@ -1748,7 +1748,7 @@ class PowerManagerService extends IPowerManager.Stub
                    brightness > Power.BRIGHTNESS_LOW_BATTERY) {
                brightness = Power.BRIGHTNESS_LOW_BATTERY;
            }
            //Slog.i(TAG, "Setting brightess on " + brightness + ": " + onMask);
            if (mSpew) Slog.i(TAG, "Setting brightess on " + brightness + ": " + onMask);
            setLightBrightness(onMask, brightness);
        }
    }
@@ -1883,6 +1883,10 @@ class PowerManagerService extends IPowerManager.Stub

    private int applyButtonState(int state) {
        int brightness = -1;
        if ((state & BATTERY_LOW_BIT) != 0) {
            // do not override brightness if the battery is low
            return state;
        }
        if (mButtonBrightnessOverride >= 0) {
            brightness = mButtonBrightnessOverride;
        } else if (mLightSensorButtonBrightness >= 0 && mUseSoftwareAutoBrightness) {
@@ -1899,6 +1903,10 @@ class PowerManagerService extends IPowerManager.Stub

    private int applyKeyboardState(int state) {
        int brightness = -1;
        if ((state & BATTERY_LOW_BIT) != 0) {
            // do not override brightness if the battery is low
            return state;
        }
        if (!mKeyboardVisible) {
            brightness = 0;
        } else if (mButtonBrightnessOverride >= 0) {