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

Commit 61c98897 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

enable fingerprint when assistant is on top of keyguard

Fixes: 37719495

Test: make sure fp works when assistant is on top of keyguard
Change-Id: Ib96427816054f94c56dff93e079224a32140840e
parent 4f97d56d
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -294,6 +294,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
        }
    };

    private boolean mEnableNextFingerprint;
    private SparseBooleanArray mUserHasTrust = new SparseBooleanArray();
    private SparseBooleanArray mUserTrustIsManaged = new SparseBooleanArray();
    private SparseBooleanArray mUserFingerprintAuthenticated = new SparseBooleanArray();
@@ -309,6 +310,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
        return sCurrentUser;
    }

    public void enableNextFingerprint() {
        mEnableNextFingerprint = true;
        if (DEBUG) Log.v(TAG, "enabling next fingerprint");
    }

    @Override
    public void onTrustChanged(boolean enabled, int userId, int flags) {
        mUserHasTrust.put(userId, enabled);
@@ -1083,7 +1089,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {

    private boolean shouldListenForFingerprint() {
        return (mKeyguardIsVisible || !mDeviceInteractive || mBouncer || mGoingToSleep)
                && !mSwitchingUser && !isFingerprintDisabled(getCurrentUser());
                && (!mSwitchingUser && !isFingerprintDisabled(getCurrentUser()) ||
                mEnableNextFingerprint);
    }

    private void startListeningForFingerprint() {
@@ -1110,6 +1117,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {

    private void stopListeningForFingerprint() {
        if (DEBUG) Log.v(TAG, "stopListeningForFingerprint()");
        if (mEnableNextFingerprint) {
            if (DEBUG) Log.v(TAG, "listening to one more fingerprint");
            return;
        }

        if (mFingerprintRunningState == FINGERPRINT_STATE_RUNNING) {
            mFingerprintCancelSignal.cancel();
            mFingerprintCancelSignal = null;
@@ -1415,6 +1427,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
    private void handleKeyguardReset() {
        if (DEBUG) Log.d(TAG, "handleKeyguardReset");
        updateFingerprintListeningState();
        mEnableNextFingerprint = false;
        mNeedsSlowUnlockTransition = resolveNeedsSlowUnlockTransition();
    }