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
This commit is contained in:
Lucas Dupin
2021-07-20 12:03:05 -07:00
parent 144dab97be
commit 53037b291f
2 changed files with 19 additions and 0 deletions

View File

@@ -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")
}
}

View File

@@ -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)