Clean up the controller reference after execution.

After making the controller a member val in ag/30280320, the dispose
function was cleaning up the delegate but views were still being leaked
by this controller reference.

This CL addresses this issue for instances that do leak (i.e. when using
the Runner directly in ActivityOptions) while keeping the transition
functional for instances where it is simply registered with the
RemoteTransitionHandler.

Bug: 379268680
Flag: com.android.systemui.shared.return_animation_framework_library
Flag: com.android.systemui.shared.return_animation_framework_long_lived
Test: atest ActivityTransitionAnimatorTest
Change-Id: I2e3d9889e8cd69bc29a5bc2891dd6ab6784f7869
2 files changed