diff options
3 files changed, 30 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt index eb8526d0ef91..3a33c4b480c4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt @@ -31,6 +31,7 @@ import com.android.systemui.Interpolators import com.android.systemui.dump.DumpManager import com.android.systemui.statusbar.phone.BiometricUnlockController import com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK +import com.android.systemui.statusbar.phone.NotificationShadeWindowController import com.android.systemui.statusbar.phone.PanelExpansionListener import com.android.systemui.statusbar.policy.KeyguardStateController import java.io.FileDescriptor @@ -50,6 +51,7 @@ class NotificationShadeDepthController @Inject constructor( private val keyguardStateController: KeyguardStateController, private val choreographer: Choreographer, private val wallpaperManager: WallpaperManager, + private val notificationShadeWindowController: NotificationShadeWindowController, dumpManager: DumpManager ) : PanelExpansionListener, Dumpable { companion object { @@ -62,7 +64,6 @@ class NotificationShadeDepthController @Inject constructor( private var keyguardAnimator: Animator? = null private var notificationAnimator: Animator? = null private var updateScheduled: Boolean = false - private var shadeExpansion = 1.0f private val shadeSpring = SpringAnimation(this, object : FloatPropertyCompat<NotificationShadeDepthController>("shadeBlurRadius") { override fun setValue(rect: NotificationShadeDepthController?, value: Float) { @@ -100,6 +101,7 @@ class NotificationShadeDepthController @Inject constructor( val rawZoom = max(blurUtils.ratioOfBlurRadius(blur), globalDialogVisibility) wallpaperManager.setWallpaperZoomOut(root.windowToken, zoomInterpolator.getInterpolation(rawZoom)) + notificationShadeWindowController.setBackgroundBlurRadius(blur) } /** diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowController.java index 75f5023ce48a..e1e679f06eef 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowController.java @@ -309,7 +309,8 @@ public class NotificationShadeWindowController implements Callback, Dumpable, return !state.mForceCollapsed && (state.isKeyguardShowingAndNotOccluded() || state.mPanelVisible || state.mKeyguardFadingAway || state.mBouncerShowing || state.mHeadsUpShowing || state.mBubblesShowing - || state.mScrimsVisibility != ScrimController.TRANSPARENT); + || state.mScrimsVisibility != ScrimController.TRANSPARENT) + || state.mBackgroundBlurRadius > 0; } private void applyFitsSystemWindows(State state) { @@ -478,6 +479,19 @@ public class NotificationShadeWindowController implements Callback, Dumpable, apply(mCurrentState); } + /** + * Current blur level, controller by + * {@link com.android.systemui.statusbar.NotificationShadeDepthController}. + * @param backgroundBlurRadius Radius in pixels. + */ + public void setBackgroundBlurRadius(int backgroundBlurRadius) { + if (mCurrentState.mBackgroundBlurRadius == backgroundBlurRadius) { + return; + } + mCurrentState.mBackgroundBlurRadius = backgroundBlurRadius; + apply(mCurrentState); + } + public void setHeadsUpShowing(boolean showing) { mCurrentState.mHeadsUpShowing = showing; apply(mCurrentState); @@ -665,6 +679,7 @@ public class NotificationShadeWindowController implements Callback, Dumpable, boolean mForcePluginOpen; boolean mDozing; int mScrimsVisibility; + int mBackgroundBlurRadius; private boolean isKeyguardShowingAndNotOccluded() { return mKeyguardShowing && !mKeyguardOccluded; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerTest.java index 83e89bdce2d5..5320ecd46d62 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerTest.java @@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -27,6 +28,7 @@ import static org.mockito.Mockito.when; import android.app.IActivityManager; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper.RunWithLooper; +import android.view.View; import android.view.WindowManager; import androidx.test.filters.SmallTest; @@ -110,4 +112,13 @@ public class NotificationShadeWindowControllerTest extends SysuiTestCase { public void testSetForcePluginOpen_beforeStatusBarInitialization() { mNotificationShadeWindowController.setForcePluginOpen(true); } + + @Test + public void setBackgroundBlurRadius_expandedWithBlurs() { + mNotificationShadeWindowController.setBackgroundBlurRadius(10); + verify(mNotificationShadeWindowView).setVisibility(eq(View.VISIBLE)); + + mNotificationShadeWindowController.setBackgroundBlurRadius(0); + verify(mNotificationShadeWindowView).setVisibility(eq(View.INVISIBLE)); + } } |