From 58396984ef49080d5550919130fc0d869ccf840b Mon Sep 17 00:00:00 2001 From: Danielle Millett Date: Fri, 30 Sep 2011 13:55:07 -0400 Subject: Reworked biometric weak check functions Renamed isBiometricEnabled to isBiometricWeakInstalled. This function now checks if the system property is set, the facelock package is installed, and if the phone has a front facing camera. It no longer checks if facelock is currently set as the unlock method. Added isBiometricWeakInstalled checks to all cases where facelock is used in LockPatternKeyguardView Change-Id: Ia86a7ad6118101c6aab90ffb2ee9c42bf2548149 --- .../internal/policy/impl/LockPatternKeyguardView.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'policy') diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java index f970ff3..ca5d274 100644 --- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java +++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java @@ -531,7 +531,8 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler ((KeyguardScreen) mUnlockScreen).onResume(); } - if (mLockPatternUtils.usingBiometricWeak()) { + if (mLockPatternUtils.usingBiometricWeak() && + mLockPatternUtils.isBiometricWeakInstalled()) { mHandler.sendEmptyMessage(MSG_SHOW_FACELOCK_AREA_VIEW); } else { mHandler.sendEmptyMessage(MSG_HIDE_FACELOCK_AREA_VIEW); @@ -1014,7 +1015,8 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler // Binds to FaceLock service, but does not tell it to start public void bindToFaceLock() { - if (mLockPatternUtils.usingBiometricWeak()) { + if (mLockPatternUtils.usingBiometricWeak() && + mLockPatternUtils.isBiometricWeakInstalled()) { if (!mBoundToFaceLockService) { if (DEBUG) Log.d(TAG, "before bind to FaceLock service"); mContext.bindService(new Intent(IFaceLockInterface.class.getName()), @@ -1030,7 +1032,8 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler // Tells FaceLock to stop and then unbinds from the FaceLock service public void stopAndUnbindFromFaceLock() { - if (mLockPatternUtils.usingBiometricWeak()) { + if (mLockPatternUtils.usingBiometricWeak() && + mLockPatternUtils.isBiometricWeakInstalled()) { stopFaceLock(); if (mBoundToFaceLockService) { @@ -1079,7 +1082,8 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler // Tells the FaceLock service to start displaying its UI and perform recognition public void startFaceLock(IBinder windowToken, int x, int y, int h, int w) { - if (mLockPatternUtils.usingBiometricWeak()) { + if (mLockPatternUtils.usingBiometricWeak() && + mLockPatternUtils.isBiometricWeakInstalled()) { synchronized (mFaceLockServiceRunningLock) { if (!mFaceLockServiceRunning) { if (DEBUG) Log.d(TAG, "Starting FaceLock"); @@ -1099,7 +1103,8 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler // Tells the FaceLock service to stop displaying its UI and stop recognition public void stopFaceLock() { - if (mLockPatternUtils.usingBiometricWeak()) { + if (mLockPatternUtils.usingBiometricWeak() && + mLockPatternUtils.isBiometricWeakInstalled()) { // Note that attempting to stop FaceLock when it's not running is not an issue. // FaceLock can return, which stops it and then we try to stop it when the // screen is turned off. That's why we check. -- cgit v1.1