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

Commit f34ea0a2 authored by mpodolian's avatar mpodolian
Browse files

Ensure non null references for animateReorder() method.

Although I couldn't determine why BubbleController used
mBubbleStackViewCallback instead of mBubbleBarViewCallback, I've added a
safeguard to prevent the System UI from crashing with a
NullPointerException (NPE) during bubble traversal in BubblesStackView.

Fixes: 427284677
Test: Artificially injected nulls to the bubbleViews collection on the
caller side.
Flag: EXEMPT bugfix

Change-Id: I5639d8ecf2ee62f0d1cf4a5398f14f28645135a1
parent cc6b323b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -765,8 +765,10 @@ public class StackAnimationController extends
        Runnable updateAllIcons = () -> {
            for (int newIndex = 0; newIndex < bubbleViews.size(); newIndex++) {
                View view = bubbleViews.get(newIndex);
                if (view != null) {
                    updateBadgesAndZOrder(view, newIndex);
                }
            }
        };

        boolean swapped = false;
@@ -775,6 +777,8 @@ public class StackAnimationController extends
            if (view != null) {
                final int oldIndex = mLayout.indexOfChild(view);
                swapped |= animateSwap(view, oldIndex, newIndex, updateAllIcons, after);
            } else {
                Log.w(TAG, "bubbleViews[" + newIndex + "] is null");
            }
        }
        if (!swapped) {