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

Commit a96a3c1b authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge changes I9bd3a235,I9c4dbdef into lmp-dev

* changes:
  Improve adaptive brightness in very dark rooms.
  Hide PowerManager methods that third-party apps can't use.
parents d7761be2 1bfd0f46
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -22465,15 +22465,12 @@ package android.os {
  }
  public final class PowerManager {
    method public void goToSleep(long);
    method public boolean isInteractive();
    method public boolean isPowerSaveMode();
    method public deprecated boolean isScreenOn();
    method public boolean isWakeLockLevelSupported(int);
    method public android.os.PowerManager.WakeLock newWakeLock(int, java.lang.String);
    method public void reboot(java.lang.String);
    method public void userActivity(long, boolean);
    method public void wakeUp(long);
    field public static final int ACQUIRE_CAUSES_WAKEUP = 268435456; // 0x10000000
    field public static final java.lang.String ACTION_POWER_SAVE_MODE_CHANGED = "android.os.action.POWER_SAVE_MODE_CHANGED";
    field public static final deprecated int FULL_WAKE_LOCK = 26; // 0x1a
+10 −0
Original line number Diff line number Diff line
@@ -6,6 +6,16 @@ package android.media {

}

package android.os {

  public final class PowerManager {
    method public void goToSleep(long);
    method public deprecated void userActivity(long, boolean);
    method public void wakeUp(long);
  }

}

package android.view {

  public static class WindowManager.LayoutParams extends android.view.ViewGroup.LayoutParams implements android.os.Parcelable {
+29 −3
Original line number Diff line number Diff line
@@ -521,7 +521,11 @@ public final class PowerManager {
     *
     * @see #wakeUp
     * @see #goToSleep
     *
     * @removed Requires signature or system permission.
     * @deprecated Use {@link #userActivity(long, int, int)}.
     */
    @Deprecated
    public void userActivity(long when, boolean noChangeLights) {
        userActivity(when, USER_ACTIVITY_EVENT_OTHER,
                noChangeLights ? USER_ACTIVITY_FLAG_NO_CHANGE_LIGHTS : 0);
@@ -575,13 +579,33 @@ public final class PowerManager {
     *
     * @see #userActivity
     * @see #wakeUp
     *
     * @removed Requires signature permission.
     */
    public void goToSleep(long time) {
        goToSleep(time, GO_TO_SLEEP_REASON_APPLICATION, 0);
    }

    /**
     * @hide
     * Forces the device to go to sleep.
     * <p>
     * Overrides all the wake locks that are held.
     * This is what happens when the power key is pressed to turn off the screen.
     * </p><p>
     * Requires the {@link android.Manifest.permission#DEVICE_POWER} permission.
     * </p>
     *
     * @param time The time when the request to go to sleep was issued, in the
     * {@link SystemClock#uptimeMillis()} time base.  This timestamp is used to correctly
     * order the go to sleep request with other power management functions.  It should be set
     * to the timestamp of the input event that caused the request to go to sleep.
     * @param reason The reason the device is going to sleep.
     * @param flags Optional flags to apply when going to sleep.
     *
     * @see #userActivity
     * @see #wakeUp
     *
     * @hide Requires signature permission.
     */
    public void goToSleep(long time, int reason, int flags) {
        try {
@@ -606,6 +630,8 @@ public final class PowerManager {
     *
     * @see #userActivity
     * @see #goToSleep
     *
     * @removed Requires signature permission.
     */
    public void wakeUp(long time) {
        try {
@@ -633,7 +659,7 @@ public final class PowerManager {
     * @see #wakeUp
     * @see #goToSleep
     *
     * @hide
     * @hide Requires signature permission.
     */
    public void nap(long time) {
        try {
@@ -650,7 +676,7 @@ public final class PowerManager {
     *
     * @param brightness The brightness value from 0 to 255.
     *
     * {@hide}
     * @hide Requires signature permission.
     */
    public void setBacklightBrightness(int brightness) {
        try {
+31 −22
Original line number Diff line number Diff line
@@ -673,6 +673,37 @@
    -->
    <integer name="config_doubleTapOnHomeBehavior">0</integer>

    <!-- Minimum screen brightness setting allowed by the power manager.
         The user is forbidden from setting the brightness below this level. -->
    <integer name="config_screenBrightnessSettingMinimum">10</integer>

    <!-- Maximum screen brightness allowed by the power manager.
         The user is forbidden from setting the brightness above this level. -->
    <integer name="config_screenBrightnessSettingMaximum">255</integer>

    <!-- Default screen brightness setting.
         Must be in the range specified by minimum and maximum. -->
    <integer name="config_screenBrightnessSettingDefault">102</integer>

    <!-- Screen brightness used to dim the screen while dozing in a very low power state.
         May be less than the minimum allowed brightness setting
         that can be set by the user. -->
    <integer name="config_screenBrightnessDoze">1</integer>

    <!-- Screen brightness used to dim the screen when the user activity
         timeout expires.  May be less than the minimum allowed brightness setting
         that can be set by the user. -->
    <integer name="config_screenBrightnessDim">10</integer>

    <!-- Minimum allowable screen brightness to use in a very dark room.
         This value sets the floor for the darkest possible auto-brightness
         adjustment.  It is expected to be somewhat less than the first entry in
         config_autoBrightnessLcdBacklightValues so as to allow the user to have
         some range of adjustment to dim the screen further than usual in very
         dark rooms. The contents of the screen must still be clearly visible
         in darkness (although they may not be visible in a bright room). -->
    <integer name="config_screenBrightnessDark">1</integer>

    <!-- Array of light sensor LUX values to define our levels for auto backlight brightness support.
         The N entries of this array define N + 1 control points as follows:
         (1-based arrays)
@@ -696,28 +727,6 @@
    <integer-array name="config_autoBrightnessLevels">
    </integer-array>

    <!-- Minimum screen brightness setting allowed by the power manager.
         The user is forbidden from setting the brightness below this level. -->
    <integer name="config_screenBrightnessSettingMinimum">10</integer>

    <!-- Maximum screen brightness allowed by the power manager.
         The user is forbidden from setting the brightness above this level. -->
    <integer name="config_screenBrightnessSettingMaximum">255</integer>

    <!-- Default screen brightness setting.
         Must be in the range specified by minimum and maximum. -->
    <integer name="config_screenBrightnessSettingDefault">102</integer>

    <!-- Screen brightness used to dim the screen while dozing in a very low power state.
         May be less than the minimum allowed brightness setting
         that can be set by the user. -->
    <integer name="config_screenBrightnessDoze">1</integer>

    <!-- Screen brightness used to dim the screen when the user activity
         timeout expires.  May be less than the minimum allowed brightness setting
         that can be set by the user. -->
    <integer name="config_screenBrightnessDim">10</integer>

    <!-- Array of output values for LCD backlight corresponding to the LUX values
         in the config_autoBrightnessLevels array.  This array should have size one greater
         than the size of the config_autoBrightnessLevels array.
+1 −0
Original line number Diff line number Diff line
@@ -1565,6 +1565,7 @@
  <java-symbol type="integer" name="config_screenBrightnessSettingMinimum" />
  <java-symbol type="integer" name="config_screenBrightnessSettingMaximum" />
  <java-symbol type="integer" name="config_screenBrightnessSettingDefault" />
  <java-symbol type="integer" name="config_screenBrightnessDark" />
  <java-symbol type="integer" name="config_screenBrightnessDim" />
  <java-symbol type="integer" name="config_screenBrightnessDoze" />
  <java-symbol type="integer" name="config_shutdownBatteryTemperature" />
Loading