Permalink
Browse files

Fix keyguard is black background while screen turning off/on quickly

1.the screen will be turning off an on quickly while we multi-press power
key fastly.
2.the screen is to turned on ,but the mColorFadeOffAnimator is still animating
3.that will not setScreenState to Display.STATE_OFF,and the next step that
screen turning on will not block screen to drawn window
4.when the screen is on ,the keyguard interface is black background

Change-Id: I2dd18af15fe05d59e7ff5a5f69630afe17aae018
Signed-off-by: zhoulei <zhoulei5@xiaomi.com>
  • Loading branch information...
zhoulei authored and xlxfoxxlx committed Apr 25, 2017
1 parent 128ef13 commit 99893f0fa750b940f9dcfd376db0b5f75063bcaa
Showing with 7 additions and 4 deletions.
  1. +7 −4 services/core/java/com/android/server/display/DisplayPowerController.java
@@ -903,13 +903,16 @@ private void animateScreenBrightness(int target, int rate) {
private void animateScreenStateChange(int target, boolean performScreenOffTransition) {
// If there is already an animation in progress, don't interfere with it.
if (mColorFadeOnAnimator.isStarted()
|| mColorFadeOffAnimator.isStarted()) {
if (mColorFadeOnAnimator.isStarted()) {
if (target == Display.STATE_ON) {
// If display state changed to on, proceed and stop the color fade and turn screen on.
mPendingScreenOff = false;
return;
}
}else if (mColorFadeOffAnimator.isStarted()){
if (target != Display.STATE_ON) {
return;
}
// If display state changed to on, proceed and stop the color fade and turn screen on.
mPendingScreenOff = false;
}
// If we were in the process of turning off the screen but didn't quite

0 comments on commit 99893f0

Please sign in to comment.