Do not set report-orientation-changed for window without surface

Otherwise the state may remain to the next new surface when
the window becomes visible, and it will get ViewRootImpl
#mForceNextWindowRelayout=true from WindowState#resize. And then
its pre-allocated buffers from ThreadedRenderer#allocateBuffers
will be dropped by ThreadedRenderer#updateSurface. And then
allocate again in each frame, which is very wasteful.

Bug: 228223340
Test: 1. Launch a landscape app from portrait launcher.
      2. Use command "record_android_trace sched view wm am gfx".
      3. Swipe up to return to launcher.
      4. The trace of launcher should not show "setSurface".
         And there should not have "allocateHelper" in "DrawFrames".
Change-Id: If66cde35837b0362ca51eee018d8828416d118ec
2 files changed