OSDN Git Service

Don't notify windows of resize during PIP animation.
authorRobert Carr <racarr@google.com>
Wed, 11 May 2016 21:57:36 +0000 (14:57 -0700)
committerRobert Carr <racarr@google.com>
Thu, 12 May 2016 18:26:47 +0000 (11:26 -0700)
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

services/core/java/com/android/server/wm/WindowManagerService.java

index 9954f62..70061fb 100644 (file)
@@ -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) {