diff options
5 files changed, 14 insertions, 4 deletions
diff --git a/core/java/android/view/IWindow.aidl b/core/java/android/view/IWindow.aidl index 9cf3759..acad496 100644 --- a/core/java/android/view/IWindow.aidl +++ b/core/java/android/view/IWindow.aidl @@ -83,7 +83,8 @@ oneway interface IWindow { * The window is beginning to animate. The application should stop drawing frames until the * window is not animating anymore, indicated by being called {@link #windowEndAnimating}. * - * @param remainingFrameCount how many frames the app might still draw before stopping drawing + * @param remainingFrameCount how many frames the app might still draw before stopping drawing; + * pass -1 to let it continue drawing */ void onAnimationStarted(int remainingFrameCount); diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 6d0d788..09d7a21 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -5327,7 +5327,7 @@ public final class ViewRootImpl implements ViewParent, } public void handleDispatchWindowAnimationStarted(int remainingFrameCount) { - if (!mDrawDuringWindowsAnimating) { + if (!mDrawDuringWindowsAnimating && remainingFrameCount != -1) { mRemainingFrameCount = remainingFrameCount; mWindowsAnimating = true; } diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java index 76baaa7..0bc6d22 100644 --- a/services/core/java/com/android/server/wm/WindowAnimator.java +++ b/services/core/java/com/android/server/wm/WindowAnimator.java @@ -272,8 +272,9 @@ public class WindowAnimator { try { if (anyAnimating && !anyWasAnimating) { - win.mClient.onAnimationStarted( - winAnimator.mKeyguardGoingAwayAnimation ? 1 : 0); + win.mClient.onAnimationStarted(winAnimator.mAnimatingMove ? -1 + : winAnimator.mKeyguardGoingAwayAnimation ? 1 + : 0); } else if (!anyAnimating && anyWasAnimating) { win.mClient.onAnimationStopped(); } diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index fc86920..03ca95a 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -10002,6 +10002,7 @@ public class WindowManagerService extends IWindowManager.Stub winAnimator.mAnimDw = w.mLastFrame.left - left; winAnimator.mAnimDh = w.mLastFrame.top - top; winAnimator.mAnimateMove = true; + winAnimator.mAnimatingMove = true; } //TODO (multidisplay): Accessibility supported only for the default display. diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index d818519..0532312 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -122,7 +122,13 @@ class WindowStateAnimator { // used. int mAnimDw; int mAnimDh; + + /** Is the next animation to be started a window move animation? */ boolean mAnimateMove = false; + + /** Are we currently running a window move animation? */ + boolean mAnimatingMove = false; + float mDsDx=1, mDtDx=0, mDsDy=0, mDtDy=1; float mLastDsDx=1, mLastDtDx=0, mLastDsDy=0, mLastDtDy=1; @@ -361,6 +367,7 @@ class WindowStateAnimator { mAnimating = false; mKeyguardGoingAwayAnimation = false; + mAnimatingMove = false; mLocalAnimating = false; if (mAnimation != null) { mAnimation.cancel(); |