diff options
author | Prashant Malani <pmalani@google.com> | 2014-11-13 14:04:00 -0800 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2015-06-01 22:33:46 +0000 |
commit | 5e9f257b28267077a2732521bee667590a5f6941 (patch) | |
tree | b70c1eb1ed00f252daee1c251c692bf54f75e609 | |
parent | fadfe7b06b223fd99697e766671b67dc285d4188 (diff) | |
download | android_frameworks_base-stable/cm-12.0-YNG1TA.tar.gz android_frameworks_base-stable/cm-12.0-YNG1TA.tar.bz2 android_frameworks_base-stable/cm-12.0-YNG1TA.zip |
Don't animate screen brightness if there is a pending off transitionstable/cm-12.0-YNG1TA
When the DisplayPowerRequest policy is POLICY_OFF, a screen state
transition animation to DISPLAY_OFF is intiated. However, in
updatePowerState() the screen brightness setting, based on the current
display state, is set to normal brightness and an animation is
triggered. This causes a transient flash on some devices, which are
transitioning from a dimmed screen to screen off.
This change checks for a pending screen off transition before
triggering a screen brightness animation, to prevent the flashes.
Bug: 18136235
Change-Id: I37f9fb28b3ec8a4fdbb45920c40d25ebd50c220b
-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 b1631f51b55..52f6eee752c 100644 --- a/services/core/java/com/android/server/display/DisplayPowerController.java +++ b/services/core/java/com/android/server/display/DisplayPowerController.java @@ -649,11 +649,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. |