共用方式為


DevicePolicyManager.RequiredPasswordComplexity Property

Definition

Gets the password complexity requirement set by #setRequiredPasswordComplexity(int), for the current user. -or- Sets a minimum password complexity requirement for the user's screen lock.

public virtual int RequiredPasswordComplexity { [Android.Runtime.Register("getRequiredPasswordComplexity", "()I", "GetGetRequiredPasswordComplexityHandler", ApiSince=31)] [Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS")] get; [Android.Runtime.Register("setRequiredPasswordComplexity", "(I)V", "GetSetRequiredPasswordComplexity_IHandler", ApiSince=31)] [Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS")] set; }
[<get: Android.Runtime.Register("getRequiredPasswordComplexity", "()I", "GetGetRequiredPasswordComplexityHandler", ApiSince=31)>]
[<get: Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS")>]
[<set: Android.Runtime.Register("setRequiredPasswordComplexity", "(I)V", "GetSetRequiredPasswordComplexity_IHandler", ApiSince=31)>]
[<set: Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS")>]
member this.RequiredPasswordComplexity : int with get, set

Property Value

Attributes

Remarks

Property getter documentation:

Gets the password complexity requirement set by #setRequiredPasswordComplexity(int), for the current user.

The difference between this method and #getPasswordComplexity() is that this method simply returns the value set by #setRequiredPasswordComplexity(int) while #getPasswordComplexity() returns the complexity of the actual password.

This method can be called on the DevicePolicyManager instance returned by #getParentProfileInstance(ComponentName) in order to get restrictions on the parent profile.

Java documentation for android.app.admin.DevicePolicyManager.getRequiredPasswordComplexity().

Property setter documentation:

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.

Note that when called on a profile which uses an unified challenge with its parent, the complexity would apply to the unified challenge.

This method can be called on the DevicePolicyManager instance returned by #getParentProfileInstance(ComponentName) in order to set restrictions on the parent profile.

<strong>Note:</strong> Specifying password requirements using this method clears any password requirements set using the obsolete #setPasswordQuality(ComponentName, int) and any of its associated methods. Additionally, if there are password requirements set using the obsolete #setPasswordQuality(ComponentName, int) on the parent DevicePolicyManager instance, they must be cleared by calling #setPasswordQuality(ComponentName, int) with #PASSWORD_QUALITY_UNSPECIFIED on that instance prior to setting complexity requirement for the managed profile.

Java documentation for android.app.admin.DevicePolicyManager.setRequiredPasswordComplexity(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to