From 7021174287eeb9447cb5a2bf7b17c5588db76133 Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Thu, 28 Apr 2016 18:27:53 -0700 Subject: [PATCH] Do not change surface properties when waiting for transition to ready Window could become drawn before transition is ready, when transition is waiting for the animation spec. If we show the surface too early, one or more frame will be shown with wrong scale. bug: 28296945 bug: 27742244 Change-Id: I34e84ed8a37ecdb71eb975351f1ee39d14dfba25 --- .../com/android/server/wm/WindowStateAnimator.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 1493bc73a17f8..e3194074f7926 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -1441,6 +1441,18 @@ class WindowStateAnimator { return; } + // Do not change surface properties of opening apps if we are waiting for the + // transition to be ready. transitionGoodToGo could be not ready even after all + // opening apps are drawn. It's only waiting on isFetchingAppTransitionsSpecs() + // to get the animation spec. (For example, go into Recents and immediately open + // the same app again before the app's surface is destroyed or saved, the surface + // is always ready in the whole process.) If we go ahead here, the opening app + // will be shown with the full size before the correct animation spec arrives. + if (mService.mAppTransition.isReady() && isDummyAnimation() && + mService.mOpeningApps.contains(w.mAppToken)) { + return; + } + boolean displayed = false; computeShownFrameLocked();