Normalize empty credential into null
Test: runtest frameworks-services -c com.android.server.LockSettingsServiceTests Bug: 31000522 Change-Id: I2f804a5790449f0d2d4d57fe6e34be03a84fb805
This commit is contained in:
@@ -1064,6 +1064,14 @@ public class LockSettingsService extends ILockSettings.Stub {
|
||||
|
||||
private void setLockCredentialInternal(String credential, int credentialType,
|
||||
String savedCredential, int userId) throws RemoteException {
|
||||
// Normalize savedCredential and credential such that empty string is always represented
|
||||
// as null.
|
||||
if (TextUtils.isEmpty(savedCredential)) {
|
||||
savedCredential = null;
|
||||
}
|
||||
if (TextUtils.isEmpty(credential)) {
|
||||
credential = null;
|
||||
}
|
||||
synchronized (mSpManager) {
|
||||
if (isSyntheticPasswordBasedCredentialLocked(userId)) {
|
||||
spBasedSetLockCredentialInternalLocked(credential, credentialType, savedCredential,
|
||||
|
||||
Reference in New Issue
Block a user