ViewRoot: Ensure we release surface from setWindowStopped.
Otherwise, we may attempt to reinitialize the ThreadedRenderer with
a Surface which is not actually valid, e.g. from handleWindowFocusChanged.
Entering a code path where the threaded renderer does not heed the
stopped signal. This change ensures isValid returns false when the Surface
is not valid preventing us from calling initialize/initializeIfNeeded, or
udpateSurface. Unlike a previous iteration of this CL, we take care to do so
after invoking the WindowStopped callbacks so that SurfaceView has
a chance to tear down.
Test: go/wm-smoke. More extensive manual testing.
Bug: 62536731
Change-Id: If5e51f8aef7957ad87a23015fe100095f9502bc9
1 file changed