private boolean isActivePasswordSufficientForUserLocked(
DevicePolicyData policy, int userHandle, boolean parent) {
- if (policy.mActivePasswordQuality < getPasswordQuality(null, userHandle, parent)
- || policy.mActivePasswordLength < getPasswordMinimumLength(
+ enforceUserUnlocked(userHandle, parent);
+
+ final int requiredPasswordQuality = getPasswordQuality(null, userHandle, parent);
+ if (policy.mActivePasswordQuality < requiredPasswordQuality) {
+ return false;
+ }
+ if (requiredPasswordQuality >= DevicePolicyManager.PASSWORD_QUALITY_NUMERIC
+ && policy.mActivePasswordLength < getPasswordMinimumLength(
null, userHandle, parent)) {
return false;
}