Correct dissapearing SurfaceView during exit animations.

We were missing a call to detachChildren in the case
that the visibility change originates from AM (rather than relayout).
Thus we were racing relayout with the client to detach fast enough.
Detach before notifying the client of window visibility changes.

Test: Slow down animation speed. Open close SV app (say Chrome). No flashes.
Change-Id: Ibf027c2ca295f25765ba95b36c1346a715f3bc6e
This commit is contained in:
Robert Carr
2017-03-01 13:13:45 -08:00
parent 555bf41049
commit 026a6c45e7

View File

@@ -1528,6 +1528,13 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
return changed;
}
// Next up we will notify the client that it's visibility has changed.
// We need to prevent it from destroying child surfaces until
// the animation has finished.
if (!visible && isVisibleNow()) {
mWinAnimator.detachChildren();
}
if (visible != isVisibleNow()) {
if (!runningAppAnimation) {
final AccessibilityController accessibilityController =