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

Commit 0c29b027 authored by Dil3mm4's avatar Dil3mm4 Committed by Sam Mortimer
Browse files

SystemUI: Don't enable FOD when strong auth is required

Change-Id: Ie227aee88fea4945a7618fe606c1094ae812ebe0
parent b1208e64
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -106,6 +106,8 @@ import com.android.systemui.util.RingerModeTracker;

import com.google.android.collect.Lists;

import lineageos.app.LineageContextConstants;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.lang.ref.WeakReference;
@@ -310,6 +312,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    };

    private final Handler mHandler;
    private final boolean mHasFod;

    private final Observer<Integer> mRingerModeObserver = new Observer<Integer>() {
        @Override
@@ -1693,6 +1696,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
            }
        };

        mHasFod = mContext.getPackageManager().hasSystemFeature(
                LineageContextConstants.Features.FOD);

        // Since device can't be un-provisioned, we only need to register a content observer
        // to update mDeviceProvisioned when we are...
        if (!mDeviceProvisioned) {
@@ -1856,7 +1862,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
            return;
        }
        mHandler.removeCallbacks(mRetryFingerprintAuthentication);
        boolean shouldListenForFingerprint = shouldListenForFingerprint();
        boolean hideFodForStrongAuth = mHasFod && userNeedsStrongAuth();
        boolean shouldListenForFingerprint = !hideFodForStrongAuth && shouldListenForFingerprint();
        boolean runningOrRestarting = mFingerprintRunningState == BIOMETRIC_STATE_RUNNING
                || mFingerprintRunningState == BIOMETRIC_STATE_CANCELLING_RESTARTING;
        if (runningOrRestarting && !shouldListenForFingerprint) {