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

Commit 9843ab96 authored by Sergey Serokurov's avatar Sergey Serokurov Committed by Automerger Merge Worker
Browse files

Merge "Hide bubbles when focus mode is enabled" into sc-v2-dev am: 18376814

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16155724

Change-Id: I873f4e2e45b61daed35a0d5fe73031d26afc229e
parents 9dfb8e06 18376814
Loading
Loading
Loading
Loading
+9 −6
Original line number Original line Diff line number Diff line
@@ -1028,13 +1028,16 @@ public class BubbleController {
                // If this entry is no longer allowed to bubble, dismiss with the BLOCKED reason.
                // If this entry is no longer allowed to bubble, dismiss with the BLOCKED reason.
                // This means that the app or channel's ability to bubble has been revoked.
                // This means that the app or channel's ability to bubble has been revoked.
                mBubbleData.dismissBubbleWithKey(key, DISMISS_BLOCKED);
                mBubbleData.dismissBubbleWithKey(key, DISMISS_BLOCKED);
            } else if (isActiveBubble && !shouldBubbleUp) {
            } else if (isActiveBubble && (!shouldBubbleUp || entry.getRanking().isSuspended())) {
                // If this entry is allowed to bubble, but cannot currently bubble up, dismiss it.
                // If this entry is allowed to bubble, but cannot currently bubble up or is
                // This happens when DND is enabled and configured to hide bubbles. Dismissing with
                // suspended, dismiss it. This happens when DND is enabled and configured to hide
                // the reason DISMISS_NO_BUBBLE_UP will retain the underlying notification, so that
                // bubbles, or focus mode is enabled and the app is designated as distracting.
                // the bubble will be re-created if shouldBubbleUp returns true.
                // Dismissing with the reason DISMISS_NO_BUBBLE_UP will retain the underlying
                // notification, so that the bubble will be re-created if shouldBubbleUp returns
                // true.
                mBubbleData.dismissBubbleWithKey(key, DISMISS_NO_BUBBLE_UP);
                mBubbleData.dismissBubbleWithKey(key, DISMISS_NO_BUBBLE_UP);
            } else if (entry != null && mTmpRanking.isBubble() && !isActiveBubble) {
            } else if (entry != null && mTmpRanking.isBubble() && !isActiveBubble
                    && !entry.getRanking().isSuspended()) {
                entry.setFlagBubble(true);
                entry.setFlagBubble(true);
                onEntryUpdated(entry, true /* shouldBubbleUp */);
                onEntryUpdated(entry, true /* shouldBubbleUp */);
            }
            }