From 237b061182d36fd3bf2238092ccf3d529ec8877b Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Fri, 1 May 2015 14:28:49 -0700 Subject: Only enable fingerprint auth after first regular auth - Add method hasUserAuthenticatedSinceBoot to TrustManagerService - Use this information to only enable fingerprint auth after the user has at least once authenticated with his regular authentication method. Change-Id: Icf073ac3b340d557b044f6bf27f1a7f8511048e2 --- .../Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'packages') diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java index c7b7628..842cf73 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -58,7 +58,6 @@ import android.hardware.fingerprint.FingerprintManager; import android.hardware.fingerprint.FingerprintManager.AuthenticationCallback; import android.hardware.fingerprint.FingerprintUtils; import android.hardware.fingerprint.FingerprintManager.AuthenticationResult; -import android.service.trust.TrustAgentService; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener; @@ -154,6 +153,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { private SubscriptionManager mSubscriptionManager; private List mSubscriptionInfo; private boolean mFingerprintDetectionRunning; + private TrustManager mTrustManager; private final Handler mHandler = new Handler() { @Override @@ -784,8 +784,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { e.printStackTrace(); } - TrustManager trustManager = (TrustManager) context.getSystemService(Context.TRUST_SERVICE); - trustManager.registerTrustListener(this); + mTrustManager = (TrustManager) context.getSystemService(Context.TRUST_SERVICE); + mTrustManager.registerTrustListener(this); mFpm = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE); updateFingerprintListeningState(); @@ -801,7 +801,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } private boolean shouldListenForFingerprint() { - return mScreenOn && mKeyguardIsVisible && !mSwitchingUser; + return mScreenOn && mKeyguardIsVisible && !mSwitchingUser + && mTrustManager.hasUserAuthenticatedSinceBoot(ActivityManager.getCurrentUser()); } private void startListeningForFingerprint() { -- cgit v1.1