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

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

Limit cases when we check if a bubble moves to split

BubblesTransitionObserver checks each transition to see if a bubbled
task is moving to split.
Add a check that we only check for open type transitions and if we have
bubbles.

Bug: 418591790
Test: atest WMShellUnitTests:BubblesTransitionObserverTest
Flag: com.android.wm.shell.enable_create_any_bubble
Change-Id: I93936ea74ae5650f0919094df3ee7924af3c0b2b
parent cf04bb71
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -72,9 +72,11 @@ public class BubblesTransitionObserver implements Transitions.TransitionObserver
            @NonNull SurfaceControl.Transaction finishTransaction) {
        collapseBubbleIfNeeded(info);
        if (BubbleAnythingFlagHelper.enableCreateAnyBubble()) {
            if (TransitionUtil.isOpeningType(info.getType()) && mBubbleData.hasBubbles()) {
                removeBubbleIfLaunchingToSplit(info);
            }
        }
    }

    private void collapseBubbleIfNeeded(@NonNull TransitionInfo info) {
        // --- Pre-conditions (Loop-invariant checks) ---
+1 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ class BubblesTransitionObserverTest : ShellTestCase() {
    private val bubbleData = mock<BubbleData> {
        on { isExpanded } doReturn true
        on { selectedBubble } doReturn bubble
        on { hasBubbles() } doReturn true
    }
    private val bubbleController = mock<BubbleController> {
        on { isStackAnimating } doReturn false