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

Commit ab7dae58 authored by Adrian Roos's avatar Adrian Roos
Browse files

Ensure that setting an empty password clears it

Bug: 17496766
Change-Id: I7c29b632519247bc5675a05ef6cc90902fec8527
parent e1b032a8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -773,9 +773,9 @@ public class LockPatternUtils {
     */
    public void saveLockPassword(String password, int quality, boolean isFallback, int userHandle) {
        try {
            getLockSettings().setLockPassword(password, userHandle);
            DevicePolicyManager dpm = getDevicePolicyManager();
            if (!TextUtils.isEmpty(password)) {
                getLockSettings().setLockPassword(password, userHandle);
                int computedQuality = computePasswordQuality(password);

                if (userHandle == UserHandle.USER_OWNER) {
@@ -853,6 +853,7 @@ public class LockPatternUtils {
                setString(PASSWORD_HISTORY_KEY, passwordHistory, userHandle);
            } else {
                // Empty password
                getLockSettings().setLockPassword(null, userHandle);
                if (userHandle == UserHandle.USER_OWNER) {
                    // Set the encryption password to default.
                    updateEncryptionPassword(StorageManager.CRYPT_TYPE_DEFAULT, null);