From 81a1c176ba0b703626ad46707aae3c1c4c4c18c9 Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Mon, 4 Apr 2016 14:21:17 -0700 Subject: [PATCH] Add the app back to mOpeningApps if transition is unset but ready. This means a rotation is started while we have a transition pending, and startFreezingDisplayLocked() called mAppTransition.freeze() to cancel the transition by setting it to TRANSIT_UNSET but ready immediately. Screen unfreeze will wait for mOpeningApps to empty. handleAppTransitionReadyLocked() will remove the app from mOpeningApps once it's drawn, and allow screen to unfreeze. We don't add the app to mOpeningApps if the transition is neither set nor ready. We don't have any transtition and the app won't be removed from mOpeningApps. bug: 27784481 bug: 27391256 Change-Id: Id2c0759732593121769c402ae0c6edde3ebc7dc6 --- .../java/com/android/server/wm/WindowManagerService.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index b6e25eab99521..8f871b1057f8f 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -4292,9 +4292,13 @@ public class WindowManagerService extends IWindowManager.Stub wtoken.appDied = false; wtoken.removeAllWindows(); } else if (visible) { - mOpeningApps.add(wtoken); + if (!mAppTransition.isTransitionSet() && mAppTransition.isReady()) { + // Add the app mOpeningApps if transition is unset but ready. This means + // we're doing a screen freeze, and the unfreeze will wait for all opening + // apps to be ready. + mOpeningApps.add(wtoken); + } wtoken.startingMoved = false; - // If the token is currently hidden (should be the common case), or has been // stopped, then we need to set up to wait for its windows to be ready. if (wtoken.hidden || wtoken.mAppStopped) { @@ -4338,6 +4342,7 @@ public class WindowManagerService extends IWindowManager.Stub } wtoken.inPendingTransaction = true; if (visible) { + mOpeningApps.add(wtoken); wtoken.mEnteringAnimation = true; } else { mClosingApps.add(wtoken);