Add a synchronous path when finishing a pre-existing recents animation

- If launcher repeatedly starts the recents animation, we try to finish
  the existing animation before starting the new one, but due to some
  ordering issues (see b/275561141) the subsequent starts can orphan
  the previous animation runner, which can result in no animation callbacks
  for either the previous animation (to cancel) or the new animation
  (to start).

  This change only attempts to reduce the likelihood of a second no-op
  transition by synchronously finishing the existing recents animation
  on the launcher side prior to starting the next animation.

  There is one case this doesn't handle, where if the previous
  onAnimationStart() has not been called back, then we can't directly
  call the controller to finish, and need to rely on the no-op handling
  on the shell transition side to handle the gesture.

Bug: 275561141
Test: Quickswitch and swipe up repeatedly
Change-Id: I820e26dc20fb1851ee0102ed8c114ce998d44999
2 files changed