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

Commit 6831ac62 authored by Liran Binyamin's avatar Liran Binyamin
Browse files

Fix crash when reordering overflow

Bug: 416834364
Flag: EXEMPT bug fix
Test: treehugger
Change-Id: I51820f7bd6678f88e7b65365e4d4afc7f516242e
parent ea3af434
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();
    }