Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +5 −1 Original line number Diff line number Diff line Loading @@ -185,11 +185,15 @@ class NotificationShadeDepthController @Inject constructor( var blur = shadeRadius.toInt() // Make blur be 0 if it is necessary to stop blur effect. if (scrimsVisible || !blurUtils.supportsBlursOnWindows()) { if (scrimsVisible) { blur = 0 } val zoomOut = blurUtils.ratioOfBlurRadius(blur) if (!blurUtils.supportsBlursOnWindows()) { blur = 0 } // Brightness slider removes blur, but doesn't affect zooms blur = (blur * (1f - brightnessMirrorSpring.ratio)).toInt() Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +10 −0 Original line number Diff line number Diff line Loading @@ -198,9 +198,19 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { @Test fun setFullShadeTransition_appliesBlur_onlyIfSupported() { reset(blurUtils) `when`(blurUtils.blurRadiusOfRatio(anyFloat())).then { answer -> (answer.arguments[0] as Float * maxBlur).toInt() } `when`(blurUtils.ratioOfBlurRadius(anyInt())).then { answer -> answer.arguments[0] as Int / maxBlur.toFloat() } `when`(blurUtils.maxBlurRadius).thenReturn(maxBlur) `when`(blurUtils.maxBlurRadius).thenReturn(maxBlur) notificationShadeDepthController.transitionToFullShadeProgress = 1f notificationShadeDepthController.updateBlurCallback.doFrame(0) verify(blurUtils).applyBlur(any(), eq(0), eq(false)) verify(wallpaperManager).setWallpaperZoomOut(any(), eq(1f)) } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +5 −1 Original line number Diff line number Diff line Loading @@ -185,11 +185,15 @@ class NotificationShadeDepthController @Inject constructor( var blur = shadeRadius.toInt() // Make blur be 0 if it is necessary to stop blur effect. if (scrimsVisible || !blurUtils.supportsBlursOnWindows()) { if (scrimsVisible) { blur = 0 } val zoomOut = blurUtils.ratioOfBlurRadius(blur) if (!blurUtils.supportsBlursOnWindows()) { blur = 0 } // Brightness slider removes blur, but doesn't affect zooms blur = (blur * (1f - brightnessMirrorSpring.ratio)).toInt() Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +10 −0 Original line number Diff line number Diff line Loading @@ -198,9 +198,19 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { @Test fun setFullShadeTransition_appliesBlur_onlyIfSupported() { reset(blurUtils) `when`(blurUtils.blurRadiusOfRatio(anyFloat())).then { answer -> (answer.arguments[0] as Float * maxBlur).toInt() } `when`(blurUtils.ratioOfBlurRadius(anyInt())).then { answer -> answer.arguments[0] as Int / maxBlur.toFloat() } `when`(blurUtils.maxBlurRadius).thenReturn(maxBlur) `when`(blurUtils.maxBlurRadius).thenReturn(maxBlur) notificationShadeDepthController.transitionToFullShadeProgress = 1f notificationShadeDepthController.updateBlurCallback.doFrame(0) verify(blurUtils).applyBlur(any(), eq(0), eq(false)) verify(wallpaperManager).setWallpaperZoomOut(any(), eq(1f)) } @Test Loading