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

Commit f119f271 authored by Mady Mellor's avatar Mady Mellor
Browse files

Only update the cached state if the value changed

Test: atest BubblesTests
Bug: 242097561
Change-Id: Icaa37799741739121cc6d90da526bc9c9150c5ad
parent 889241a5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1094,14 +1094,17 @@ public class BubbleController implements ConfigurationChangeListener {
    }

    void updateNotNotifyingEntry(Bubble b, BubbleEntry entry, boolean showInShade) {
        boolean showInShadeBefore = b.showInShade();
        boolean isBubbleSelected = Objects.equals(b, mBubbleData.getSelectedBubble());
        boolean isBubbleExpandedAndSelected = isStackExpanded() && isBubbleSelected;
        b.setEntry(entry);
        boolean suppress = isBubbleExpandedAndSelected || !showInShade || !b.showInShade();
        b.setSuppressNotification(suppress);
        b.setShowDot(!isBubbleExpandedAndSelected);
        if (showInShadeBefore != b.showInShade()) {
            mImpl.mCachedState.updateBubbleSuppressedState(b);
        }
    }

    @VisibleForTesting
    public void inflateAndAdd(Bubble bubble, boolean suppressFlyout, boolean showInShade) {