From e4874a1a4d51e9ecd3c8dfca1321ef4f8fab9e7e Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Wed, 11 May 2016 14:57:36 -0700 Subject: [PATCH] Don't notify windows of resize during PIP animation. We are notifying windows of resize as the frame moves (even though the size does not change) during the pinned animation, confusing and upsetting the client. We do want to notify it of the one resize at the beginning or end of the animation, so we can't just block reportResized on bounds animating. Luckily the other area that adds windows to reportResized (Task) is smart enough to only do so if the size has actually changed and not just movement, so we let those reports go through and block ones initiating from here (which doesn't perform a check that the size has actually changed). Bug: 28559097 Change-Id: If1f983e7cc875175ce1d098c385478a9922dea67 --- .../com/android/server/wm/WindowManagerService.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 9954f6217d097..70061fb1896fc 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -9171,6 +9171,18 @@ public class WindowManagerService extends IWindowManager.Stub void updateResizingWindows(final WindowState w) { final WindowStateAnimator winAnimator = w.mWinAnimator; if (w.mHasSurface && w.mLayoutSeq == mLayoutSeq && !w.isGoneForLayoutLw()) { + final Task task = w.getTask(); + // In the case of stack bound animations, the window frames + // will update (unlike other animations which just modifiy + // various transformation properties). We don't want to + // notify the client of frame changes in this case. Not only + // is it a lot of churn, but the frame may not correspond + // to the surface size or the onscreen area at various + // phases in the animation, and the client will become + // sad and confused. + if (task != null && task.mStack.getBoundsAnimating()) { + return; + } w.setInsetsChanged(); boolean configChanged = w.isConfigChanged(); if (DEBUG_CONFIGURATION && configChanged) {