Suppress app transition while recents is running
This fixes conflict between app transition and recents animation in the
following scenario.
1) App transition animation finishes after app closing animation, which
is controlled by recents, finishes.
During the app closing animation, recents makes the closing app surface
invisible, but app transition animation overrides it to visible again.
This causes a flicker.
2) App transition starts during recents animation.
When a user launches an activity, and immediately after that, swipes up
the screen to close the app. Or a user launches an ChooserActivity on
top of other activity, and swipes up to move back to home.
While recents is running, we assume animation on tasks is controlled by
recents, and visibility is commited without animation after recents
animation finishes. However starting app transition during recents
breaks this assumption, which ends up with playing one more unexpected
closing animation (so users see closing animation twice).
This change also obsolute the logic which exludes launcher activity from
app transition while recents animation is running, since app transition
is delayed until recents animation finishes.
Bug: 223499269
Bug: 231669960
Bug: 232060413
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. Launch photo app.
2. Take screenshot.
3. Hit share icon to share the screenshot.
4. Swipe up from the bottom.
5. Verify photo app closes.
Change-Id: I264b0daf1118b75fae481f0251ed50b556f27c5f
3 files changed