Fix a transition issue when starting an activity with CLEAR_TOP flag

If the app hooks the back key event to start the previous activity
with FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
flags in order to clear the top activity and bring the exist previous
activity to front,

The activity transition should playing the close animation
instead the initiated open animation made by startActivity.

Fix: 306166200
Test: atest ShellTransitionTests#\
         testCloseTransitAnimationWhenClosingChangesExists
Change-Id: Ib287c224368827e87c7ec280980e4662368cee6f
4 files changed