diff options
author | Wale Ogunwale <ogunwale@google.com> | 2015-07-16 17:00:58 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-07-16 17:01:15 +0000 |
commit | 1181323230478e3027bbabbbaf769dcd4a11a0e4 (patch) | |
tree | 1b0edbf2eca8478e06609ffb3a0575eae26e5d28 /services/core/java | |
parent | ba4f0757779d6e91e52ebee0fd4c847b673a69e2 (diff) | |
parent | b60c0f616c0863e3970bcacd82a793e561d99689 (diff) | |
download | frameworks_base-1181323230478e3027bbabbbaf769dcd4a11a0e4.zip frameworks_base-1181323230478e3027bbabbbaf769dcd4a11a0e4.tar.gz frameworks_base-1181323230478e3027bbabbbaf769dcd4a11a0e4.tar.bz2 |
Merge "Animate app exit for cases where the app is already hidden before transition" into mnc-dev
Diffstat (limited to 'services/core/java')
-rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index bc63c69..c776e8f 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -2730,10 +2730,10 @@ public class WindowManagerService extends IWindowManager.Stub wasVisible = win.isWinVisibleLw(); if (wasVisible) { - int transit = WindowManagerPolicy.TRANSIT_EXIT; - if (win.mAttrs.type == TYPE_APPLICATION_STARTING) { - transit = WindowManagerPolicy.TRANSIT_PREVIEW_DONE; - } + final int transit = (!startingWindow) + ? WindowManagerPolicy.TRANSIT_EXIT + : WindowManagerPolicy.TRANSIT_PREVIEW_DONE; + // Try starting an animation. if (win.mWinAnimator.applyAnimationLocked(transit, false)) { win.mExiting = true; @@ -2745,12 +2745,13 @@ public class WindowManagerService extends IWindowManager.Stub } } final AppWindowToken appToken = win.mAppToken; + final boolean isAnimating = win.mWinAnimator.isAnimating(); // The starting window is the last window in this app token and it isn't animating. // Allow it to be removed now as there is no additional window or animation that will // trigger its removal. final boolean lastWinStartingNotAnimating = startingWindow && appToken!= null - && appToken.allAppWindows.size() == 1 && !win.mWinAnimator.isAnimating(); - if (!lastWinStartingNotAnimating && (win.mExiting || win.mWinAnimator.isAnimating())) { + && appToken.allAppWindows.size() == 1 && !isAnimating; + if (!lastWinStartingNotAnimating && (win.mExiting || isAnimating)) { // The exit animation is running... wait for it! win.mExiting = true; win.mRemoveOnExit = true; @@ -4527,7 +4528,10 @@ public class WindowManagerService extends IWindowManager.Stub } wtoken.willBeHidden = false; - if (wtoken.hidden == visible) { + // Allow for state changes and animation to be applied if token is transitioning + // visibility state or the token was marked as hidden and is exiting before we had a chance + // to play the transition animation. + if (wtoken.hidden == visible || (wtoken.hidden && wtoken.mIsExiting)) { boolean changed = false; if (DEBUG_APP_TRANSITIONS) Slog.v( TAG, "Changing app " + wtoken + " hidden=" + wtoken.hidden |