Don't log bad surface size before layout is done.

The surface dimensions are calculated when the surface is created.
This might happen before the window had a chance to relayout itself,
so the dimensions passed to the surface will be wrong. This doesn't
happen on subsequent recreations of the surface, because the window
has previous dimensions, but will produce a bad log when the surface
is first created.

Bug: 26061934
Change-Id: I670bbb6d64f5ec7efabe3bd838a116a1d48e74f2
diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java
index 7cd67d0..9b18265 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;
         }