summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt32
2 files changed, 29 insertions, 6 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt
index 039a32ba9127..b4c6b33463b0 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt
@@ -48,6 +48,7 @@ import com.android.wm.shell.appzoomout.AppZoomOut
import com.google.common.truth.Truth.assertThat
import java.util.Optional
import java.util.function.Consumer
+import kotlinx.coroutines.flow.MutableStateFlow
import org.junit.Before
import org.junit.Rule
import org.junit.Test
@@ -120,6 +121,8 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() {
`when`(blurUtils.supportsBlursOnWindows()).thenReturn(true)
`when`(blurUtils.maxBlurRadius).thenReturn(maxBlur.toFloat())
`when`(blurUtils.maxBlurRadius).thenReturn(maxBlur.toFloat())
+ `when`(windowRootViewBlurInteractor.isBlurCurrentlySupported)
+ .thenReturn(MutableStateFlow(true))
notificationShadeDepthController =
NotificationShadeDepthController(
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
index f844d1da1a8d..50d634f6ac54 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
@@ -334,6 +334,14 @@ constructor(
private fun onBlurApplied(appliedBlurRadius: Int, zoomOutFromShadeRadius: Float) {
lastAppliedBlur = appliedBlurRadius
+ onZoomOutChanged(zoomOutFromShadeRadius)
+ listeners.forEach { it.onBlurRadiusChanged(appliedBlurRadius) }
+ notificationShadeWindowController.setBackgroundBlurRadius(appliedBlurRadius)
+ }
+
+ private fun onZoomOutChanged(zoomOutFromShadeRadius: Float) {
+ TrackTracer.instantForGroup("shade", "zoom_out", zoomOutFromShadeRadius)
+ Log.v(TAG, "onZoomOutChanged $zoomOutFromShadeRadius")
wallpaperController.setNotificationShadeZoom(zoomOutFromShadeRadius)
if (spatialModelAppPushback()) {
appZoomOutOptional.ifPresent { appZoomOut ->
@@ -341,12 +349,15 @@ constructor(
}
keyguardInteractor.setZoomOut(zoomOutFromShadeRadius)
}
- listeners.forEach {
- it.onBlurRadiusChanged(appliedBlurRadius)
- }
- notificationShadeWindowController.setBackgroundBlurRadius(appliedBlurRadius)
}
+ private val applyZoomOutForFrame =
+ Choreographer.FrameCallback {
+ updateScheduled = false
+ val (_, zoomOutFromShadeRadius) = computeBlurAndZoomOut()
+ onZoomOutChanged(zoomOutFromShadeRadius)
+ }
+
/** Animate blurs when unlocking. */
private val keyguardStateCallback =
object : KeyguardStateController.Callback {
@@ -627,8 +638,17 @@ constructor(
val (blur, zoomOutFromShadeRadius) = computeBlurAndZoomOut()
zoomOutCalculatedFromShadeRadius = zoomOutFromShadeRadius
if (Flags.bouncerUiRevamp() || Flags.glanceableHubBlurredBackground()) {
- updateScheduled =
- windowRootViewBlurInteractor.requestBlurForShade(blur, shouldBlurBeOpaque)
+ if (windowRootViewBlurInteractor.isBlurCurrentlySupported.value) {
+ updateScheduled =
+ windowRootViewBlurInteractor.requestBlurForShade(blur, shouldBlurBeOpaque)
+ return
+ }
+ // When blur is not supported, zoom out still needs to happen when scheduleUpdate
+ // is invoked and a separate frame callback has to be wired-up to support that.
+ if (!updateScheduled) {
+ updateScheduled = true
+ choreographer.postFrameCallback(applyZoomOutForFrame)
+ }
return
}
if (updateScheduled) {