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

Commit 380cbdd7 authored by Liran Binyamin's avatar Liran Binyamin Committed by Android (Google) Code Review
Browse files

Merge "Fix crash when reordering overflow" into main

parents 22a6767a 6831ac62
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -1577,9 +1577,18 @@ public class BubbleStackView extends FrameLayout
    private void updateOverflow() {
        mBubbleOverflow.update();
        if (mShowingOverflow) {
            mBubbleContainer.reorderView(mBubbleOverflow.getIconView(),
            View overflow = mBubbleOverflow.getIconView();
            if (overflow != null) {
                ViewGroup parent = (ViewGroup) overflow.getParent();
                if (parent != null && parent != mBubbleContainer) {
                    Log.w(TAG, "Found an unexpected parent for the overflow icon before "
                            + "reordering. Removing it directly. Parent = " + parent);
                    parent.removeView(overflow);
                }
                mBubbleContainer.reorderView(overflow,
                        mBubbleContainer.getChildCount() - 1 /* index */);
            }
        }
        updateOverflowVisibility();
    }