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

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

Merge "Fix the dot, yet again" into qt-r1-bubbles-dev

parents 7c49c7ee aea895f0
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -190,8 +190,9 @@ public class BubbleData {
        } else if (mSelectedBubble == null) {
        } else if (mSelectedBubble == null) {
            setSelectedBubbleInternal(bubble);
            setSelectedBubbleInternal(bubble);
        }
        }
        bubble.setShowInShadeWhenBubble(!mExpanded || mSelectedBubble != bubble);
        boolean isBubbleExpandedAndSelected = mExpanded && mSelectedBubble == bubble;
        bubble.setShowBubbleDot(true);
        bubble.setShowInShadeWhenBubble(!isBubbleExpandedAndSelected);
        bubble.setShowBubbleDot(!isBubbleExpandedAndSelected);
        dispatchPendingChanges();
        dispatchPendingChanges();
    }
    }


+37 −1
Original line number Original line Diff line number Diff line
@@ -323,7 +323,7 @@ public class BubbleControllerTest extends SysuiTestCase {
    }
    }


    @Test
    @Test
    public void testExpansionRemovesShowInShade() {
    public void testExpansionRemovesShowInShadeAndDot() {
        // Mark it as a bubble and add it explicitly
        // Mark it as a bubble and add it explicitly
        mEntryListener.onPendingEntryAdded(mRow.getEntry());
        mEntryListener.onPendingEntryAdded(mRow.getEntry());
        mBubbleController.updateBubble(mRow.getEntry());
        mBubbleController.updateBubble(mRow.getEntry());
@@ -331,6 +331,7 @@ public class BubbleControllerTest extends SysuiTestCase {
        // We should have bubbles & their notifs should not be suppressed
        // We should have bubbles & their notifs should not be suppressed
        assertTrue(mBubbleController.hasBubbles());
        assertTrue(mBubbleController.hasBubbles());
        assertFalse(mBubbleController.isBubbleNotificationSuppressedFromShade(mRow.getEntry().key));
        assertFalse(mBubbleController.isBubbleNotificationSuppressedFromShade(mRow.getEntry().key));
        assertTrue(mBubbleData.getBubbleWithKey(mRow.getEntry().key).showBubbleDot());


        // Expand
        // Expand
        BubbleStackView stackView = mBubbleController.getStackView();
        BubbleStackView stackView = mBubbleController.getStackView();
@@ -340,6 +341,40 @@ public class BubbleControllerTest extends SysuiTestCase {


        // Notif is suppressed after expansion
        // Notif is suppressed after expansion
        assertTrue(mBubbleController.isBubbleNotificationSuppressedFromShade(mRow.getEntry().key));
        assertTrue(mBubbleController.isBubbleNotificationSuppressedFromShade(mRow.getEntry().key));
        // Notif shouldn't show dot after expansion
        assertFalse(mBubbleData.getBubbleWithKey(mRow.getEntry().key).showBubbleDot());
    }

    @Test
    public void testUpdateWhileExpanded_DoesntChangeShowInShadeAndDot() {
        // Mark it as a bubble and add it explicitly
        mEntryListener.onPendingEntryAdded(mRow.getEntry());
        mBubbleController.updateBubble(mRow.getEntry());

        // We should have bubbles & their notifs should not be suppressed
        assertTrue(mBubbleController.hasBubbles());
        assertFalse(mBubbleController.isBubbleNotificationSuppressedFromShade(mRow.getEntry().key));
        assertTrue(mBubbleData.getBubbleWithKey(mRow.getEntry().key).showBubbleDot());

        // Expand
        BubbleStackView stackView = mBubbleController.getStackView();
        mBubbleController.expandStack();
        assertTrue(mBubbleController.isStackExpanded());
        verify(mBubbleExpandListener).onBubbleExpandChanged(true, mRow.getEntry().key);

        // Notif is suppressed after expansion
        assertTrue(mBubbleController.isBubbleNotificationSuppressedFromShade(mRow.getEntry().key));
        // Notif shouldn't show dot after expansion
        assertFalse(mBubbleData.getBubbleWithKey(mRow.getEntry().key).showBubbleDot());

        // Send update
        mEntryListener.onPreEntryUpdated(mRow.getEntry());

        // Nothing should have changed
        // Notif is suppressed after expansion
        assertTrue(mBubbleController.isBubbleNotificationSuppressedFromShade(mRow.getEntry().key));
        // Notif shouldn't show dot after expansion
        assertFalse(mBubbleData.getBubbleWithKey(mRow.getEntry().key).showBubbleDot());
    }
    }


    @Test
    @Test
@@ -466,6 +501,7 @@ public class BubbleControllerTest extends SysuiTestCase {
    public void testMarkNewNotificationAsShowInShade() {
    public void testMarkNewNotificationAsShowInShade() {
        mEntryListener.onPendingEntryAdded(mRow.getEntry());
        mEntryListener.onPendingEntryAdded(mRow.getEntry());
        assertFalse(mBubbleController.isBubbleNotificationSuppressedFromShade(mRow.getEntry().key));
        assertFalse(mBubbleController.isBubbleNotificationSuppressedFromShade(mRow.getEntry().key));
        assertTrue(mBubbleData.getBubbleWithKey(mRow.getEntry().key).showBubbleDot());
    }
    }


    @Test
    @Test