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

Commit 872c82de authored by Beverly Tai's avatar Beverly Tai Committed by Android (Google) Code Review
Browse files

Merge "Use KeyguardStateController for #isShowing"

parents 1bcd3a8f e430f68d
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -3164,14 +3164,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
     * Whether the keyguard is showing and not occluded.
     */
    public boolean isKeyguardVisible() {
        return isKeyguardShowing() && !mKeyguardOccluded;
    }

    /**
     * Whether the keyguard is showing. It may still be occluded and not visible.
     */
    public boolean isKeyguardShowing() {
        return mKeyguardShowing;
        return mKeyguardShowing && !mKeyguardOccluded;
    }

    /**
+0 −5
Original line number Diff line number Diff line
@@ -93,11 +93,6 @@ public interface KeyguardViewController {
     */
    void setOccluded(boolean occluded, boolean animate);

    /**
     * @return Whether the keyguard is showing
     */
    boolean isShowing();

    /**
     * Dismisses the keyguard by going to the next screen or making it gone.
     */
+1 −1
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
                mView.animateInUdfpsBouncer(null);
            }

            if (mKeyguardViewManager.isOccluded()) {
            if (mKeyguardStateController.isOccluded()) {
                mKeyguardUpdateMonitor.requestFaceAuthOnOccludingApp(true);
            }

+3 −3
Original line number Diff line number Diff line
@@ -662,7 +662,7 @@ class KeyguardUnlockAnimationController @Inject constructor(
    }

    override fun onKeyguardDismissAmountChanged() {
        if (keyguardViewController.isShowing && !playingCannedUnlockAnimation) {
        if (keyguardStateController.isShowing && !playingCannedUnlockAnimation) {
            showOrHideSurfaceIfDismissAmountThresholdsReached()

            // If the surface is visible or it's about to be, start updating its appearance to
@@ -721,7 +721,7 @@ class KeyguardUnlockAnimationController @Inject constructor(
     */
    private fun finishKeyguardExitRemoteAnimationIfReachThreshold() {
        // no-op if keyguard is not showing or animation is not enabled.
        if (!keyguardViewController.isShowing) {
        if (!keyguardStateController.isShowing) {
            return
        }

@@ -844,7 +844,7 @@ class KeyguardUnlockAnimationController @Inject constructor(
     * animation.
     */
    fun hideKeyguardViewAfterRemoteAnimation() {
        if (keyguardViewController.isShowing) {
        if (keyguardStateController.isShowing) {
            // Hide the keyguard, with no fade out since we animated it away during the unlock.

            keyguardViewController.hide(
+1 −1
Original line number Diff line number Diff line
@@ -1875,7 +1875,7 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
        // if the keyguard is already showing, don't bother. check flags in both files
        // to account for the hiding animation which results in a delay and discrepancy
        // between flags
        if (mShowing && mKeyguardViewControllerLazy.get().isShowing()) {
        if (mShowing && mKeyguardStateController.isShowing()) {
            if (DEBUG) Log.d(TAG, "doKeyguard: not showing because it is already showing");
            resetStateLocked();
            return;
Loading