Skip to content

Commit

Permalink
Fix keyguard is black background while screen turning off/on quickly
Browse files Browse the repository at this point in the history
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 Jun 29, 2017
1 parent 128ef13 commit 99893f0
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99893f0

Please sign in to comment.