diff options
6 files changed, 19 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index 7f1e9d0e1972..04cb620be9d3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -947,6 +947,17 @@ public abstract class PanelView extends FrameLayout { return mClosing || mLaunchingNotification; } + /** + * Bouncer might need a scrim when you double tap on notifications or edit QS. + * On other cases, when you drag up the bouncer with the finger or just fling, + * the scrim should be hidden to avoid occluding the clock. + * + * @return true when we need a scrim to show content on top of the notification panel. + */ + public boolean needsScrimming() { + return !isTracking() && !isCollapsing() && !isFullyCollapsed(); + } + public boolean isTracking() { return mTracking; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java index f8b4e0768ceb..a09b84f1dc7b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -449,7 +449,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, if (mNeedsDrawableColorUpdate) { mNeedsDrawableColorUpdate = false; final GradientColors currentScrimColors; - if (mState == ScrimState.KEYGUARD || mState == ScrimState.BOUNCER_OCCLUDED + if (mState == ScrimState.KEYGUARD || mState == ScrimState.BOUNCER_SCRIMMED || mState == ScrimState.BOUNCER) { // Always animate color changes if we're seeing the keyguard mScrimInFront.setColors(mLockColors, true /* animated */); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java index 58100efbcf81..a14d056a477e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java @@ -79,7 +79,7 @@ public enum ScrimState { /** * Showing password challenge on top of a FLAG_SHOW_WHEN_LOCKED activity. */ - BOUNCER_OCCLUDED(2) { + BOUNCER_SCRIMMED(2) { @Override public void prepare(ScrimState previousState) { mCurrentBehindAlpha = 0; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 5f36fda01886..120122f212a5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -4631,9 +4631,10 @@ public class StatusBar extends SystemUI implements DemoMode, != FingerprintUnlockController.MODE_UNLOCK); if (mBouncerShowing) { - final boolean qsExpanded = mQSPanel != null && mQSPanel.isExpanded(); - mScrimController.transitionTo(mIsOccluded || qsExpanded ? - ScrimState.BOUNCER_OCCLUDED : ScrimState.BOUNCER); + // Bouncer needs the front scrim when it's on top of an activity, + // tapping on a notification or editing QS. + mScrimController.transitionTo(mIsOccluded || mNotificationPanel.needsScrimming() ? + ScrimState.BOUNCER_SCRIMMED : ScrimState.BOUNCER); } else if (mLaunchCameraOnScreenTurningOn || isInLaunchTransition()) { mScrimController.transitionTo(ScrimState.UNLOCKED, mUnlockScrimCallback); } else if (mBrightnessMirrorVisible) { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java index 7f5b528c0d42..f3a8417ff547 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java @@ -145,7 +145,7 @@ public class KeyguardBouncerTest extends SysuiTestCase { @Test public void testShow_resetsSecuritySelection() { mBouncer.show(false); - verify(mKeyguardHostView, never()); + verify(mKeyguardHostView, never()).showPrimarySecurityScreen(); mBouncer.hide(false); mBouncer.show(true); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java index 6fbc0d710cc4..df29e1f9f846 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java @@ -181,7 +181,7 @@ public class ScrimControllerTest extends SysuiTestCase { @Test public void transitionToBouncer() { - mScrimController.transitionTo(ScrimState.BOUNCER_OCCLUDED); + mScrimController.transitionTo(ScrimState.BOUNCER_SCRIMMED); mScrimController.finishAnimationsImmediately(); // Front scrim should be transparent // Back scrim should be visible without tint |