Update the starting window removal state based on transition events

- Also update the 'transition played' state when onTransitionStarting
or onTransitionFinished occurs.
- Uncertain trackers are now tracked more effectively using
onTransitionMerged, which moves them to the initial transition record.
Consequently, these trackers can be removed when either the initial
transition finishes or the transaction commits.
- Added tracing to record the duration a starting window is shown, from
addStartingWindow until removeStartingWindowInner. This duration
represents how long the system server wants to keep the starting window
on screen.

Flag: com.android.window.flags.remove_starting_in_transition
Bug: 310046998
Bug: 397353053
Test: atest StartingWindowController
Test: atest FlickerTestsQuickswitch-QuickSwitchBetweenTwoAppsBackTest
Test: atest FlickerTestsActivityEmbedding
Change-Id: I96ed9d66f6faaf9bb0adeb5f26ed235cc5e0d788
2 files changed