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

Commit ba45bcb3 authored by Paul Lawrence's avatar Paul Lawrence
Browse files

Fix DeviceManagerAdmin with empty password

Checked for null, but need to check for "" as well

Bug: 15832986
Change-Id: I3dc5d61717180180229f2395eef1dbe54d812d54
parent 6792a233
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -689,7 +689,7 @@ public class LockPatternUtils {
        try {
            getLockSettings().setLockPassword(password, userHandle);
            DevicePolicyManager dpm = getDevicePolicyManager();
            if (password != null) {
            if (!TextUtils.isEmpty(password)) {
                int computedQuality = computePasswordQuality(password);

                if (userHandle == UserHandle.USER_OWNER) {
@@ -764,9 +764,10 @@ public class LockPatternUtils {
                }
                setString(PASSWORD_HISTORY_KEY, passwordHistory, userHandle);
            } else {
                // Empty password
                if (userHandle == UserHandle.USER_OWNER) {
                    // Update the encryption password.
                    updateEncryptionPassword(StorageManager.CRYPT_TYPE_DEFAULT, password);
                    // Set the encryption password to default.
                    updateEncryptionPassword(StorageManager.CRYPT_TYPE_DEFAULT, null);
                }

                dpm.setActivePasswordState(