OSDN Git Service

ViewRoot: Ensure we release surface from setWindowStopped.
authorRobert Carr <racarr@google.com>
Thu, 12 Apr 2018 19:33:23 +0000 (12:33 -0700)
committerRobert Carr <racarr@google.com>
Thu, 12 Apr 2018 23:08:42 +0000 (16:08 -0700)
commit35274cb0ce90ce4381e534d1c04c9d919eb588fc
tree477b811da65f6e5e1b5c2a2ae2337dfce09c2976
parent8ec69c71a73f00b7900ae35cd7e40e4c12ab8af4
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.

Bug: 62536731
Test: For the monkeys.
Change-Id: I65939a29db4db70c6eb6bc4b258a9ed09a86e0ce
core/java/android/view/ViewRootImpl.java