summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2021-06-25 10:08:53 -0700
committer Lucas Dupin <dupin@google.com> 2021-06-25 10:08:53 -0700
commit6d3879525adaafb0befa8494d09b5767be390ab6 (patch)
treee553a68986da3425c7dd42489ebce19fde3f7749
parent598f0602e2a2835b5da703567137f822459ec246 (diff)
Fix wallpaper zoom regression
Zooms should happen as well when blurs are disabled Fixes: 192087101 Test: atest NotificationShadeDepthControllerTest Change-Id: I1c869bfda19e157259f0b4f9c9cee01aab40e6e5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt10
2 files changed, 15 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
index f03a9a8f3589..2b5119575d22 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
@@ -195,11 +195,15 @@ class NotificationShadeDepthController @Inject constructor(
var blur = max(shadeRadius.toInt(), globalActionsRadius)
// 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()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt
index 60b38892e776..08b10ae17e8e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt
@@ -200,9 +200,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