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

Commit 5a1f7436 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't show flyout if its not visually interruptive"

parents eee8650a 8e97a962
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