From 05e76fe38fa797c12507ad26719797b3fe2a1308 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Thu, 20 Jul 2017 18:18:33 +0100 Subject: [PATCH] Add config to force display to transition to off after doze Some display hardware can't do the transition from doze display states to the on display state cleanly, so in order to hide any janky-ness of the transition we force the display off and cover the screen with a black surface. This lets us keep the screen black until SystemUI and the display are both ready. Bug: 63531607 Test: manual Change-Id: I66bd483e5f01e1dbd5069465aa122828af5f1903 --- core/java/android/view/Display.java | 9 +++++ core/res/res/values/config.xml | 5 +++ core/res/res/values/symbols.xml | 1 + .../display/DisplayPowerController.java | 36 +++++++++++++++++-- 4 files changed, 49 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java index 7346a215ed8ea..263d3ff423c5b 100644 --- a/core/java/android/view/Display.java +++ b/core/java/android/view/Display.java @@ -1132,6 +1132,15 @@ public final class Display { return state == STATE_OFF || state == STATE_DOZE_SUSPEND; } + /** + * Returns true if the display may be in a reduced operating mode while in the + * specified display power state. + * @hide + */ + public static boolean isDozeState(int state) { + return state == STATE_DOZE || state == STATE_DOZE_SUSPEND; + } + /** * A mode supported by a given display. * diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 60db8ca5633cc..f817ab39bf6c1 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -1862,6 +1862,11 @@ states. --> false + + false + +