From 53037b291f65b1c887e5aa27c14f082195db0c06 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Tue, 20 Jul 2021 12:03:05 -0700 Subject: [PATCH] Revert "Remove zoom from wake-up transition" Removing the zoom was causing problems with the wake-up animation, where the wallpaper would jump. Test: manual Test: atest NotificationShadeDepthControllerTest Fixes: 192816091 Change-Id: I571e838509356a9eb9895ea2856e023a7b9f1a15 --- .../statusbar/NotificationShadeDepthController.kt | 12 ++++++++++++ .../NotificationShadeDepthControllerTest.kt | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt index 28bdd5fbeb8b8..db553e4b093b2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt @@ -89,6 +89,9 @@ class NotificationShadeDepthController @Inject constructor( private var prevShadeDirection = 0 private var prevShadeVelocity = 0f + // Only for dumpsys + private var lastAppliedBlur = 0 + @VisibleForTesting var shadeSpring = DepthAnimation() var shadeAnimation = DepthAnimation() @@ -201,6 +204,7 @@ class NotificationShadeDepthController @Inject constructor( val opaque = scrimsVisible && !blursDisabledForAppLaunch Trace.traceCounter(Trace.TRACE_TAG_APP, "shade_blur_radius", blur) blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur, opaque) + lastAppliedBlur = blur try { if (root.isAttachedToWindow && root.windowToken != null) { wallpaperManager.setWallpaperZoomOut(root.windowToken, zoomOut) @@ -271,6 +275,11 @@ class NotificationShadeDepthController @Inject constructor( brightnessMirrorSpring.finishIfRunning() } } + + override fun onDozeAmountChanged(linear: Float, eased: Float) { + wakeAndUnlockBlurRadius = blurUtils.blurRadiusOfRatio(eased) + scheduleUpdate() + } } init { @@ -428,6 +437,9 @@ class NotificationShadeDepthController @Inject constructor( it.println("brightnessMirrorRadius: ${brightnessMirrorSpring.radius}") it.println("wakeAndUnlockBlur: $wakeAndUnlockBlurRadius") it.println("blursDisabledForAppLaunch: $blursDisabledForAppLaunch") + it.println("qsPanelExpansion: $qsPanelExpansion") + it.println("transitionToFullShadeProgress: $transitionToFullShadeProgress") + it.println("lastAppliedBlur: $lastAppliedBlur") } } 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 d6c27978e61e2..d23a9ce26deff 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt @@ -195,6 +195,13 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { verify(blurUtils).applyBlur(any(), eq(maxBlur), eq(false)) } + @Test + fun onDozeAmountChanged_appliesBlur() { + statusBarStateListener.onDozeAmountChanged(1f, 1f) + notificationShadeDepthController.updateBlurCallback.doFrame(0) + verify(blurUtils).applyBlur(any(), eq(maxBlur), eq(false)) + } + @Test fun setFullShadeTransition_appliesBlur_onlyIfSupported() { reset(blurUtils)