diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java index de26b54971caa..6c76e3f0dd0e3 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java @@ -538,7 +538,6 @@ public class BubbleController implements ConfigurationChangeListener { if (mNotifEntryToExpandOnShadeUnlock != null) { expandStackAndSelectBubble(mNotifEntryToExpandOnShadeUnlock); - mNotifEntryToExpandOnShadeUnlock = null; } updateStack(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java index 8f2b715ba051b..14220cf6f010f 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java @@ -1395,6 +1395,33 @@ public class BubblesTest extends SysuiTestCase { assertThat(stackView.getVisibility()).isEqualTo(View.VISIBLE); } + /** + * Test to verify behavior for following situation: + *
falsefalse do not clear the
+ * pending bubble to be
+ * expanded.
+ */
+ @Test
+ public void testOnStatusBarStateChanged_statusBarChangeDoesNotClearExpandingBubble() {
+ mBubbleController.updateBubble(mBubbleEntry);
+ mBubbleController.onStatusBarStateChanged(false);
+ // Set the bubble to expand once status bar state changes
+ mBubbleController.expandStackAndSelectBubble(mBubbleEntry);
+ // Check that stack is currently collapsed
+ assertStackCollapsed();
+ // Post status bar state change update with the same value
+ mBubbleController.onStatusBarStateChanged(false);
+ // Stack should remain collapsedb
+ assertStackCollapsed();
+ // Post status bar state change which should trigger bubble to expand
+ mBubbleController.onStatusBarStateChanged(true);
+ assertStackExpanded();
+ }
+
@Test
public void testSetShouldAutoExpand_notifiesFlagChanged() {
mBubbleController.updateBubble(mBubbleEntry);