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

Commit 330c2052 authored by Robin Lee's avatar Robin Lee
Browse files

Credential storage: check lock quality for right user

Checking the wrong user can lead to an infinite loop when trying to
install credentials from a managed profile.

Bug: 28043334
Change-Id: I3e1044069f0d5139a47de461996a6d98e0fe5e2f
parent 2de9313d
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -208,9 +208,9 @@ public final class CredentialStorage extends Activity {
     * Returns true if the currently set key guard matches our minimum quality requirements.
     * Returns true if the currently set key guard matches our minimum quality requirements.
     */
     */
    private boolean checkKeyGuardQuality() {
    private boolean checkKeyGuardQuality() {
        UserInfo parent = UserManager.get(this).getProfileParent(UserHandle.myUserId());
        int credentialOwner =
        int quality = new LockPatternUtils(this).getActivePasswordQuality(
                UserManager.get(this).getCredentialOwnerProfile(UserHandle.myUserId());
                parent != null ? parent.id : UserHandle.myUserId());
        int quality = new LockPatternUtils(this).getActivePasswordQuality(credentialOwner);
        return (quality >= MIN_PASSWORD_QUALITY);
        return (quality >= MIN_PASSWORD_QUALITY);
    }
    }