Merge "Don't log bad surface size before layout is done."
diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java
index 539810d..cd82a5f 100644
--- a/services/core/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java
@@ -710,11 +710,13 @@
 
         // Something is wrong and SurfaceFlinger will not like this, try to revert to sane values.
         if (mTmpSize.width() < 1) {
-            Slog.w(TAG, "Width of " + w + " is not positive " + mTmpSize.width());
+            if (!mWin.mLayoutNeeded) Slog.w(TAG,
+                    "Width of " + w + " is not positive " + mTmpSize.width());
             mTmpSize.right = mTmpSize.left + 1;
         }
         if (mTmpSize.height() < 1) {
-            Slog.w(TAG, "Height of " + w + " is not positive " + mTmpSize.height());
+            if (!mWin.mLayoutNeeded) Slog.w(TAG,
+                    "Height of " + w + " is not positive " + mTmpSize.height());
             mTmpSize.bottom = mTmpSize.top + 1;
         }