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

Commit abc113dc authored by Alex Johnston's avatar Alex Johnston
Browse files

Update API contract PASSWORD_COMPLEXITY_LOW

* Mention any PIN is allowed, not necessarily
  just ordered or repeating PINs.
* Mention alphanumeric and alphabetic passwords
  are allowed.

Bug: 181873824
Test: build
Change-Id: Iac75dbdde18de39e0b66ab03463830f5b4f28033
parent f8359036
Loading
Loading
Loading
Loading
+30 −10
Original line number Diff line number Diff line
@@ -1605,20 +1605,29 @@ public class DevicePolicyManager {
            "android.app.extra.PASSWORD_COMPLEXITY";
    /**
     * Constant for {@link #getPasswordComplexity()}: no password.
     * Constant for {@link #getPasswordComplexity()} and
     * {@link #setRequiredPasswordComplexity(int)}: no password.
     *
     * <p>Note that these complexity constants are ordered so that higher values are more complex.
     * <p> When returned from {@link #getPasswordComplexity()}, the constant represents
     * the exact complexity band the password is in.
     * When passed to {@link #setRequiredPasswordComplexity(int), it sets the minimum complexity
     * band which the password must meet.
     */
    public static final int PASSWORD_COMPLEXITY_NONE = 0;
    /**
     * Constant for {@link #getPasswordComplexity()}: password satisfies one of the following:
     * Constant for {@link #getPasswordComplexity()} and
     * {@link #setRequiredPasswordComplexity(int)}.
     * Define the low password complexity band as:
     * <ul>
     * <li>pattern
     * <li>PIN with repeating (4444) or ordered (1234, 4321, 2468) sequences
     * </ul>
     *
     * <p>Note that these complexity constants are ordered so that higher values are more complex.
     * <p> When returned from {@link #getPasswordComplexity()}, the constant represents
     * the exact complexity band the password is in.
     * When passed to {@link #setRequiredPasswordComplexity(int), it sets the minimum complexity
     * band which the password must meet.
     *
     * @see #PASSWORD_QUALITY_SOMETHING
     * @see #PASSWORD_QUALITY_NUMERIC
@@ -1626,7 +1635,9 @@ public class DevicePolicyManager {
    public static final int PASSWORD_COMPLEXITY_LOW = 0x10000;
    /**
     * Constant for {@link #getPasswordComplexity()}: password satisfies one of the following:
     * Constant for {@link #getPasswordComplexity()} and
     * {@link #setRequiredPasswordComplexity(int)}.
     * Define the medium password complexity band as:
     * <ul>
     * <li>PIN with <b>no</b> repeating (4444) or ordered (1234, 4321, 2468) sequences, length at
     * least 4
@@ -1634,7 +1645,10 @@ public class DevicePolicyManager {
     * <li>alphanumeric, length at least 4
     * </ul>
     *
     * <p>Note that these complexity constants are ordered so that higher values are more complex.
     * <p> When returned from {@link #getPasswordComplexity()}, the constant represents
     * the exact complexity band the password is in.
     * When passed to {@link #setRequiredPasswordComplexity(int), it sets the minimum complexity
     * band which the password must meet.
     *
     * @see #PASSWORD_QUALITY_NUMERIC_COMPLEX
     * @see #PASSWORD_QUALITY_ALPHABETIC
@@ -1643,7 +1657,9 @@ public class DevicePolicyManager {
    public static final int PASSWORD_COMPLEXITY_MEDIUM = 0x30000;
    /**
     * Constant for {@link #getPasswordComplexity()}: password satisfies one of the following:
     * Constant for {@link #getPasswordComplexity()} and
     * {@link #setRequiredPasswordComplexity(int)}.
     * Define the high password complexity band as:
     * <ul>
     * <li>PIN with <b>no</b> repeating (4444) or ordered (1234, 4321, 2468) sequences, length at
     * least 8
@@ -1651,7 +1667,10 @@ public class DevicePolicyManager {
     * <li>alphanumeric, length at least 6
     * </ul>
     *
     * <p>Note that these complexity constants are ordered so that higher values are more complex.
     * <p> When returned from {@link #getPasswordComplexity()}, the constant represents
     * the exact complexity band the password is in.
     * When passed to {@link #setRequiredPasswordComplexity(int), it sets the minimum complexity
     * band which the password must meet.
     *
     * @see #PASSWORD_QUALITY_NUMERIC_COMPLEX
     * @see #PASSWORD_QUALITY_ALPHABETIC
@@ -4455,8 +4474,9 @@ public class DevicePolicyManager {
    }
    /**
     * Sets a password complexity requirement for the user's screen lock.
     * The complexity level is one of the pre-defined levels.
     * Sets a minimum password complexity requirement for the user's screen lock.
     * The complexity level is one of the pre-defined levels, and the user is unable to set a
     * password with a lower complexity level.
     *
     * <p>Note that when called on a profile which uses an unified challenge with its parent, the
     * complexity would apply to the unified challenge.