Fix an issue where state wasn't set when animation interrupted
If the timing is right, when a new bubble is added to the stack while
it's in the midst of collapsing (or last bubble being removed after
being expanded), the new bubble becomes the "selected" bubble which
updates the view in ExpandedAnimationController -- when the view there
is updated, any ongoing animation is canceled.
When the animation is canceled, the collapseBackToStack runnable
may not get run as it depends on a % of the animation completing
before running in an animation update listener.
Setting the active controller for the physics animation layout
is dependent on this runnable being run -- resulting in inconsistent
state between the stack being expanded & the controller on the layout.
The fix for this is to run the runnable on cancel if it wasn't
already run.
Flag: com.android.wm.shell.multitasking.fix_bubbles_cancel_animation
Test: manual - post 2 bubbles every second and try to expand / dismiss
them -- bubbles shouldn't get stuck on screen
Test: atest ExpandedViewAnimationControllerTest
Bug: 420487074
Change-Id: Iaeddaa8f139ab4b568c3622bde0e1af3d04928c7
Loading
Please register or sign in to comment