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

Commit 75ac093e authored by Josh Tsuji's avatar Josh Tsuji Committed by Automerger Merge Worker
Browse files

Merge "Ensure light reveal scrim is fully revealed once we're unlocked." into...

Merge "Ensure light reveal scrim is fully revealed once we're unlocked." into tm-dev am: 9c8a68c3 am: 2502c4a3

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



Change-Id: I3780d33de63d7237c5e9690800385c6e22504002
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 08ea039e 2502c4a3
Loading
Loading
Loading
Loading
+12 −1
Original line number Original line Diff line number Diff line
@@ -80,6 +80,7 @@ class AuthRippleController @Inject constructor(


    @VisibleForTesting
    @VisibleForTesting
    internal var startLightRevealScrimOnKeyguardFadingAway = false
    internal var startLightRevealScrimOnKeyguardFadingAway = false
    var lightRevealScrimAnimator: ValueAnimator? = null
    var fingerprintSensorLocation: PointF? = null
    var fingerprintSensorLocation: PointF? = null
    private var faceSensorLocation: PointF? = null
    private var faceSensorLocation: PointF? = null
    private var circleReveal: LightRevealEffect? = null
    private var circleReveal: LightRevealEffect? = null
@@ -163,7 +164,8 @@ class AuthRippleController @Inject constructor(
        if (keyguardStateController.isKeyguardFadingAway) {
        if (keyguardStateController.isKeyguardFadingAway) {
            val lightRevealScrim = centralSurfaces.lightRevealScrim
            val lightRevealScrim = centralSurfaces.lightRevealScrim
            if (startLightRevealScrimOnKeyguardFadingAway && lightRevealScrim != null) {
            if (startLightRevealScrimOnKeyguardFadingAway && lightRevealScrim != null) {
                ValueAnimator.ofFloat(.1f, 1f).apply {
                lightRevealScrimAnimator?.cancel()
                lightRevealScrimAnimator = ValueAnimator.ofFloat(.1f, 1f).apply {
                    interpolator = Interpolators.LINEAR_OUT_SLOW_IN
                    interpolator = Interpolators.LINEAR_OUT_SLOW_IN
                    duration = RIPPLE_ANIMATION_DURATION
                    duration = RIPPLE_ANIMATION_DURATION
                    startDelay = keyguardStateController.keyguardFadingAwayDelay
                    startDelay = keyguardStateController.keyguardFadingAwayDelay
@@ -183,6 +185,8 @@ class AuthRippleController @Inject constructor(
                            if (lightRevealScrim.revealEffect == circleReveal) {
                            if (lightRevealScrim.revealEffect == circleReveal) {
                                lightRevealScrim.revealEffect = LiftReveal
                                lightRevealScrim.revealEffect = LiftReveal
                            }
                            }

                            lightRevealScrimAnimator = null
                        }
                        }
                    })
                    })
                    start()
                    start()
@@ -192,6 +196,13 @@ class AuthRippleController @Inject constructor(
        }
        }
    }
    }


    /**
     * Whether we're animating the light reveal scrim from a call to [onKeyguardFadingAwayChanged].
     */
    fun isAnimatingLightRevealScrim(): Boolean {
        return lightRevealScrimAnimator?.isRunning ?: false
    }

    override fun onStartedGoingToSleep() {
    override fun onStartedGoingToSleep() {
        // reset the light reveal start in case we were pending an unlock
        // reset the light reveal start in case we were pending an unlock
        startLightRevealScrimOnKeyguardFadingAway = false
        startLightRevealScrimOnKeyguardFadingAway = false
+17 −0
Original line number Original line Diff line number Diff line
@@ -1022,6 +1022,23 @@ public class CentralSurfacesImpl extends CoreStartable implements
            public void onUnlockedChanged() {
            public void onUnlockedChanged() {
                logStateToEventlog();
                logStateToEventlog();
            }
            }

            @Override
            public void onKeyguardGoingAwayChanged() {
                // The light reveal scrim should always be fully revealed by the time the keyguard
                // is done going away. Double check that this is true.
                if (!mKeyguardStateController.isKeyguardGoingAway()) {
                    if (mLightRevealScrim.getRevealAmount() != 1f) {
                        Log.e(TAG, "Keyguard is done going away, but someone left the light reveal "
                                + "scrim at reveal amount: " + mLightRevealScrim.getRevealAmount());
                    }

                    // If the auth ripple is still playing, let it finish.
                    if (!mAuthRippleController.isAnimatingLightRevealScrim()) {
                        mLightRevealScrim.setRevealAmount(1f);
                    }
                }
            }
        });
        });
        startKeyguard();
        startKeyguard();