Finish fixed rotation while the task has done transition

Assume an activity A is started in portrait and it starts another
landscape activity B immediately in the same task. If fixed rotation
applies for this case, the starting window will transfer across
different orientations that may look flickering. And because the
transformed activity is the B, the transition finished event of A
cannot match B that causes the display stays in old orientation.

This change makes the case use normal rotation animation to avoid the
flickering, and still handles the case that the transition is done
but the notified record is the first activity to avoid other similar
cases to miss the orientation update.

Fixes: 158112625
Test: DisplayContentTests#testFinishFixedRotationNoAppTransitioningTask

Change-Id: I559b0881463e379c17e35b7cfd96948feb36bf4b
2 files changed