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

Commit 3fe38517 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick
Browse files

Window manager: cancel animations before losing references to them.

For possible future changes to android.view.animation.Animation to tie
into StrictMode's animation annotations on violations.

Change-Id: I3a23fa9bd5edb0500586bb0e341f83f998b28ae7
parent d57c14f9
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -2736,8 +2736,11 @@ public class WindowManagerService extends IWindowManager.Stub
                displayed = !win.isVisibleLw();
                if (win.mExiting) {
                    win.mExiting = false;
                    if (win.mAnimation != null) {
                        win.mAnimation.cancel();
                        win.mAnimation = null;
                    }
                }
                if (win.mDestroying) {
                    win.mDestroying = false;
                    mDestroySurface.remove(win);
@@ -6903,6 +6906,7 @@ public class WindowManagerService extends IWindowManager.Stub
            if (mAnimation != null) {
                mAnimating = true;
                mLocalAnimating = false;
                mAnimation.cancel();
                mAnimation = null;
            }
        }
@@ -7174,6 +7178,7 @@ public class WindowManagerService extends IWindowManager.Stub
                        // starting window, so there is no need for it to also
                        // be doing its own stuff.
                        if (mAnimation != null) {
                            mAnimation.cancel();
                            mAnimation = null;
                            // Make sure we clean up the animation.
                            mAnimating = true;
@@ -7219,7 +7224,11 @@ public class WindowManagerService extends IWindowManager.Stub
                    if (DEBUG_ANIM) Slog.v(
                        TAG, "Finished animation in " + this +
                        " @ " + currentTime);

                    if (mAnimation != null) {
                        mAnimation.cancel();
                        mAnimation = null;
                    }
                    //WindowManagerService.this.dump();
                }
                mHasLocalTransformation = false;
@@ -7248,6 +7257,7 @@ public class WindowManagerService extends IWindowManager.Stub
                // clear it and make sure we run the cleanup code.
                mAnimating = true;
                mLocalAnimating = true;
                mAnimation.cancel();
                mAnimation = null;
            }

@@ -7262,7 +7272,10 @@ public class WindowManagerService extends IWindowManager.Stub

            mAnimating = false;
            mLocalAnimating = false;
            if (mAnimation != null) {
                mAnimation.cancel();
                mAnimation = null;
            }
            mAnimLayer = mLayer;
            if (mIsImWindow) {
                mAnimLayer += mInputMethodAnimLayerAdjustment;