Exclude launcher from app transition animation while recents is running.

Changed approach to handle conflict between app transition and recents.

In order to fix flicker which happens when recents and app transition
start in a short time, we delayed app transition while recents was
running. However this approach brought side effects such as b/232984498.

When recents starts, we just want to wait that the launcher activitiy
finishes rendering and commit its visibility without animation. Added a
flag DisplayContent#mExcludeLauncherFromAnimation flag, so that we can
now explicity declare whether we want to apply animation on the launcher
or not.

Bug: 223499269
Bug: 231711212
Bug: 232984498
Test: atest com.android.server.wm.AppTransitionTests
Test: atest AppTransitionTest + manual tests
  Test 1
   1. Launch Gmail app
   2. Click icon on the bottom tab (e.g. Chat)
   3. Swipe up from the bottom (immediately after step 2)
   4. Verify closing animation only plays once
  Test 2
   1. Launch "Google TV"
   2. Play a trailer
   3. Full screen and PIP mode switch twice
   4. Verify PIP window is shown
  Test 3
   1. Change phone to portlait mode
   2. Launch Photo app
   3. Swipe up from the bottom
   4. Verify no rotation animation on the launcher
  Test 4
   1. Install 3P launcher and set it default.
   2. Launch Gmail app
   3. Swipe up to go back home
   4. Launch Chrome app
   5. Swipe up and hold to go to overview.
   6. Scroll to Gmail app and click.
   7. Verify Gmail app is launched without delay.
Change-Id: I0ccb99479684d17453ce57e8797024c0cd233ac3
3 files changed