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

Commit 4b7539e4 authored by Kevin Chyn's avatar Kevin Chyn Committed by android-build-merger
Browse files

Merge "Reset fingerprint lockout upon successful unlock" into oc-mr1-dev

am: 60409a92

Change-Id: I19afe423ad9a4f0c9897dd82802e37412072e55c
parents 6e23bfc3 60409a92
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -646,13 +646,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
        return mStrongAuthTracker;
    }

    public void reportSuccessfulStrongAuthUnlockAttempt() {
        if (mFpm != null) {
            byte[] token = null; /* TODO: pass real auth token once fp HAL supports it */
            mFpm.resetTimeout(token);
        }
    }

    private void notifyStrongAuthStateChanged(int userId) {
        for (int i = 0; i < mCallbacks.size(); i++) {
            KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
+0 −7
Original line number Diff line number Diff line
@@ -560,9 +560,6 @@ public class KeyguardViewMediator extends SystemUI {
            }

            tryKeyguardDone();
            if (strongAuth) {
                mUpdateMonitor.reportSuccessfulStrongAuthUnlockAttempt();
            }
        }

        @Override
@@ -591,9 +588,6 @@ public class KeyguardViewMediator extends SystemUI {
            mStatusBarKeyguardViewManager.startPreHideAnimation(mHideAnimationFinishedRunnable);
            mHandler.sendEmptyMessageDelayed(KEYGUARD_DONE_PENDING_TIMEOUT,
                    KEYGUARD_DONE_PENDING_TIMEOUT_MS);
            if (strongAuth) {
                mUpdateMonitor.reportSuccessfulStrongAuthUnlockAttempt();
            }
            Trace.endSection();
        }

@@ -1288,7 +1282,6 @@ public class KeyguardViewMediator extends SystemUI {
                // Without this, settings is not enabled until the lock screen first appears
                setShowingLocked(false);
                hideLocked();
                mUpdateMonitor.reportSuccessfulStrongAuthUnlockAttempt();
                return;
            }
        }
+1 −0
Original line number Diff line number Diff line
@@ -561,6 +561,7 @@ public class LockSettingsService extends ILockSettings.Stub {
        mDeviceProvisionedObserver.onSystemReady();
        // TODO: maybe skip this for split system user mode.
        mStorage.prefetchUser(UserHandle.USER_SYSTEM);
        mStrongAuth.systemReady();
    }

    private void migrateOldData() {
+11 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.app.AlarmManager.OnAlarmListener;
import android.app.admin.DevicePolicyManager;
import android.app.trust.IStrongAuthTracker;
import android.content.Context;
import android.hardware.fingerprint.FingerprintManager;
import android.os.Binder;
import android.os.DeadObjectException;
import android.os.Handler;
@@ -64,6 +65,7 @@ public class LockSettingsStrongAuth {
    private final Context mContext;

    private AlarmManager mAlarmManager;
    private FingerprintManager mFingerprintManager;

    public LockSettingsStrongAuth(Context context) {
        mContext = context;
@@ -71,6 +73,10 @@ public class LockSettingsStrongAuth {
        mAlarmManager = context.getSystemService(AlarmManager.class);
    }

    public void systemReady() {
        mFingerprintManager = mContext.getSystemService(FingerprintManager.class);
    }

    private void handleAddStrongAuthTracker(IStrongAuthTracker tracker) {
        for (int i = 0; i < mStrongAuthTrackers.size(); i++) {
            if (mStrongAuthTrackers.get(i).asBinder() == tracker.asBinder()) {
@@ -188,6 +194,11 @@ public class LockSettingsStrongAuth {
    }

    public void reportSuccessfulStrongAuthUnlock(int userId) {
        if (mFingerprintManager != null) {
            byte[] token = null; /* TODO: pass real auth token once fp HAL supports it */
            mFingerprintManager.resetTimeout(token);
        }

        final int argNotUsed = 0;
        mHandler.obtainMessage(MSG_SCHEDULE_STRONG_AUTH_TIMEOUT, userId, argNotUsed).sendToTarget();
    }