From 73e1c53c80bd0a503ed7ef531b561558cbb5010e Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Mon, 9 Aug 2021 11:38:07 -0700 Subject: [PATCH] Consider shade expansion when blurring because QS Test: manually pull shade when locked, unlocked, from top and middle Test: atest NotificationShadeDepthControllerTest Fixes: 195285764 Bug: 195667456 Change-Id: I19e73a4a1b49c73534f3e20884da8a198ae83b6a --- .../systemui/statusbar/NotificationShadeDepthController.kt | 3 ++- .../systemui/statusbar/NotificationShadeDepthControllerTest.kt | 3 ++- 2 files changed, 4 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 db553e4b093b..002c9c7d2544 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt @@ -178,7 +178,8 @@ class NotificationShadeDepthController @Inject constructor( blurUtils.minBlurRadius, blurUtils.maxBlurRadius) var combinedBlur = (shadeSpring.radius * INTERACTION_BLUR_FRACTION + normalizedBlurRadius * ANIMATION_BLUR_FRACTION).toInt() - combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(qsPanelExpansion)) + val qsExpandedRatio = qsPanelExpansion * shadeExpansion + combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(qsExpandedRatio)) combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(transitionToFullShadeProgress)) var shadeRadius = max(combinedBlur, wakeAndUnlockBlurRadius).toFloat() 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 d23a9ce26def..7c045c1f2894 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt @@ -184,8 +184,9 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { @Test fun setQsPanelExpansion_appliesBlur() { notificationShadeDepthController.qsPanelExpansion = 1f + notificationShadeDepthController.onPanelExpansionChanged(0.5f, tracking = false) notificationShadeDepthController.updateBlurCallback.doFrame(0) - verify(blurUtils).applyBlur(any(), eq(maxBlur), eq(false)) + verify(blurUtils).applyBlur(any(), eq(maxBlur / 2), eq(false)) } @Test