SurfaceView: Careful with FLAG_PRESERVE_GEOMETRY.

We need to be careful about stripping FLAG_PRESERVE_GEOMETRY
as it breaks render thread sync. Notably we don't need
to strip it in the case of mUpdateWindowNeeded, this just signals
that Window#resized has been called, or something similar, but if there
has been no actual size change, then we can leave the geometry to
the render thread. This particularly manifests in rotation scenarios
where the SurfaceView will receive resize ahead of the app receiving
a configuration change.

Bug: 28823590
Change-Id: Ie2bbe7d9bd9f0a5ab64a08776bae7344eaecb605
diff --git a/core/java/android/view/ b/core/java/android/view/
index 17834fb..6a01698 100644
--- a/core/java/android/view/
+++ b/core/java/android/view/
@@ -498,7 +498,7 @@
                               | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                               | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
-                if (!creating && !force && !mUpdateWindowNeeded && !sizeChanged) {
+                if (!creating && !force && !sizeChanged) {
                     mLayout.privateFlags |=
                 } else {