Clean up StackAnimationController when bubbles removed
Fixes a memory leak with StackAnimationController not being removed from shell singleton FloatingContentCoordinator. StackAnimationController registers a FloatingContent instance in FloatingContentCoordinator when the first bubble is added. FloatingContent is an inner class of StackAnimationController and will hold a ref to the parent object. StackAnimationController unregisters the FloatContent instance when the last bubble is removed. For StackAnimationController to receive this information, it has to the active controller for the BubbleStackView PhysicsAnimationLayout. When bubbles are expanded, StackAnimationController is not the active controller. And it will not receive callbacks that a bubble view is removed. This means that it never unregisters the FloatinContent instance from FloatingContentCoordinator singleton. Updating the logic expose a new method from StackAnimationController so it can be notified explicitly when the last bubble is removed. Updating BubbleStackView to always notify StackAnimationController, even if it is not the active controller (bubbles expanded), that the last bubble has been removed. When StackAnimationController is notified that the last bubble is removed, it will unregister the FloatingContent from FloatingContentCoordinator. Bug: 432211683 Test: atest WMShellUnitTests:StackAnimationControllerTest Flag: EXEMPT, bugfix Change-Id: I3b938132685530e4641211a93ebfc4615798bc96
Loading
Please register or sign in to comment