diff options
author | Steven Ross <stross@google.com> | 2011-11-11 13:35:09 -0500 |
---|---|---|
committer | Steven Ross <stross@google.com> | 2011-11-30 19:48:38 -0500 |
commit | 94c05482240f743daa8c8698a241d1d0dfe2404c (patch) | |
tree | 36af5eb312cfe745b86614fa8a8d37d12bfff3c8 /src/com/android/settings/CryptKeeperSettings.java | |
parent | 7129322d0685059e925fc692ef9b1c48c5ff3128 (diff) | |
download | packages_apps_Settings-94c05482240f743daa8c8698a241d1d0dfe2404c.zip packages_apps_Settings-94c05482240f743daa8c8698a241d1d0dfe2404c.tar.gz packages_apps_Settings-94c05482240f743daa8c8698a241d1d0dfe2404c.tar.bz2 |
Allowing FaceUnlock with a PIN fixes 5467194
We need to allow FaceUnlock if the backup lock supports encryption (PIN).
This requires changing the way the minimum encryption quality is enforced
to allow FaceUnlock as long as the backup lock is a PIN, as FaceUnlock
is considered a lower security than the minimum for encrypted drives.
This change adds some complexity to upgradeQualityForEncryption because it's
used in two places: once to grey out selections that aren't sufficient
security level, and second to force the user to use a higher security level.
This still increases the minimum security level,
but makes an exception for FaceUnlock if it's allowed without encryption.
This uses a MutableBoolean to provide a mutable boolean capability.
We could instead write a custom one or use some other type of mutable
boolean if it exists.
In CryptKeeperSettings, using getKeyguardStoredPasswordQuality directly instead
of getActivePasswordQuality is simpler, but this uses a more complex approach
with a minor tweak as jaggies suggested it and it is clear about the
biometric exception being made.
Change-Id: Ia2645d6bd98857c79c6a9be45eda98087bfe517a
Diffstat (limited to 'src/com/android/settings/CryptKeeperSettings.java')
-rw-r--r-- | src/com/android/settings/CryptKeeperSettings.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/settings/CryptKeeperSettings.java b/src/com/android/settings/CryptKeeperSettings.java index 41a4be5..ce3ad9d 100644 --- a/src/com/android/settings/CryptKeeperSettings.java +++ b/src/com/android/settings/CryptKeeperSettings.java @@ -159,7 +159,14 @@ public class CryptKeeperSettings extends Fragment { */ private boolean runKeyguardConfirmation(int request) { // 1. Confirm that we have a sufficient PIN/Password to continue - int quality = new LockPatternUtils(getActivity()).getActivePasswordQuality(); + LockPatternUtils lockPatternUtils = new LockPatternUtils(getActivity()); + int quality = lockPatternUtils.getActivePasswordQuality(); + if (quality == DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK + && lockPatternUtils.isLockPasswordEnabled()) { + // Use the alternate as the quality. We expect this to be + // PASSWORD_QUALITY_SOMETHING(pattern) or PASSWORD_QUALITY_NUMERIC(PIN). + quality = lockPatternUtils.getKeyguardStoredPasswordQuality(); + } if (quality < MIN_PASSWORD_QUALITY) { return false; } |