Create surfacecontrol before layout in relayoutWindow

If there is no surfacecontrol, relayout is skipped. This is
often fine because a later surfaceplacement pass usually
happens; however, when combined with commitFinishDrawingLocked
being out-of-order with layout during traversal, a race can
happen where relayoutWindow creates the surface (after
surface placement) and then commitFinishDrawing runs immediately
after that causing a windowanimation to use non-laid-out
surface positions.

Bug: 174636007
Test: Use logging to verify that layout/surface-placement happen
      during relayoutWindow on a new window.
Change-Id: I05be878902995d421a0f073129ce1e86c03724f5
1 file changed