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
1 file changed