Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54e46b25 authored by Andrew Scull's avatar Andrew Scull Committed by android-build-merger
Browse files

Only check password length for relevant qualities. am: 83ab8541

am: fce4b4ac

Change-Id: I6ebe80ddbe2f49b2b98b6abc56ba4a9246feed97
parents a53ba91c fce4b4ac
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -3673,12 +3673,16 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {

    private boolean isActivePasswordSufficientForUserLocked(
            DevicePolicyData policy, int userHandle, boolean parent) {
        if (policy.mActivePasswordQuality < getPasswordQuality(null, userHandle, parent)
                || policy.mActivePasswordLength < getPasswordMinimumLength(
        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;
        }
        if (policy.mActivePasswordQuality != DevicePolicyManager.PASSWORD_QUALITY_COMPLEX) {
        if (requiredPasswordQuality != DevicePolicyManager.PASSWORD_QUALITY_COMPLEX) {
            return true;
        }
        return policy.mActivePasswordUpperCase >= getPasswordMinimumUpperCase(