Fixing misc issues that leads to black screen when pressing Home
- Make sure to clear usingTransferredAnimation flag together when
setting app animator's animation to null. Not clearing it will cause
setAppVisibility to not apply dummy animation (placeholder)
to a closing app token while it should, and the closing app token will
then exit early before the opening app is ready, since it doesn't have
any animation set. This causes a brief blank period.
- When app relayout to invisible, make sure to mark mWinAnimator's
mAnimating to true if we decided exit animation is running. Note that
even if we didn't actually apply the animation (which could happen if
the window is no longer visible by policy), if the app token itself is
under any animation, we need to mark mAnimating otherwise the clean up
code in FinishExit will not run, and the window will be stuck in
Exiting state.
- We no longer change mAnimatingExit flag in setAppVisibility(), but
wait for app's relayoutWindow calls to change it if applicable.
setAppVisibilty doesn't apply the animation until transition is good
to go. Setting the flag without the animation applied will disable
setTokenVisibilityLocked and relayoutWindow to actually apply the
animation, because they may think the window is no longer visible.
bug: 27391256
Change-Id: I292305847d742cdbb5ebe6aa8daa5d83bf65483b
5 files changed