diff --git a/api/current.txt b/api/current.txt index 483d0e15c0cdb..b58acf8a05f85 100644 --- a/api/current.txt +++ b/api/current.txt @@ -32575,7 +32575,8 @@ package android.view { field public static final int FLAG_PRIVATE = 4; // 0x4 field public static final int FLAG_SECURE = 2; // 0x2 field public static final int FLAG_SUPPORTS_PROTECTED_BUFFERS = 1; // 0x1 - field public static final int STATE_DOZING = 3; // 0x3 + field public static final int STATE_DOZE = 3; // 0x3 + field public static final int STATE_DOZE_SUSPEND = 4; // 0x4 field public static final int STATE_OFF = 1; // 0x1 field public static final int STATE_ON = 2; // 0x2 field public static final int STATE_UNKNOWN = 0; // 0x0 diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java index 76a6f5231b2e1..b17fa4a8d4980 100644 --- a/core/java/android/view/Display.java +++ b/core/java/android/view/Display.java @@ -225,13 +225,27 @@ public final class Display { public static final int STATE_ON = 2; /** - * Display state: The display is dozing in a low-power state; it may be showing - * system-provided content while the device is in a non-interactive state. + * Display state: The display is dozing in a low power state; it is still + * on but is optimized for showing system-provided content while the + * device is non-interactive. * * @see #getState * @see android.os.PowerManager#isInteractive */ - public static final int STATE_DOZING = 3; + public static final int STATE_DOZE = 3; + + /** + * Display state: The display is dozing in a suspended low power state; it is still + * on but is optimized for showing static system-provided content while the device + * is non-interactive. This mode may be used to conserve even more power by allowing + * the hardware to stop applying frame buffer updates from the graphics subsystem or + * to take over the display and manage it autonomously to implement low power always-on + * display functionality. + * + * @see #getState + * @see android.os.PowerManager#isInteractive + */ + public static final int STATE_DOZE_SUSPEND = 4; /** * Internal method to create a display. @@ -697,7 +711,7 @@ public final class Display { * Gets the state of the display, such as whether it is on or off. * * @return The state of the display: one of {@link #STATE_OFF}, {@link #STATE_ON}, - * {@link #STATE_DOZING}, or {@link #STATE_UNKNOWN}. + * {@link #STATE_DOZE}, {@link #STATE_DOZE_SUSPEND}, or {@link #STATE_UNKNOWN}. */ public int getState() { synchronized (this) { @@ -809,8 +823,10 @@ public final class Display { return "OFF"; case STATE_ON: return "ON"; - case STATE_DOZING: - return "DOZING"; + case STATE_DOZE: + return "DOZE"; + case STATE_DOZE_SUSPEND: + return "DOZE_SUSPEND"; default: return Integer.toString(state); } diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index 94d8f703c53b6..bd46d07838371 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -213,22 +213,27 @@ public class SurfaceControl { /** * Display power mode off: used while blanking the screen. - * Use only with {@link SurfaceControl#setDisplayPowerMode()}. + * Use only with {@link SurfaceControl#setDisplayPowerMode}. */ public static final int POWER_MODE_OFF = 0; /** * Display power mode doze: used while putting the screen into low power mode. - * Use only with {@link SurfaceControl#setDisplayPowerMode()}. + * Use only with {@link SurfaceControl#setDisplayPowerMode}. */ public static final int POWER_MODE_DOZE = 1; /** * Display power mode normal: used while unblanking the screen. - * Use only with {@link SurfaceControl#setDisplayPowerMode()}. + * Use only with {@link SurfaceControl#setDisplayPowerMode}. */ public static final int POWER_MODE_NORMAL = 2; + /** + * Display power mode doze: used while putting the screen into a suspended + * low power mode. Use only with {@link SurfaceControl#setDisplayPowerMode}. + */ + public static final int POWER_MODE_DOZE_SUSPEND = 3; /** * Create a surface with a name. diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java index 654b5741d1e84..a361e1082f408 100644 --- a/services/core/java/com/android/server/display/DisplayPowerController.java +++ b/services/core/java/com/android/server/display/DisplayPowerController.java @@ -558,7 +558,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call if (mPowerRequest.screenState == DisplayPowerRequest.SCREEN_STATE_DOZE) { if (!mScreenBrightnessRampAnimator.isAnimating()) { - setScreenState(Display.STATE_DOZING); + setScreenState(Display.STATE_DOZE); } } else { setScreenState(Display.STATE_ON); diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java index 098537cd56bbe..2bed143543942 100644 --- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java +++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java @@ -115,8 +115,10 @@ final class LocalDisplayAdapter extends DisplayAdapter { switch (state) { case Display.STATE_OFF: return SurfaceControl.POWER_MODE_OFF; - case Display.STATE_DOZING: + case Display.STATE_DOZE: return SurfaceControl.POWER_MODE_DOZE; + case Display.STATE_DOZE_SUSPEND: + return SurfaceControl.POWER_MODE_DOZE_SUSPEND; default: return SurfaceControl.POWER_MODE_NORMAL; }