Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -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(); } } Loading packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java +37 −1 Original line number Original line Diff line number Diff line Loading @@ -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()); Loading @@ -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(); Loading @@ -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 Loading Loading @@ -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 Loading Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -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(); } } Loading
packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java +37 −1 Original line number Original line Diff line number Diff line Loading @@ -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()); Loading @@ -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(); Loading @@ -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 Loading Loading @@ -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 Loading