Avoid calling detachChildren from onAppVisibilityChanged

When entering PiP we use mDeferHidingClient to prevent sending
the app visibility to the client before it has a chance to enter PiP.
However, WindowState#onAppVisibilityChanged is not guarded by this
so we could end up detaching children when we mean to enter PiP. Instead
only detach children from sendAppVisibilityToClients so that we are
correctly guarded by the mDeferHidingClient flag.

Bug: 77294187
Test: Manual. go/wm-smoke.
Change-Id: Ia9df12fadf3c48d0704e9e6d7e98a6e9cf46783d
This commit is contained in:
Robert Carr
2018-03-30 15:39:58 -07:00
parent 825581a3ee
commit b6d4e2be31

View File

@@ -1691,13 +1691,6 @@ 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 =