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

Commit 640a0d3c authored by Danny Baumann's avatar Danny Baumann
Browse files

Add method to PowerManager that allows querying the lowest possible

brightness.

Used by the auto-brightness adjustment to adjust the sliders.

Change-Id: Idb58fd86dee1a053fe858291be6c9b3169ac4247
parent f6f6b1d3
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -334,6 +334,19 @@ public final class PowerManager {
                com.android.internal.R.integer.config_screenBrightnessSettingDefault);
    }

    /**
     * Gets the minimum screen brightness.
     * This is the lowest possible screen brightness; the screen will
     * never become dimmer than that.
     * @hide
     */
    public int getMinimumAbsoluteScreenBrightness() {
        int minSetting = getMinimumScreenBrightnessSetting();
        int dimSetting = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_screenBrightnessDim);
        return Math.min(minSetting, dimSetting);
    }

    /**
     * Returns true if the screen auto-brightness adjustment setting should
     * be available in the UI.  This setting is experimental and disabled by default.