Add and use PasswordMetrics#validateCredential()
Add a method PasswordMetrics#validateCredential() which takes a LockscreenCredential argument and honors the "invalid chars" flag in it. This should be used instead of PasswordMetrics#validatePassword() which does not honor the "invalid chars" flag (which it does not have access to) and only works for PASSWORD and PIN, not PATTERN and NONE. Convert all callers of validatePassword() in frameworks/base to use validateCredential(). After this, two callers remain: one in packages/apps/Settings which I'll convert right away too, and several in packages/apps/Car/Settings which will take a bit longer to get rid of. Bug: 219511761 Bug: 232900169 Bug: 243881358 Test: atest PasswordMetricsTest Test: Verified that 'locksettings set-password' no longer accepts a non-ASCII char that was accepted before Test: see I5f1822a34688473cb103eb64dca56e4c19d4dd08 Change-Id: Ib8f43aef5b5aa5bb059780707582d0419f9ddf9a
Loading
Please register or sign in to comment