OSDN Git Service

Revert "Refactoring: two more calls for WindowState.setDisplayLayoutNeeded."
authorFilip Gruszczynski <gruszczy@google.com>
Wed, 30 Sep 2015 22:02:57 +0000 (22:02 +0000)
committerFilip Gruszczynski <gruszczy@google.com>
Wed, 30 Sep 2015 22:02:57 +0000 (22:02 +0000)
This reverts commit b3acc92bff3594b73eb80fad2a5fe79541e4a095.

Change-Id: Ief0f3ca1d45be5838a826494f64c65776868d188

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

index d2fed06..6d0d85f 100644 (file)
@@ -3023,6 +3023,7 @@ public class WindowManagerService extends IWindowManager.Stub
 
         final long origId = Binder.clearCallingIdentity();
         synchronized(mWindowMap) {
+            DisplayContent displayContent = null;
             WindowToken wtoken = mTokenMap.remove(token);
             if (wtoken != null) {
                 boolean delayed = false;
@@ -3032,6 +3033,7 @@ public class WindowManagerService extends IWindowManager.Stub
 
                     for (int i=0; i<N; i++) {
                         WindowState win = wtoken.windows.get(i);
+                        displayContent = win.getDisplayContent();
 
                         if (win.mWinAnimator.isAnimating()) {
                             delayed = true;
@@ -3046,7 +3048,9 @@ public class WindowManagerService extends IWindowManager.Stub
                                         WindowManagerPolicy.TRANSIT_EXIT);
                             }
                             changed = true;
-                            win.setDisplayLayoutNeeded();
+                            if (displayContent != null) {
+                                displayContent.layoutNeeded = true;
+                            }
                         }
                     }
 
index 594090c..a32b171 100644 (file)
@@ -1819,10 +1819,15 @@ class WindowStateAnimator {
                     c.mAttachedHidden = false;
                     if (c.mWinAnimator.mSurfaceControl != null) {
                         c.mWinAnimator.performShowLocked();
-                        // It hadn't been shown, which means layout not performed on it, so now we
-                        // want to make sure to do a layout.  If called from within the transaction
-                        // loop, this will cause it to restart with a new layout.
-                        c.setDisplayLayoutNeeded();
+                        // It hadn't been shown, which means layout not
+                        // performed on it, so now we want to make sure to
+                        // do a layout.  If called from within the transaction
+                        // loop, this will cause it to restart with a new
+                        // layout.
+                        final DisplayContent displayContent = c.getDisplayContent();
+                        if (displayContent != null) {
+                            displayContent.layoutNeeded = true;
+                        }
                     }
                 }
             }