Respect PASSWORD_QUALITY_MANAGED for biometrics

Bug: 195488124
Test: manual with a modified TestDPC
Change-Id: I3e5d0f6911e1fd785ac249b0dfeb2c7e4cca69df
This commit is contained in:
Pavel Grafov
2021-09-07 18:09:46 +01:00
parent 9ca7052183
commit 6553b4b249

View File

@@ -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
*/