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

Commit 21bab061 authored by Mady Mellor's avatar Mady Mellor
Browse files

Add a way to override the stack view expanded state

Have a bug where the stack view is already expanded when it's being
added back to the window. I haven't been able to figure out a clear
way this happens (suspect that the ime runnable isn't getting run
somehow so the stack view doesn't get collapsed before it's removed).

So this is an unfortunate band-aid fix. Hoping long term we can remove
the ime runnable being tied to collapsing/expanding (b/442010190)

Flag: com.android.wm.shell.fix_bubble_stack_view_expanded_when_added
Test: manual - add code to make stackview expanded incorrectly, remove
               it and add it back, verify that the expanded view
               doesn't show with stack collapsed & interactions with
               it should work normally
Bug: 417447385
Change-Id: I71f32171f8ec9a1f5b769d71b7b8042eec4f858e
parent 3cfed465
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1169,6 +1169,9 @@ public class BubbleController implements ConfigurationChangeListener,
                if (mStackView.isExpanded()) {
                    ProtoLog.w(WM_SHELL_BUBBLES,
                            "addToWindowManager - BubbleStackView is already expanded!");
                    if (Flags.fixBubbleStackViewExpandedWhenAdded()) {
                        mStackView.overrideCollapsed();
                    }
                }
                mWindowManager.addView(mStackView, mWmLayoutParams);
                mStackView.setOnApplyWindowInsetsListener((view, windowInsets) -> {
+8 −0
Original line number Diff line number Diff line
@@ -2542,6 +2542,14 @@ public class BubbleStackView extends FrameLayout
        }
    }

    /**
     * Fail-safe to set the expanded state to false.
     * See b/417447385.
     */
    void overrideCollapsed() {
        mIsExpanded = false;
    }

    /** Snaps the stack to its expanded state without animation. */
    void snapToExpanded() {
        setExpanded(/* shouldExpand= */ true, /* animateExpansion= */ false);