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

Commit db21284a authored by Jeff Brown's avatar Jeff Brown
Browse files

Disable use of twilight mode for auto-brightness.

This adjustment is still experimental.

Bug: 7165399
Change-Id: I3fcf361933995d02a5329eeaec80155b39371ba3
parent 3dc524bc
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -339,6 +339,15 @@ public final class PowerManager {
        return SystemProperties.getBoolean("persist.power.useautobrightadj", false);
    }

    /**
     * Returns true if the twilight service should be used to adjust screen brightness
     * policy.  This setting is experimental and disabled by default.
     * @hide
     */
    public static boolean useTwilightAdjustmentFeature() {
        return SystemProperties.getBoolean("persist.power.usetwilightadj", false);
    }

    /**
     * Creates a new wake lock with the specified level and flags.
     * <p>
+2 −2
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ import android.util.TimeUtils;
import android.view.Display;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.concurrent.Executor;

/**
@@ -95,7 +94,8 @@ final class DisplayPowerController {
    // when it is especially dark outside.  The light sensor tends to perform
    // poorly at low light levels so we compensate for it by making an
    // assumption about the environment.
    private static final boolean USE_TWILIGHT_ADJUSTMENT = true;
    private static final boolean USE_TWILIGHT_ADJUSTMENT =
            PowerManager.useTwilightAdjustmentFeature();

    // Specifies the maximum magnitude of the time of day adjustment.
    private static final float TWILIGHT_ADJUSTMENT_MAX_GAMMA = 1.5f;