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

Commit a238881e authored by Pavel Grafov's avatar Pavel Grafov Committed by Android (Google) Code Review
Browse files

Merge "Respect PASSWORD_QUALITY_MANAGED for biometrics" into sc-qpr1-dev

parents caad2a3f 6553b4b2
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.internal.widget;

import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC;
import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_MANAGED;
import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_NUMERIC;
import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX;
import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_SOMETHING;
@@ -1271,6 +1272,14 @@ public class LockPatternUtils {
        }
    }

    /**
     * Whether the user is not allowed to set any credentials via PASSWORD_QUALITY_MANAGED.
     */
    public boolean isCredentialsDisabledForUser(int userId) {
        return getDevicePolicyManager().getPasswordQuality(/* admin= */ null, userId)
                == PASSWORD_QUALITY_MANAGED;
    }

    /**
     * @see StrongAuthTracker#isTrustAllowedForUser
     */