Implement early animation cancel thru merge

Upon receiving a merge signal on expand PiP,
end the animation early and finish the current
transition.

Also make sure to clear mFinishCallback cache
before calling onTransitionFinish(). Otherwise,
we might have a merge candidate come in and cache its own
finishCallback before we clear it.

This should fix issues we have been having with PinnedStackTests,
where some transitions would be left unfinished causing breaks.

Bug: 379390590
Flag: com.android.wm.shell.enable_pip2
Test: atest PinnedStackTests
Change-Id: I14fe9f845c8ee5e039213fb823dbf07f1663afe1
1 file changed