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

Commit 631938f2 authored by Jeff Brown's avatar Jeff Brown
Browse files

Enable auto-brightness adjustment feature with system prop.

This feature is experimental and disabled by default.

Change-Id: I183534370da7613557e4d1535f556873f8a763df
parent e08ae388
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -330,6 +330,15 @@ public final class PowerManager {
                com.android.internal.R.integer.config_screenBrightnessSettingDefault);
    }

    /**
     * Returns true if the screen auto-brightness adjustment setting should
     * be available in the UI.  This setting is experimental and disabled by default.
     * @hide
     */
    public static boolean useScreenAutoBrightnessAdjustmentFeature() {
        return SystemProperties.getBoolean("persist.power.useautobrightadj", false);
    }

    /**
     * Creates a new wake lock with the specified level and flags.
     * <p>
+2 −1
Original line number Diff line number Diff line
@@ -83,7 +83,8 @@ final class DisplayPowerController {
    private static final boolean USE_ELECTRON_BEAM_ON_ANIMATION = false;

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

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