Fix flicker when transiting activities without animation.

In O, we added the logic surrounding this diff, to handle cases where
stack visibility changes but there is no app transition (e.g. docked
and pinned stack dismissal). We need to be careful to not immediately
hide the Surfaces in the case where there is a transition though. It's possible
there is a transition, even if delayed is false, in the cases where we
have a custom null animation.

Bug: 38031364
Test: Repro from bug. Dismiss docked stack ~10x. Dismiss pinned stack ~10x. go/wm-smoke
Change-Id: I9dac7b9a4794787187c8e9226ab9d8ded282c116
1 file changed