diff options
-rw-r--r-- | services/core/java/com/android/server/display/DisplayPowerController.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java index 8cfb4b3..78610ff 100644 --- a/services/core/java/com/android/server/display/DisplayPowerController.java +++ b/services/core/java/com/android/server/display/DisplayPowerController.java @@ -669,11 +669,13 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call // Animate the screen brightness when the screen is on or dozing. // Skip the animation when the screen is off or suspended. - if (state == Display.STATE_ON || state == Display.STATE_DOZE) { - animateScreenBrightness(brightness, - slowChange ? BRIGHTNESS_RAMP_RATE_SLOW : BRIGHTNESS_RAMP_RATE_FAST); - } else { - animateScreenBrightness(brightness, 0); + if (!mPendingScreenOff) { + if (state == Display.STATE_ON || state == Display.STATE_DOZE) { + animateScreenBrightness(brightness, + slowChange ? BRIGHTNESS_RAMP_RATE_SLOW : BRIGHTNESS_RAMP_RATE_FAST); + } else { + animateScreenBrightness(brightness, 0); + } } // Determine whether the display is ready for use in the newly requested state. |