Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9bce5b1 authored by Ats Jenk's avatar Ats Jenk
Browse files

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
parent 9301bb86
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment