Fix 5405210: DevicePolicyManager doesn't allow Face Unlock

If Face Unlock is currently enabled when the device policy manager is installed
it now forces the user to choose a new acceptable lock type

Change-Id: I725e923240538df3f706251670bf497857d2a25f
This commit is contained in:
Danielle Millett
2011-10-04 12:18:51 -04:00
parent 3c5cef23aa
commit c8fb532d45

View File

@@ -346,12 +346,21 @@ public class LockPatternUtils {
*/
public int getActivePasswordQuality() {
int activePasswordQuality = DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
switch (getKeyguardStoredPasswordQuality()) {
// Note we don't want to use getKeyguardStoredPasswordQuality() because we want this to
// return biometric_weak if that is being used instead of the backup
int quality =
(int) getLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
switch (quality) {
case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
if (isLockPatternEnabled()) {
activePasswordQuality = DevicePolicyManager.PASSWORD_QUALITY_SOMETHING;
}
break;
case DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK:
if (isBiometricWeakInstalled()) {
activePasswordQuality = DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK;
}
break;
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC:
if (isLockPasswordEnabled()) {
activePasswordQuality = DevicePolicyManager.PASSWORD_QUALITY_NUMERIC;
@@ -373,6 +382,7 @@ public class LockPatternUtils {
}
break;
}
return activePasswordQuality;
}