Fix ANR

One confirmed source of ANR's is the following scenario:
- Activity exits with animation. setClientHidden(true) gets
deferred.
- AppWindowContainerControll.setVisibility(true) gets called.
isHidden() = true at that point because it's now waiting to be
opened again.
- onAnimationFinished gets called. setClientHidden(true) gets
called. Because isHidden()=true but hiddenRequested=false
- Now we wait for the app transition timeout, which could also
lead to an ANR...

Fix this by using requested visibility to update client hidden
state.

There is another potential source of weirdness where we defer
hiding the client but don't actual run an app animation, never
reaching AppWindowToken.onAnimationFinished. Fix this by checking
isReallyAnimating locally on the object, instead of also including
children.

Test: go/wm-smoke
Test: Open app, close app, reopen about when the transition is
finished. Make sure we are not hitting the app transition timeout
in this case.
Fixes: 72160186

Change-Id: Icd6fe7f70ce2ae9eee6235a65d1fd72924a691c2
1 file changed