Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +6 −1 Original line number Diff line number Diff line Loading @@ -186,7 +186,12 @@ public class BubbleController { * Set a listener to be notified of bubble expand events. */ public void setExpandListener(BubbleExpandListener listener) { mExpandListener = listener; mExpandListener = ((isExpanding, key) -> { if (listener != null) { listener.onBubbleExpandChanged(isExpanding, key); } mStatusBarWindowController.setBubbleExpanded(isExpanding); }); if (mStackView != null) { mStackView.setExpandListener(mExpandListener); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java +18 −1 Original line number Diff line number Diff line Loading @@ -202,7 +202,8 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat private void applyFocusableFlag(State state) { boolean panelFocusable = state.statusBarFocusable && state.panelExpanded; if (state.bouncerShowing && (state.keyguardOccluded || state.keyguardNeedsInput) || ENABLE_REMOTE_INPUT && state.remoteInputActive) { || ENABLE_REMOTE_INPUT && state.remoteInputActive || state.bubbleExpanded) { mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; } else if (state.isKeyguardShowingAndNotOccluded() || panelFocusable) { Loading Loading @@ -486,6 +487,21 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat return mCurrentState.bubblesShowing; } /** * Sets if there is a bubble being expanded on the screen. */ public void setBubbleExpanded(boolean bubbleExpanded) { mCurrentState.bubbleExpanded = bubbleExpanded; apply(mCurrentState); } /** * The bubble is shown in expanded state for the status bar. */ public boolean getBubbleExpanded() { return mCurrentState.bubbleExpanded; } public void setStateListener(OtherwisedCollapsedListener listener) { mListener = listener; } Loading Loading @@ -539,6 +555,7 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat boolean wallpaperSupportsAmbientMode; boolean notTouchable; boolean bubblesShowing; boolean bubbleExpanded; /** * The {@link StatusBar} state from the status bar. Loading packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -168,12 +168,14 @@ public class BubbleControllerTest extends SysuiTestCase { // We should have bubbles & their notifs should show in the shade assertTrue(mBubbleController.hasBubbles()); assertTrue(mRow.getEntry().showInShadeWhenBubble()); assertFalse(mStatusBarWindowController.getBubbleExpanded()); // Expand the stack BubbleStackView stackView = mBubbleController.getStackView(); stackView.expandStack(); assertTrue(mBubbleController.isStackExpanded()); verify(mBubbleExpandListener).onBubbleExpandChanged(true, mRow.getEntry().key); assertTrue(mStatusBarWindowController.getBubbleExpanded()); // Make sure it's no longer in the shade assertFalse(mRow.getEntry().showInShadeWhenBubble()); Loading @@ -182,6 +184,7 @@ public class BubbleControllerTest extends SysuiTestCase { stackView.collapseStack(); verify(mBubbleExpandListener).onBubbleExpandChanged(false, mRow.getEntry().key); assertFalse(mBubbleController.isStackExpanded()); assertFalse(mStatusBarWindowController.getBubbleExpanded()); } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +6 −1 Original line number Diff line number Diff line Loading @@ -186,7 +186,12 @@ public class BubbleController { * Set a listener to be notified of bubble expand events. */ public void setExpandListener(BubbleExpandListener listener) { mExpandListener = listener; mExpandListener = ((isExpanding, key) -> { if (listener != null) { listener.onBubbleExpandChanged(isExpanding, key); } mStatusBarWindowController.setBubbleExpanded(isExpanding); }); if (mStackView != null) { mStackView.setExpandListener(mExpandListener); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java +18 −1 Original line number Diff line number Diff line Loading @@ -202,7 +202,8 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat private void applyFocusableFlag(State state) { boolean panelFocusable = state.statusBarFocusable && state.panelExpanded; if (state.bouncerShowing && (state.keyguardOccluded || state.keyguardNeedsInput) || ENABLE_REMOTE_INPUT && state.remoteInputActive) { || ENABLE_REMOTE_INPUT && state.remoteInputActive || state.bubbleExpanded) { mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; } else if (state.isKeyguardShowingAndNotOccluded() || panelFocusable) { Loading Loading @@ -486,6 +487,21 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat return mCurrentState.bubblesShowing; } /** * Sets if there is a bubble being expanded on the screen. */ public void setBubbleExpanded(boolean bubbleExpanded) { mCurrentState.bubbleExpanded = bubbleExpanded; apply(mCurrentState); } /** * The bubble is shown in expanded state for the status bar. */ public boolean getBubbleExpanded() { return mCurrentState.bubbleExpanded; } public void setStateListener(OtherwisedCollapsedListener listener) { mListener = listener; } Loading Loading @@ -539,6 +555,7 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat boolean wallpaperSupportsAmbientMode; boolean notTouchable; boolean bubblesShowing; boolean bubbleExpanded; /** * The {@link StatusBar} state from the status bar. Loading
packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -168,12 +168,14 @@ public class BubbleControllerTest extends SysuiTestCase { // We should have bubbles & their notifs should show in the shade assertTrue(mBubbleController.hasBubbles()); assertTrue(mRow.getEntry().showInShadeWhenBubble()); assertFalse(mStatusBarWindowController.getBubbleExpanded()); // Expand the stack BubbleStackView stackView = mBubbleController.getStackView(); stackView.expandStack(); assertTrue(mBubbleController.isStackExpanded()); verify(mBubbleExpandListener).onBubbleExpandChanged(true, mRow.getEntry().key); assertTrue(mStatusBarWindowController.getBubbleExpanded()); // Make sure it's no longer in the shade assertFalse(mRow.getEntry().showInShadeWhenBubble()); Loading @@ -182,6 +184,7 @@ public class BubbleControllerTest extends SysuiTestCase { stackView.collapseStack(); verify(mBubbleExpandListener).onBubbleExpandChanged(false, mRow.getEntry().key); assertFalse(mBubbleController.isStackExpanded()); assertFalse(mStatusBarWindowController.getBubbleExpanded()); } @Test Loading