Skip to content

Commit 1edf63e

Browse files
Jeff BrownAndroid (Google) Code Review
authored andcommitted
Merge "Enable auto-brightness adjustment feature with system prop." into jb-mr1-dev
2 parents b0d10aa + 631938f commit 1edf63e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

core/java/android/os/PowerManager.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,15 @@ public int getDefaultScreenBrightnessSetting() {
330330
com.android.internal.R.integer.config_screenBrightnessSettingDefault);
331331
}
332332

333+
/**
334+
* Returns true if the screen auto-brightness adjustment setting should
335+
* be available in the UI. This setting is experimental and disabled by default.
336+
* @hide
337+
*/
338+
public static boolean useScreenAutoBrightnessAdjustmentFeature() {
339+
return SystemProperties.getBoolean("persist.power.useautobrightadj", false);
340+
}
341+
333342
/**
334343
* Creates a new wake lock with the specified level and flags.
335344
* <p>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ final class DisplayPowerController {
8383
private static final boolean USE_ELECTRON_BEAM_ON_ANIMATION = false;
8484

8585
// If true, enables the use of the screen auto-brightness adjustment setting.
86-
private static final boolean USE_SCREEN_AUTO_BRIGHTNESS_ADJUSTMENT = false;
86+
private static final boolean USE_SCREEN_AUTO_BRIGHTNESS_ADJUSTMENT =
87+
PowerManager.useScreenAutoBrightnessAdjustmentFeature();
8788

8889
// The maximum range of gamma adjustment possible using the screen
8990
// auto-brightness adjustment setting.

0 commit comments

Comments
 (0)