From f119f2712b6da14d54b3a72b8231c11ed76673e0 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Fri, 12 Aug 2022 13:49:56 -0700 Subject: Only update the cached state if the value changed Test: atest BubblesTests Bug: 242097561 Change-Id: Icaa37799741739121cc6d90da526bc9c9150c5ad --- .../Shell/src/com/android/wm/shell/bubbles/BubbleController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java index 8771ceb71d98..de26b54971ca 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java @@ -1094,13 +1094,16 @@ 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); - mImpl.mCachedState.updateBubbleSuppressedState(b); + if (showInShadeBefore != b.showInShade()) { + mImpl.mCachedState.updateBubbleSuppressedState(b); + } } @VisibleForTesting -- cgit v1.2.3-59-g8ed1b