OSDN Git Service

Fix window animation flickering
authorJorim Jaggi <jjaggi@google.com>
Mon, 20 Jul 2015 18:54:26 +0000 (11:54 -0700)
committerJorim Jaggi <jjaggi@google.com>
Mon, 20 Jul 2015 23:31:25 +0000 (23:31 +0000)
Bug: 22502673
Change-Id: I939e5840e10f3c0582148a5a01908076f994ae69

services/core/java/com/android/server/wm/WindowAnimator.java

index 7630178..85a9624 100644 (file)
@@ -500,7 +500,13 @@ public class WindowAnimator {
                         mPostKeyguardExitAnimation.getStartOffset(),
                         mPostKeyguardExitAnimation.getDuration());
                 mKeyguardGoingAway = false;
-            } else if (mPostKeyguardExitAnimation.hasEnded()) {
+            }
+            // mPostKeyguardExitAnimation might either be ended normally, cancelled, or "orphaned",
+            // meaning that the window it was running on was removed. We check for hasEnded() for
+            // ended normally and cancelled case, and check the time for the "orphaned" case.
+            else if (mPostKeyguardExitAnimation.hasEnded()
+                    || mCurrentTime - mPostKeyguardExitAnimation.getStartTime()
+                            > mPostKeyguardExitAnimation.getDuration()) {
                 // Done with the animation, reset.
                 if (DEBUG_KEYGUARD) Slog.v(TAG, "Done with Keyguard exit animations.");
                 mPostKeyguardExitAnimation = null;