Ensure surfaces only resize during relayout.

For clients which use an indeterminate measure spec in their
layout params (MATCH_PARENT). We could try and change their window size
due to a stack resize, before the client calls relayout. This isn't
safe as the client never had an opportunity to pause rendering, so it
could be in the middle of producing a frame for the old size to suddenly
find the buffer size change underneath it.

Bug: 28559097
Change-Id: I3982936fdf85c22def2f9c754d5508e029e4a84d
diff --git a/services/core/java/com/android/server/wm/WindowSurfaceController.java b/services/core/java/com/android/server/wm/WindowSurfaceController.java
index af47369..9646a49 100644
--- a/services/core/java/com/android/server/wm/WindowSurfaceController.java
+++ b/services/core/java/com/android/server/wm/WindowSurfaceController.java
@@ -454,6 +454,15 @@
         return mSurfaceY;
     }
 
+    float getWidth() {
+        return mSurfaceW;
+    }
+
+    float getHeight() {
+        return mSurfaceH;
+    }
+
+
     public void dump(PrintWriter pw, String prefix, boolean dumpAll) {
         if (dumpAll) {
             pw.print(prefix); pw.print("mSurface="); pw.println(mSurfaceControl);