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

Commit 8e97a962 authored by Mady Mellor's avatar Mady Mellor
Browse files

Don't show flyout if its not visually interruptive

Test: atest BubbleDataTest
Fixes: 148107835
Change-Id: Ifacac80d4a31f657d9cd46db08847af4ffa8992b
parent 871fe0a9
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ public class BubbleData {
        }
        mPendingBubbles.remove(bubble); // No longer pending once we're here
        Bubble prevBubble = getBubbleWithKey(bubble.getKey());
        suppressFlyout |= !shouldShowFlyout(bubble.getEntry());
        suppressFlyout |= !bubble.getEntry().getRanking().visuallyInterruptive();

        if (prevBubble == null) {
            // Create a new bubble
@@ -329,14 +329,6 @@ public class BubbleData {
        return bubbleChildren;
    }

    private boolean shouldShowFlyout(NotificationEntry notif) {
        if (notif.getRanking().visuallyInterruptive()) {
            return true;
        }
        return hasBubbleWithKey(notif.getKey())
                && !getBubbleWithKey(notif.getKey()).showInShade();
    }

    private void doAdd(Bubble bubble) {
        if (DEBUG_BUBBLE_DATA) {
            Log.d(TAG, "doAdd: " + bubble);
+2 −2
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ public class BubbleDataTest extends SysuiTestCase {
    }

    @Test
    public void sameUpdate_NotInShade_showFlyout() {
    public void sameUpdate_NotInShade_NotVisuallyInterruptive_dontShowFlyout() {
        // Setup
        mBubbleData.setListener(mListener);

@@ -247,7 +247,7 @@ public class BubbleDataTest extends SysuiTestCase {

        // Verify
        BubbleData.Update update = mUpdateCaptor.getValue();
        assertThat(update.updatedBubble.showFlyout()).isTrue();
        assertThat(update.updatedBubble.showFlyout()).isFalse();
    }

    // COLLAPSED / ADD