Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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( Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +26 −6 Original line number Diff line number Diff line Loading @@ -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 -> Loading @@ -341,10 +349,13 @@ 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. */ Loading Loading @@ -627,10 +638,19 @@ constructor( val (blur, zoomOutFromShadeRadius) = computeBlurAndZoomOut() zoomOutCalculatedFromShadeRadius = zoomOutFromShadeRadius if (Flags.bouncerUiRevamp() || Flags.glanceableHubBlurredBackground()) { 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) { return } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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( Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +26 −6 Original line number Diff line number Diff line Loading @@ -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 -> Loading @@ -341,10 +349,13 @@ 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. */ Loading Loading @@ -627,10 +638,19 @@ constructor( val (blur, zoomOutFromShadeRadius) = computeBlurAndZoomOut() zoomOutCalculatedFromShadeRadius = zoomOutFromShadeRadius if (Flags.bouncerUiRevamp() || Flags.glanceableHubBlurredBackground()) { 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) { return } Loading