Merge "Fix 5405210: DevicePolicyManager doesn't allow Face Unlock"
This commit is contained in:
committed by
Android (Google) Code Review
commit
b177b190a0
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user