Skip to content

Commit db21284

Browse files
author
Jeff Brown
committed
Disable use of twilight mode for auto-brightness.
This adjustment is still experimental. Bug: 7165399 Change-Id: I3fcf361933995d02a5329eeaec80155b39371ba3
1 parent 3dc524b commit db21284

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

core/java/android/os/PowerManager.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,15 @@ public static boolean useScreenAutoBrightnessAdjustmentFeature() {
339339
return SystemProperties.getBoolean("persist.power.useautobrightadj", false);
340340
}
341341

342+
/**
343+
* Returns true if the twilight service should be used to adjust screen brightness
344+
* policy. This setting is experimental and disabled by default.
345+
* @hide
346+
*/
347+
public static boolean useTwilightAdjustmentFeature() {
348+
return SystemProperties.getBoolean("persist.power.usetwilightadj", false);
349+
}
350+
342351
/**
343352
* Creates a new wake lock with the specified level and flags.
344353
* <p>

services/java/com/android/server/power/DisplayPowerController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import android.view.Display;
4545

4646
import java.io.PrintWriter;
47-
import java.io.StringWriter;
4847
import java.util.concurrent.Executor;
4948

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

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

0 commit comments

Comments
 (0)