diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index c14e32e924678..e7aba6dfd12a3 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -4065,6 +4065,7 @@ public class WindowManagerService extends IWindowManager.Stub // * or the token was marked as hidden and is exiting before we had a chance to play the // transition animation // * or this is an opening app and windows are being replaced. + boolean visibilityChanged = false; if (wtoken.hidden == visible || (wtoken.hidden && wtoken.mIsExiting) || (visible && wtoken.waitingForReplacement())) { boolean changed = false; @@ -4131,6 +4132,7 @@ public class WindowManagerService extends IWindowManager.Stub } wtoken.hidden = wtoken.hiddenRequested = !visible; + visibilityChanged = true; if (!visible) { unsetAppFreezingScreenLocked(wtoken, true, true); } else { @@ -4168,6 +4170,13 @@ public class WindowManagerService extends IWindowManager.Stub } } + if (visibilityChanged && visible && !delayed) { + // The token was made immediately visible, there will be no entrance animation. We need + // to inform the client the enter animation was finished. + wtoken.mEnteringAnimation = true; + mActivityManagerAppTransitionNotifier.onAppTransitionFinishedLocked(wtoken.token); + } + return delayed; }