Visualize password requirements and their fulfillment

1. Aggregate policies and generate the requirements
2. When user modifies the password, check is each requirement fulfilled
   Update the view accordingly.

Change-Id: I962ed3b81ce844006be1024a493e94ce52a3fdec
Fix: 24900754
This commit is contained in:
Tony Mak
2016-07-12 11:19:45 +01:00
parent 9a8e5a7f25
commit 0bbcdccdbf
8 changed files with 542 additions and 186 deletions

View File

@@ -305,4 +305,9 @@
<dimen name="support_tile_min_height">48dp</dimen>
<!-- support spacer layout height -->
<dimen name="support_spacer_height">8dp</dimen>
<dimen name="password_requirement_textsize">14sp</dimen>
<!-- Visible vertical space we want to show below password edittext field when ime is shown.
The unit is sp as it is related to the text size of password requirement item. -->
<dimen name="visible_vertical_space_below_password">20sp</dimen>
</resources>

View File

@@ -1166,7 +1166,7 @@
<string name="lock_profile_wipe_dismiss">Dismiss</string>
<!-- Hint shown in dialog screen when password is too short -->
<string name="lockpassword_password_too_short">Password must be at least %d characters</string>
<string name="lockpassword_password_too_short">Must be at least %d characters</string>
<!-- Hint shown in dialog screen when PIN is too short -->
<string name="lockpassword_pin_too_short">PIN must be at least %d digits</string>
@@ -1174,62 +1174,62 @@
<string name="lockpassword_continue_label">Continue</string>
<!-- Error shown in popup when password is too long -->
<string name="lockpassword_password_too_long">Password must be fewer than <xliff:g id="number" example="17">%d</xliff:g> characters.</string>
<string name="lockpassword_password_too_long">Must be fewer than <xliff:g id="number" example="17">%d</xliff:g> characters.</string>
<!-- Error shown in popup when PIN is too long -->
<string name="lockpassword_pin_too_long">PIN must be fewer than <xliff:g id="number" example="17">%d</xliff:g> digits.</string>
<string name="lockpassword_pin_too_long">Must be fewer than <xliff:g id="number" example="17">%d</xliff:g> digits.</string>
<!-- Error shown when in PIN mode and user enters a non-digit -->
<string name="lockpassword_pin_contains_non_digits">PIN must contain only digits 0-9.</string>
<string name="lockpassword_pin_contains_non_digits">Must contain only digits 0-9.</string>
<!-- Error shown when in PIN mode and PIN has been used recently. Please keep this string short! -->
<string name="lockpassword_pin_recently_used">Device administrator doesn\u2019t allow using a recent PIN.</string>
<!-- Error shown when in PASSWORD mode and user enters an invalid character -->
<string name="lockpassword_illegal_character">Password contains an illegal character.</string>
<string name="lockpassword_illegal_character">This can\'t include an invalid character</string>
<!-- Error shown when in PASSWORD mode and password is all digits -->
<string name="lockpassword_password_requires_alpha">Password must contain at least one letter.</string>
<string name="lockpassword_password_requires_alpha">Must contain at least one letter</string>
<!-- Error shown when in PASSWORD mode and password doesn't contain any digits -->
<string name="lockpassword_password_requires_digit">Password must contain at least one digit.</string>
<string name="lockpassword_password_requires_digit">Must contain at least one digit</string>
<!-- Error shown when in PASSWORD mode and password doesn't contain any symbols -->
<string name="lockpassword_password_requires_symbol">Password must contain at least one symbol.</string>
<string name="lockpassword_password_requires_symbol">Must contain at least one symbol</string>
<!-- Error shown when in PASSWORD mode and password doesn't contain the required number of letters -->
<plurals name="lockpassword_password_requires_letters">
<item quantity="one">Password must contain at least 1 letter.</item>
<item quantity="other">Password must contain at least %d letters.</item>
<item quantity="one">Must contain at least 1 letter</item>
<item quantity="other">Must contain at least %d letters</item>
</plurals>
<!-- Error shown when in PASSWORD mode and password doesn't contain the required number of lowercase letters -->
<plurals name="lockpassword_password_requires_lowercase">
<item quantity="one">Password must contain at least 1 lowercase letter.</item>
<item quantity="other">Password must contain at least %d lowercase letters.</item>
<item quantity="one">Must contain at least 1 lowercase letter</item>
<item quantity="other">Must contain at least %d lowercase letters</item>
</plurals>
<!-- Error shown when in PASSWORD mode and password doesn't contain the required number of uppercase letters -->
<plurals name="lockpassword_password_requires_uppercase">
<item quantity="one">Password must contain at least 1 uppercase letter.</item>
<item quantity="other">Password must contain at least %d uppercase letters.</item>
<item quantity="one">Must contain at least 1 uppercase letter</item>
<item quantity="other">Must contain at least %d uppercase letters</item>
</plurals>
<!-- Error shown when in PASSWORD mode and password doesn't contain the required number of numerical digits -->
<plurals name="lockpassword_password_requires_numeric">
<item quantity="one">Password must contain at least 1 numerical digit.</item>
<item quantity="other">Password must contain at least %d numerical digits.</item>
<item quantity="one">Must contain at least 1 numerical digit</item>
<item quantity="other">Must contain at least %d numerical digits</item>
</plurals>
<!-- Error shown when in PASSWORD mode and password doesn't contain the required number of special symbols -->
<plurals name="lockpassword_password_requires_symbols">
<item quantity="one">Password must contain at least 1 special symbol.</item>
<item quantity="other">Password must contain at least %d special symbols.</item>
<item quantity="one">Must contain at least 1 special symbol</item>
<item quantity="other">Must contain at least %d special symbols</item>
</plurals>
<!-- Error shown when in PASSWORD mode and password doesn't contain the required number of non-letter characters -->
<plurals name="lockpassword_password_requires_nonletter">
<item quantity="one">Password must contain at least 1 non-letter character.</item>
<item quantity="other">Password must contain at least %d non-letter characters.</item>
<item quantity="one">Must contain at least 1 non-letter character</item>
<item quantity="other">Must contain at least %d non-letter characters</item>
</plurals>
<!-- Error shown when in PASSWORD mode and password has been used recently. Please keep this string short! -->