DevicePolicyManager.IsActivePasswordSufficient Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determines whether the calling user's current password meets policy requirements (e.
public virtual bool IsActivePasswordSufficient { [Android.Runtime.Register("isActivePasswordSufficient", "()Z", "GetIsActivePasswordSufficientHandler")] [Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS")] get; }
[<get: Android.Runtime.Register("isActivePasswordSufficient", "()Z", "GetIsActivePasswordSufficientHandler")>]
[<get: Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS")>]
member this.IsActivePasswordSufficient : bool
Property Value
true
if the password meets the policy requirements, false
otherwise
- Attributes
Remarks
Determines whether the calling user's current password meets policy requirements (e.g. quality, minimum length). The user must be unlocked to perform this check.
Policy requirements which affect this check can be set by admins of the user, but also by the admin of a managed profile associated with the calling user (when the managed profile doesn't have a separate work challenge). When a managed profile has a separate work challenge, its policy requirements only affect the managed profile.
Depending on the user, this method checks the policy requirement against one of the following passwords: <ul> <li>For the primary user or secondary users: the personal keyguard password. <li>For managed profiles: a work challenge if set, otherwise the parent user's personal keyguard password. <ul/> In other words, it's always checking the requirement against the password that is protecting the calling user.
Note that this method considers all policy requirements targeting the password in question. For example a profile owner might set a requirement on the parent profile i.e. personal keyguard but not on the profile itself. When the device has a weak personal keyguard password and no separate work challenge, calling this method will return false
despite the profile owner not setting a policy on the profile itself. This is because the profile's current password is the personal keyguard password, and it does not meet all policy requirements.
Device admins must request DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD
before calling this method. Note, this policy type is deprecated for device admins in Android 9.0 (API level 28) or higher.
This method can be called on the DevicePolicyManager
instance returned by #getParentProfileInstance(ComponentName)
in order to determine if the password set on the parent profile is sufficient.
On devices not supporting PackageManager#FEATURE_SECURE_LOCK_SCREEN
feature, the password is always treated as empty - i.e. this method will always return false on such devices, provided any password requirements were set.
Java documentation for android.app.admin.DevicePolicyManager.isActivePasswordSufficient()
.
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.