Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab886f58 authored by Daniel Sandler's avatar Daniel Sandler Committed by Craig Mautner
Browse files

Don't do closing animation on an opening app.

Check to make sure that the closing wallpaper animation isn't used on
an opening app token. This can happen when a previous animation hasn't
completed when the next animation is starting.

Fixes bug 6557751.

Change-Id: Ib8bd4dd7de1e361f6fc0cab11d0997e70f9ddd0b
parent 51df04b9
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -3258,13 +3258,15 @@ public class WindowManagerService extends IWindowManager.Stub
            if (mNextAppTransitionType == ActivityOptions.ANIM_CUSTOM) {
                a = loadAnimation(mNextAppTransitionPackage, enter ?
                        mNextAppTransitionEnter : mNextAppTransitionExit);
                if (DEBUG_ANIM) Slog.v(TAG, "applyAnimation: wtoken=" + wtoken
                if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
                        "applyAnimation: wtoken=" + wtoken
                        + " anim=" + a + " nextAppTransition=ANIM_CUSTOM"
                        + " transit=" + transit + " Callers " + Debug.getCallers(3));
            } else if (mNextAppTransitionType == ActivityOptions.ANIM_SCALE_UP) {
                a = createScaleUpAnimationLocked(transit, enter);
                initialized = true;
                if (DEBUG_ANIM) Slog.v(TAG, "applyAnimation: wtoken=" + wtoken
                if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
                        "applyAnimation: wtoken=" + wtoken
                        + " anim=" + a + " nextAppTransition=ANIM_SCALE_UP"
                        + " transit=" + transit + " Callers " + Debug.getCallers(3));
            } else if (mNextAppTransitionType == ActivityOptions.ANIM_THUMBNAIL ||
@@ -3273,7 +3275,7 @@ public class WindowManagerService extends IWindowManager.Stub
                a = createThumbnailAnimationLocked(transit, enter, false, delayed);
                initialized = true;

                if (DEBUG_ANIM) {
                if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
                    String animName = delayed ? "ANIM_THUMBNAIL_DELAYED" : "ANIM_THUMBNAIL";
                    Slog.v(TAG, "applyAnimation: wtoken=" + wtoken
                            + " anim=" + a + " nextAppTransition=" + animName
@@ -3334,7 +3336,8 @@ public class WindowManagerService extends IWindowManager.Stub
                        break;
                }
                a = animAttr != 0 ? loadAnimation(lp, animAttr) : null;
                if (DEBUG_ANIM) Slog.v(TAG, "applyAnimation: wtoken=" + wtoken
                if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
                        "applyAnimation: wtoken=" + wtoken
                        + " anim=" + a
                        + " animAttr=0x" + Integer.toHexString(animAttr)
                        + " transit=" + transit + " Callers " + Debug.getCallers(3));
@@ -8042,6 +8045,7 @@ public class WindowManagerService extends IWindowManager.Stub

            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
                    "New wallpaper target=" + mWallpaperTarget
                    + ", oldWallpaper=" + oldWallpaper
                    + ", lower target=" + mLowerWallpaperTarget
                    + ", upper target=" + mUpperWallpaperTarget);
            int foundWallpapers = 0;
@@ -8108,7 +8112,7 @@ public class WindowManagerService extends IWindowManager.Stub
                }
                if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
                        "New transit: " + transit);
            } else if (oldWallpaper != null) {
            } else if ((oldWallpaper != null) && !mOpeningApps.contains(oldWallpaper.mAppToken)) {
                // We are transitioning from an activity with
                // a wallpaper to one without.
                transit = WindowManagerPolicy.TRANSIT_WALLPAPER_CLOSE;
@@ -8133,7 +8137,6 @@ public class WindowManagerService extends IWindowManager.Stub
            AppWindowToken topOpeningApp = null;
            int topOpeningLayer = 0;

            // TODO(cmautner): Move to animation side.
            NN = mOpeningApps.size();
            for (i=0; i<NN; i++) {
                AppWindowToken wtoken = mOpeningApps.get(i);