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

Commit 51dfc9c5 authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

Merge "AuthRipple should always animate lightReveal on auth" into tm-dev am:...

Merge "AuthRipple should always animate lightReveal on auth" into tm-dev am: 3fb8f5d5 am: a18a0293

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



Change-Id: Ic5f214e549fb65f105d646f6732517b7721ddb6c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c630d105 a18a0293
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ class AuthRippleController @Inject constructor(
        val lightRevealScrim = centralSurfaces.lightRevealScrim
        if (statusBarStateController.isDozing || biometricUnlockController.isWakeAndUnlock) {
            circleReveal?.let {
                lightRevealScrim?.revealAmount = 0f
                lightRevealScrim?.revealEffect = it
                startLightRevealScrimOnKeyguardFadingAway = true
            }
@@ -168,7 +169,8 @@ class AuthRippleController @Inject constructor(
                    startDelay = keyguardStateController.keyguardFadingAwayDelay
                    addUpdateListener { animator ->
                        if (lightRevealScrim.revealEffect != circleReveal) {
                            // if something else took over the reveal, let's do nothing.
                            // if something else took over the reveal, let's cancel ourselves
                            cancel()
                            return@addUpdateListener
                        }
                        lightRevealScrim.revealAmount = animator.animatedValue as Float
+5 −2
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ import android.graphics.PorterDuffColorFilter
import android.graphics.PorterDuffXfermode
import android.graphics.RadialGradient
import android.graphics.Shader
import android.os.Trace
import android.util.AttributeSet
import android.util.MathUtils.lerp
import android.view.View
@@ -222,6 +223,8 @@ class LightRevealScrim(context: Context?, attrs: AttributeSet?) : View(context,

                revealEffect.setRevealAmountOnScrim(value, this)
                updateScrimOpaque()
                Trace.traceCounter(Trace.TRACE_TAG_APP, "light_reveal_amount",
                        (field * 100).toInt())
                invalidate()
            }
        }
@@ -355,8 +358,8 @@ class LightRevealScrim(context: Context?, attrs: AttributeSet?) : View(context,
    }

    override fun onDraw(canvas: Canvas?) {
        if (canvas == null || revealGradientWidth <= 0 || revealGradientHeight <= 0
            || revealAmount == 0f) {
        if (canvas == null || revealGradientWidth <= 0 || revealGradientHeight <= 0 ||
            revealAmount == 0f) {
            if (revealAmount < 1f) {
                canvas?.drawColor(revealGradientEndColor)
            }
+1 −2
Original line number Diff line number Diff line
@@ -4420,8 +4420,7 @@ public class CentralSurfaces extends CoreStartable implements
                @Override
                public void onDozeAmountChanged(float linear, float eased) {
                    if (mFeatureFlags.isEnabled(Flags.LOCKSCREEN_ANIMATIONS)
                            && !(mLightRevealScrim.getRevealEffect() instanceof CircleReveal)
                            && !mBiometricUnlockController.isWakeAndUnlock()) {
                            && !(mLightRevealScrim.getRevealEffect() instanceof CircleReveal)) {
                        mLightRevealScrim.setRevealAmount(1f - linear);
                    }
                }
+7 −4
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ import com.android.systemui.animation.Interpolators
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.keyguard.KeyguardViewMediator
import com.android.systemui.keyguard.WakefulnessLifecycle
import com.android.systemui.statusbar.CircleReveal
import com.android.systemui.statusbar.LightRevealScrim
import com.android.systemui.statusbar.StatusBarState
import com.android.systemui.statusbar.StatusBarStateControllerImpl
@@ -85,7 +86,9 @@ class UnlockedScreenOffAnimationController @Inject constructor(
        duration = LIGHT_REVEAL_ANIMATION_DURATION
        interpolator = Interpolators.LINEAR
        addUpdateListener {
            if (lightRevealScrim.revealEffect !is CircleReveal) {
                lightRevealScrim.revealAmount = it.animatedValue as Float
            }
            if (lightRevealScrim.isScrimAlmostOccludes &&
                    interactionJankMonitor.isInstrumenting(CUJ_SCREEN_OFF)) {
                // ends the instrument when the scrim almost occludes the screen.
@@ -95,9 +98,9 @@ class UnlockedScreenOffAnimationController @Inject constructor(
        }
        addListener(object : AnimatorListenerAdapter() {
            override fun onAnimationCancel(animation: Animator?) {
                if (lightRevealScrim.revealEffect !is CircleReveal) {
                    lightRevealScrim.revealAmount = 1f
                lightRevealAnimationPlaying = false
                interactionJankMonitor.cancel(CUJ_SCREEN_OFF)
                }
            }

            override fun onAnimationEnd(animation: Animator?) {