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

Commit 61de0cbd authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Delete unnecessary cache

The method that we were caching doesn't make IPCs, we can
call it directly.

Bug: 129802603
Test: face flows
Change-Id: I885ebec33d817eca555e38cfdc7ab0605223f8ec
parent 65e18e43
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -263,8 +263,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
            return STATE_BIOMETRICS_ERROR;
        } else if (mUnlockMethodCache.canSkipBouncer()) {
            return STATE_LOCK_OPEN;
        } else if (mUnlockMethodCache.isFaceUnlockRunning()
                || updateMonitor.isFaceDetectionRunning()) {
        } else if (updateMonitor.isFaceDetectionRunning()) {
            return STATE_SCANNING_FACE;
        } else {
            return STATE_LOCKED;
+1 −9
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ public class UnlockMethodCache {
    /** Whether the unlock method is currently insecure (insecure method or trusted environment) */
    private boolean mCanSkipBouncer;
    private boolean mTrustManaged;
    private boolean mFaceUnlockRunning;
    private boolean mTrusted;

    private UnlockMethodCache(Context ctx) {
@@ -93,16 +92,13 @@ public class UnlockMethodCache {
        boolean canSkipBouncer = !secure ||  mKeyguardUpdateMonitor.getUserCanSkipBouncer(user);
        boolean trustManaged = mKeyguardUpdateMonitor.getUserTrustIsManaged(user);
        boolean trusted = mKeyguardUpdateMonitor.getUserHasTrust(user);
        boolean faceUnlockRunning = mKeyguardUpdateMonitor.isFaceUnlockRunning(user)
                && trustManaged;
        boolean changed = secure != mSecure || canSkipBouncer != mCanSkipBouncer ||
                trustManaged != mTrustManaged  || faceUnlockRunning != mFaceUnlockRunning;
                trustManaged != mTrustManaged;
        if (changed || updateAlways) {
            mSecure = secure;
            mCanSkipBouncer = canSkipBouncer;
            mTrusted = trusted;
            mTrustManaged = trustManaged;
            mFaceUnlockRunning = faceUnlockRunning;
            notifyListeners();
        }
        Trace.endSection();
@@ -171,10 +167,6 @@ public class UnlockMethodCache {
        return mTrustManaged;
    }

    public boolean isFaceUnlockRunning() {
        return mFaceUnlockRunning;
    }

    public static interface OnUnlockMethodChangedListener {
        void onUnlockMethodStateChanged();
    }