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

Commit 1347d906 authored by Eric Biggers's avatar Eric Biggers
Browse files

Remove unused support for "pattern ever chosen"

isPatternEverChosen() is no longer used by anyone, so remove it along
with the code that stored the value in the locksettings database.

Bug: 270013005
Change-Id: I096da21b67dce878caff65d9a310fc16138c0b59
parent b7d034a6
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -172,7 +172,6 @@ public class LockPatternUtils {
     */
    public static final int USER_FRP = UserHandle.USER_NULL + 1;

    public final static String PATTERN_EVER_CHOSEN_KEY = "lockscreen.patterneverchosen";
    public final static String PASSWORD_TYPE_KEY = "lockscreen.password_type";
    @Deprecated
    public final static String PASSWORD_TYPE_ALTERNATE_KEY = "lockscreen.password_type_alternate";
@@ -597,16 +596,6 @@ public class LockPatternUtils {
        return false;
    }

    /**
     * Return true if the user has ever chosen a pattern.  This is true even if the pattern is
     * currently cleared.
     *
     * @return True if the user has ever chosen a pattern.
     */
    public boolean isPatternEverChosen(int userId) {
        return getBoolean(PATTERN_EVER_CHOSEN_KEY, false, userId);
    }

    /**
     * Returns the length of the PIN set by a particular user.
     * @param userId user id of the user whose pin length we have to return
@@ -640,13 +629,6 @@ public class LockPatternUtils {
            return false;
        }
    }
    /**
     * Records that the user has chosen a pattern at some time, even if the pattern is
     * currently cleared.
     */
    public void reportPatternWasChosen(int userId) {
        setBoolean(PATTERN_EVER_CHOSEN_KEY, true, userId);
    }

    /**
     * Used by device policy manager to validate the current password
+0 −1
Original line number Diff line number Diff line
@@ -971,7 +971,6 @@ public class SettingsBackupAgent extends BackupAgentHelper {
                        lockPatternUtils.setOwnerInfo(value, userId);
                        break;
                    case KEY_LOCK_SETTINGS_VISIBLE_PATTERN_ENABLED:
                        lockPatternUtils.reportPatternWasChosen(userId);
                        lockPatternUtils.setVisiblePatternEnabled("1".equals(value), userId);
                        break;
                    case KEY_LOCK_SETTINGS_POWER_BUTTON_INSTANTLY_LOCKS:
+0 −4
Original line number Diff line number Diff line
@@ -1731,10 +1731,6 @@ public class LockSettingsService extends ILockSettings.Stub {
    }

    private void onPostPasswordChanged(LockscreenCredential newCredential, int userHandle) {
        if (newCredential.isPattern()) {
            setBoolean(LockPatternUtils.PATTERN_EVER_CHOSEN_KEY, true, userHandle);
        }

        updatePasswordHistory(newCredential, userHandle);
        mContext.getSystemService(TrustManager.class).reportEnabledTrustAgentsChanged(userHandle);
    }