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

Commit 1fa02a67 authored by pulser's avatar pulser Committed by Steve Kondik
Browse files

Separate Change Encryption Password Entry (2 of 2)

This permits the use of a different (hopefully longer and more complex!) encryption password,
while using a simpler (and easier to type) lockscreen password.

Requires Settings change to give UI for this

(port to cm11 - cyanogen)

Change-Id: Ib54532f92f4f3beb8713fd73e466ae46b7e15f7d
parent ba839ffa
Loading
Loading
Loading
Loading
+25 −5
Original line number Diff line number Diff line
@@ -644,11 +644,6 @@ public class LockPatternUtils {
            getLockSettings().setLockPassword(password, userHandle);
            DevicePolicyManager dpm = getDevicePolicyManager();
            if (password != null) {
                if (userHandle == UserHandle.USER_OWNER) {
                    // Update the encryption password.
                    updateEncryptionPassword(password);
                }

                int computedQuality = computePasswordQuality(password);
                if (!isFallback) {
                    deleteGallery();
@@ -726,6 +721,31 @@ public class LockPatternUtils {
        }
    }

    /**
     * @hide
     * Save a device encryption password.  Does not do any checking on complexity.
     * @param password The password to save
     */
    public void saveEncryptionPassword(String password) {
        saveEncryptionPassword(password, getCurrentOrCallingUserId());
    }

    /**
     * @hide
     * Save a device encryption password.  Does not do any checking on complexity.
     * @param password The password to save
     * @param userHandle The userId of the user to change the password for
     */
    public void saveEncryptionPassword(String password, int userHandle) {
        if (password != null) {
            if (userHandle == UserHandle.USER_OWNER) {
                // Update the encryption password.
                updateEncryptionPassword(password);
            }
        }
    }


    /**
     * Retrieves the quality mode we're in.
     * {@see DevicePolicyManager#getPasswordQuality(android.content.ComponentName)}