Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92b381d4 authored by Lucas Dupin's avatar Lucas Dupin Committed by Automerger Merge Worker
Browse files

Merge "Revert "Remove zoom from wake-up transition"" into sc-dev am: c19b6957

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15340831

Change-Id: Ic1dbc23f30dab90e3397afc73efdd2eac5dfdbcc
parents 06977e5b c19b6957
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -89,6 +89,9 @@ class NotificationShadeDepthController @Inject constructor(
    private var prevShadeDirection = 0
    private var prevShadeDirection = 0
    private var prevShadeVelocity = 0f
    private var prevShadeVelocity = 0f


    // Only for dumpsys
    private var lastAppliedBlur = 0

    @VisibleForTesting
    @VisibleForTesting
    var shadeSpring = DepthAnimation()
    var shadeSpring = DepthAnimation()
    var shadeAnimation = DepthAnimation()
    var shadeAnimation = DepthAnimation()
@@ -201,6 +204,7 @@ class NotificationShadeDepthController @Inject constructor(
        val opaque = scrimsVisible && !blursDisabledForAppLaunch
        val opaque = scrimsVisible && !blursDisabledForAppLaunch
        Trace.traceCounter(Trace.TRACE_TAG_APP, "shade_blur_radius", blur)
        Trace.traceCounter(Trace.TRACE_TAG_APP, "shade_blur_radius", blur)
        blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur, opaque)
        blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur, opaque)
        lastAppliedBlur = blur
        try {
        try {
            if (root.isAttachedToWindow && root.windowToken != null) {
            if (root.isAttachedToWindow && root.windowToken != null) {
                wallpaperManager.setWallpaperZoomOut(root.windowToken, zoomOut)
                wallpaperManager.setWallpaperZoomOut(root.windowToken, zoomOut)
@@ -271,6 +275,11 @@ class NotificationShadeDepthController @Inject constructor(
                brightnessMirrorSpring.finishIfRunning()
                brightnessMirrorSpring.finishIfRunning()
            }
            }
        }
        }

        override fun onDozeAmountChanged(linear: Float, eased: Float) {
            wakeAndUnlockBlurRadius = blurUtils.blurRadiusOfRatio(eased)
            scheduleUpdate()
        }
    }
    }


    init {
    init {
@@ -428,6 +437,9 @@ class NotificationShadeDepthController @Inject constructor(
            it.println("brightnessMirrorRadius: ${brightnessMirrorSpring.radius}")
            it.println("brightnessMirrorRadius: ${brightnessMirrorSpring.radius}")
            it.println("wakeAndUnlockBlur: $wakeAndUnlockBlurRadius")
            it.println("wakeAndUnlockBlur: $wakeAndUnlockBlurRadius")
            it.println("blursDisabledForAppLaunch: $blursDisabledForAppLaunch")
            it.println("blursDisabledForAppLaunch: $blursDisabledForAppLaunch")
            it.println("qsPanelExpansion: $qsPanelExpansion")
            it.println("transitionToFullShadeProgress: $transitionToFullShadeProgress")
            it.println("lastAppliedBlur: $lastAppliedBlur")
        }
        }
    }
    }


+7 −0
Original line number Original line Diff line number Diff line
@@ -195,6 +195,13 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() {
        verify(blurUtils).applyBlur(any(), eq(maxBlur), eq(false))
        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
    @Test
    fun setFullShadeTransition_appliesBlur_onlyIfSupported() {
    fun setFullShadeTransition_appliesBlur_onlyIfSupported() {
        reset(blurUtils)
        reset(blurUtils)