Android.App.Admin.DevicePolicyManager.SetPasswordMinimumLength Method
Called by an application that is administering the device to set the minimum allowed password length.

Syntax

[Android.Runtime.Register("setPasswordMinimumLength", "(Landroid/content/ComponentName;I)V", "GetSetPasswordMinimumLength_Landroid_content_ComponentName_IHandler")]
public virtual void SetPasswordMinimumLength (Android.Content.ComponentName admin, int length)

Parameters

admin
Which Android.App.Admin.DeviceAdminReceiver this request is associated with.
length
The new desired minimum password length. A value of 0 means there is no restriction.

Remarks

Called by an application that is administering the device to set the minimum allowed password length. After setting this, the user will not be able to enter a new password that is not at least as restrictive as what has been set. Note that the current password will remain until the user has set a new one, so the change does not take place immediately. To prompt the user for a new password, use DevicePolicyManager.ActionSetNewPassword after setting this value. This constraint is only imposed if the administrator has also requested either DevicePolicyManager.PASSWORD_QUALITY_NUMERIC, DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX, DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC, DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC, or DevicePolicyManager.PASSWORD_QUALITY_COMPLEX with DevicePolicyManager.SetPasswordQuality(Android.Content.ComponentName, Android.App.Admin.PasswordQuality).

The calling device admin must have requested DeviceAdminInfo.UsesPolicyLimitPassword to be able to call this method; if it has not, a security exception will be thrown.

[Android Documentation]

Requirements

Namespace: Android.App.Admin
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 8