Loading policy/src/com/android/internal/policy/impl/BiometricSensorUnlock.java +1 −2 Original line number Diff line number Diff line Loading @@ -21,8 +21,7 @@ import android.view.View; interface BiometricSensorUnlock { /** * Initializes the view provided for the biometric unlock UI to work within. The provided area * completely covers the backup unlock mechanism. The view is then displayed in the same manner * as if {@link BiometricSensorUnlock#show(long)} was called with a timeout of 0. * completely covers the backup unlock mechanism. * @param biometricUnlockView View provided for the biometric unlock UI. */ public void initializeView(View biometricUnlockView); Loading policy/src/com/android/internal/policy/impl/FaceUnlock.java +0 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,6 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { public void initializeView(View biometricUnlockView) { Log.d(TAG, "initializeView()"); mFaceUnlockView = biometricUnlockView; show(0); } /** Loading policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java +51 −30 Original line number Diff line number Diff line Loading @@ -414,12 +414,6 @@ public class LockPatternKeyguardView extends KeyguardViewBase { } }; // Indicates whether a biometric unlock method is in use private boolean isBiometricUnlockInstalledAndSelected() { return (mLockPatternUtils.usingBiometricWeak() && mLockPatternUtils.isBiometricWeakInstalled()); } /** * @param context Used to inflate, and create views. * @param callback Keyguard callback object for pokewakelock(), etc. Loading @@ -443,14 +437,6 @@ public class LockPatternKeyguardView extends KeyguardViewBase { sIsFirstAppearanceAfterBoot = false; mPluggedIn = mUpdateMonitor.isDevicePluggedIn(); mScreenOn = ((PowerManager)context.getSystemService(Context.POWER_SERVICE)).isScreenOn(); // If the biometric unlock is not being used, we don't bother constructing it. Then we can // simply check if it is null when deciding whether we should make calls to it. if (isBiometricUnlockInstalledAndSelected()) { mBiometricUnlock = new FaceUnlock(context, updateMonitor, lockPatternUtils, mKeyguardScreenCallback); } mUpdateMonitor.registerInfoCallback(mInfoCallback); /** Loading Loading @@ -848,19 +834,11 @@ public class LockPatternKeyguardView extends KeyguardViewBase { } } // Re-create the unlock screen if necessary. This is primarily required to properly handle // SIM state changes. This typically happens when this method is called by reset() // Re-create the unlock screen if necessary. final UnlockMode unlockMode = getUnlockMode(); if (mode == Mode.UnlockScreen && unlockMode != UnlockMode.Unknown) { if (force || mUnlockScreen == null || unlockMode != mUnlockScreenMode) { boolean restartBiometricUnlock = false; if (mBiometricUnlock != null) { restartBiometricUnlock = mBiometricUnlock.stop(); } recreateUnlockScreen(unlockMode); if (mBiometricUnlock != null && restartBiometricUnlock) { maybeStartBiometricUnlock(); } } } Loading Loading @@ -973,13 +951,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase { throw new IllegalArgumentException("unknown unlock mode " + unlockMode); } initializeTransportControlView(unlockView); if (mBiometricUnlock != null) { // TODO: make faceLockAreaView a more general biometricUnlockView // We will need to add our Face Unlock specific child views programmatically in // initializeView rather than having them in the XML files. mBiometricUnlock.initializeView(unlockView.findViewById(R.id.faceLockAreaView)); } initializeBiometricUnlockView(unlockView); mUnlockScreenMode = unlockMode; return unlockView; Loading @@ -996,6 +968,55 @@ public class LockPatternKeyguardView extends KeyguardViewBase { } } /** * This returns false if there is any condition that indicates that the biometric unlock should * not be used before the next time the unlock screen is recreated. In other words, if this * returns false there is no need to even construct the biometric unlock. */ private boolean useBiometricUnlock() { final UnlockMode unlockMode = getUnlockMode(); final boolean backupIsTimedOut = (mUpdateMonitor.getFailedAttempts() >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT); return (mLockPatternUtils.usingBiometricWeak() && mLockPatternUtils.isBiometricWeakInstalled() && !mUpdateMonitor.getMaxBiometricUnlockAttemptsReached() && !backupIsTimedOut && (unlockMode == UnlockMode.Pattern || unlockMode == UnlockMode.Password)); } private void initializeBiometricUnlockView(View view) { boolean restartBiometricUnlock = false; if (mBiometricUnlock != null) { restartBiometricUnlock = mBiometricUnlock.stop(); } // If the biometric unlock is not being used, we don't bother constructing it. Then we can // simply check if it is null when deciding whether we should make calls to it. mBiometricUnlock = null; if (useBiometricUnlock()) { // TODO: make faceLockAreaView a more general biometricUnlockView // We will need to add our Face Unlock specific child views programmatically in // initializeView rather than having them in the XML files. View biometricUnlockView = view.findViewById(R.id.faceLockAreaView); if (biometricUnlockView != null) { mBiometricUnlock = new FaceUnlock(mContext, mUpdateMonitor, mLockPatternUtils, mKeyguardScreenCallback); mBiometricUnlock.initializeView(biometricUnlockView); // If this is being called because the screen turned off, we want to cover the // backup lock so it is covered when the screen turns back on. if (!mScreenOn) mBiometricUnlock.show(0); } else { Log.w(TAG, "Couldn't find biometric unlock view"); } } if (mBiometricUnlock != null && restartBiometricUnlock) { maybeStartBiometricUnlock(); } } /** * Given the current state of things, what should be the initial mode of * the lock screen (lock or unlock). Loading Loading
policy/src/com/android/internal/policy/impl/BiometricSensorUnlock.java +1 −2 Original line number Diff line number Diff line Loading @@ -21,8 +21,7 @@ import android.view.View; interface BiometricSensorUnlock { /** * Initializes the view provided for the biometric unlock UI to work within. The provided area * completely covers the backup unlock mechanism. The view is then displayed in the same manner * as if {@link BiometricSensorUnlock#show(long)} was called with a timeout of 0. * completely covers the backup unlock mechanism. * @param biometricUnlockView View provided for the biometric unlock UI. */ public void initializeView(View biometricUnlockView); Loading
policy/src/com/android/internal/policy/impl/FaceUnlock.java +0 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,6 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { public void initializeView(View biometricUnlockView) { Log.d(TAG, "initializeView()"); mFaceUnlockView = biometricUnlockView; show(0); } /** Loading
policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java +51 −30 Original line number Diff line number Diff line Loading @@ -414,12 +414,6 @@ public class LockPatternKeyguardView extends KeyguardViewBase { } }; // Indicates whether a biometric unlock method is in use private boolean isBiometricUnlockInstalledAndSelected() { return (mLockPatternUtils.usingBiometricWeak() && mLockPatternUtils.isBiometricWeakInstalled()); } /** * @param context Used to inflate, and create views. * @param callback Keyguard callback object for pokewakelock(), etc. Loading @@ -443,14 +437,6 @@ public class LockPatternKeyguardView extends KeyguardViewBase { sIsFirstAppearanceAfterBoot = false; mPluggedIn = mUpdateMonitor.isDevicePluggedIn(); mScreenOn = ((PowerManager)context.getSystemService(Context.POWER_SERVICE)).isScreenOn(); // If the biometric unlock is not being used, we don't bother constructing it. Then we can // simply check if it is null when deciding whether we should make calls to it. if (isBiometricUnlockInstalledAndSelected()) { mBiometricUnlock = new FaceUnlock(context, updateMonitor, lockPatternUtils, mKeyguardScreenCallback); } mUpdateMonitor.registerInfoCallback(mInfoCallback); /** Loading Loading @@ -848,19 +834,11 @@ public class LockPatternKeyguardView extends KeyguardViewBase { } } // Re-create the unlock screen if necessary. This is primarily required to properly handle // SIM state changes. This typically happens when this method is called by reset() // Re-create the unlock screen if necessary. final UnlockMode unlockMode = getUnlockMode(); if (mode == Mode.UnlockScreen && unlockMode != UnlockMode.Unknown) { if (force || mUnlockScreen == null || unlockMode != mUnlockScreenMode) { boolean restartBiometricUnlock = false; if (mBiometricUnlock != null) { restartBiometricUnlock = mBiometricUnlock.stop(); } recreateUnlockScreen(unlockMode); if (mBiometricUnlock != null && restartBiometricUnlock) { maybeStartBiometricUnlock(); } } } Loading Loading @@ -973,13 +951,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase { throw new IllegalArgumentException("unknown unlock mode " + unlockMode); } initializeTransportControlView(unlockView); if (mBiometricUnlock != null) { // TODO: make faceLockAreaView a more general biometricUnlockView // We will need to add our Face Unlock specific child views programmatically in // initializeView rather than having them in the XML files. mBiometricUnlock.initializeView(unlockView.findViewById(R.id.faceLockAreaView)); } initializeBiometricUnlockView(unlockView); mUnlockScreenMode = unlockMode; return unlockView; Loading @@ -996,6 +968,55 @@ public class LockPatternKeyguardView extends KeyguardViewBase { } } /** * This returns false if there is any condition that indicates that the biometric unlock should * not be used before the next time the unlock screen is recreated. In other words, if this * returns false there is no need to even construct the biometric unlock. */ private boolean useBiometricUnlock() { final UnlockMode unlockMode = getUnlockMode(); final boolean backupIsTimedOut = (mUpdateMonitor.getFailedAttempts() >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT); return (mLockPatternUtils.usingBiometricWeak() && mLockPatternUtils.isBiometricWeakInstalled() && !mUpdateMonitor.getMaxBiometricUnlockAttemptsReached() && !backupIsTimedOut && (unlockMode == UnlockMode.Pattern || unlockMode == UnlockMode.Password)); } private void initializeBiometricUnlockView(View view) { boolean restartBiometricUnlock = false; if (mBiometricUnlock != null) { restartBiometricUnlock = mBiometricUnlock.stop(); } // If the biometric unlock is not being used, we don't bother constructing it. Then we can // simply check if it is null when deciding whether we should make calls to it. mBiometricUnlock = null; if (useBiometricUnlock()) { // TODO: make faceLockAreaView a more general biometricUnlockView // We will need to add our Face Unlock specific child views programmatically in // initializeView rather than having them in the XML files. View biometricUnlockView = view.findViewById(R.id.faceLockAreaView); if (biometricUnlockView != null) { mBiometricUnlock = new FaceUnlock(mContext, mUpdateMonitor, mLockPatternUtils, mKeyguardScreenCallback); mBiometricUnlock.initializeView(biometricUnlockView); // If this is being called because the screen turned off, we want to cover the // backup lock so it is covered when the screen turns back on. if (!mScreenOn) mBiometricUnlock.show(0); } else { Log.w(TAG, "Couldn't find biometric unlock view"); } } if (mBiometricUnlock != null && restartBiometricUnlock) { maybeStartBiometricUnlock(); } } /** * Given the current state of things, what should be the initial mode of * the lock screen (lock or unlock). Loading