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

Commit e6e7b75d authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

DO NOT MERGE Use KeyguardStateController for #isShowing

Remove calls that route through
StatusBarKeyguardViewManager/KeyguardViewController. This
was unnecessary and led to confusion. Instead, all components should
directly check KeyguardStateController for #isShowing and #isOccluded.

For now, this CL retains the keyguardVisibility callback in
KeyguardUpdateMonitor, where keyguardVisibility is defined as when
KeyguardStateController, our source of truth).

Test: builds
Test: atest SystemUITests
Bug: 248089638
Fixes: 251880943
Change-Id: I7c6373d2fa81ab2063234aae338b1b9643038e6a
parent 018b513b
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -3178,14 +3178,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
@@ -666,7 +666,7 @@ class KeyguardUnlockAnimationController @Inject constructor(
            return
        }

        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
@@ -726,7 +726,7 @@ class KeyguardUnlockAnimationController @Inject constructor(
    private fun finishKeyguardExitRemoteAnimationIfReachThreshold() {
        // no-op if keyguard is not showing or animation is not enabled.
        if (!KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation ||
                !keyguardViewController.isShowing) {
                !keyguardStateController.isShowing) {
            return
        }

@@ -849,7 +849,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
@@ -1881,7 +1881,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