diff options
author | Pavel Grafov <pgrafov@google.com> | 2019-09-18 14:13:56 +0100 |
---|---|---|
committer | Pavel Grafov <pgrafov@google.com> | 2019-09-24 16:11:44 +0100 |
commit | 26fccb7dceff685e745994767f55abbb4116d1b7 (patch) | |
tree | 0f2410d3addba147929e20ceeeb64ea21135ce4b /tools/aapt2/java/JavaClassGenerator.cpp | |
parent | e75b4a7d08268e802d21af16ab624710e924030a (diff) |
Throw if admin sets password constraints that have no effect.
For admin apps targeting R+, throw when the app sets password requirement
that is not taken into account at given quality, e.g. when quality is set
to UNSPECIFIED, it doesn't make sense to require certain password length.
If the intent is to require a password of certain length having at least
NUMERIC quality, the admin should first call setPasswordQuality() and only
then call setPasswordMinimumLength().
Conversely when an admin targeting R+ lowers password quality, those
requiremnts that stop making sense, are reset to default values.
+ fix the behaviour of getPasswordMinimumLength to match the docs: only
admins with password quality >= NUMERIC should be taken into account.
Test: com.android.cts.devicepolicy..MixedDeviceOwnerTest#testResetPasswordWithToken
Test: com.android.cts.devicepolicy.DeviceAdminHostSideTestApi23#testRunDeviceOwnerPasswordTest
Test: com.android.cts.devicepolicy.MixedDeviceOwnerTestApi#testPasswordRequirementsApi
Test: com.android.cts.devicepolicy.MixedDeviceOwnerTestApi25#testPasswordRequirementsApi
Bug: 123562444
Change-Id: Id134a7918718e3b0a220caaf6c672df4238a062c
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions