Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82c2d94e authored by Rubin Xu's avatar Rubin Xu Committed by Android (Google) Code Review
Browse files

Merge "Normalize empty credential into null"

parents 7bde762f df406d80
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -1064,6 +1064,14 @@ public class LockSettingsService extends ILockSettings.Stub {


    private void setLockCredentialInternal(String credential, int credentialType,
    private void setLockCredentialInternal(String credential, int credentialType,
            String savedCredential, int userId) throws RemoteException {
            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) {
        synchronized (mSpManager) {
            if (isSyntheticPasswordBasedCredentialLocked(userId)) {
            if (isSyntheticPasswordBasedCredentialLocked(userId)) {
                spBasedSetLockCredentialInternalLocked(credential, credentialType, savedCredential,
                spBasedSetLockCredentialInternalLocked(credential, credentialType, savedCredential,