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

Commit 4a913ed7 authored by Eric Biggers's avatar Eric Biggers Committed by Android (Google) Code Review
Browse files

Merge "Remove LockPatternUtils#isAutoPinConfirmFeatureAvailable()" into main

parents 2fb41b6d b8d89b6d
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -729,16 +729,6 @@ public class LockPatternUtils {
        return getBoolean(AUTO_PIN_CONFIRM, /* defaultValue= */ false, userId);
    }

    /**
     * Whether the auto pin feature is available or not.
     * @return true. This method is always returning true due to feature flags not working
     * properly (b/282246482). Ideally, this should check if deviceConfig flag is set to true
     * and then return the appropriate value.
     */
    public static boolean isAutoPinConfirmFeatureAvailable() {
        return true;
    }

    /** Returns if the given quality maps to an alphabetic password */
    public static boolean isQualityAlphabeticPassword(int quality) {
        return quality >= PASSWORD_QUALITY_ALPHABETIC;
+1 −13
Original line number Diff line number Diff line
@@ -620,11 +620,6 @@ class SyntheticPasswordManager {
        return null;
    }

    @VisibleForTesting
    public boolean isAutoPinConfirmationFeatureAvailable() {
        return LockPatternUtils.isAutoPinConfirmFeatureAvailable();
    }

    /**
     * Returns a handle to the Weaver service, or null if Weaver is unavailable.  Note that not all
     * devices support Weaver.
@@ -1004,10 +999,7 @@ class SyntheticPasswordManager {
    public long createLskfBasedProtector(IGateKeeperService gatekeeper,
            LockscreenCredential credential, SyntheticPassword sp, int userId) {
        long protectorId = generateProtectorId();
        int pinLength = PIN_LENGTH_UNAVAILABLE;
        if (isAutoPinConfirmationFeatureAvailable()) {
            pinLength = derivePinLength(credential.size(), credential.isPin(), userId);
        }
        int pinLength = derivePinLength(credential.size(), credential.isPin(), userId);
        // There's no need to store password data about an empty LSKF.
        PasswordData pwd = credential.isNone() ? null :
                PasswordData.create(credential.getType(), pinLength);
@@ -1540,10 +1532,6 @@ class SyntheticPasswordManager {
     */
    public boolean refreshPinLengthOnDisk(PasswordMetrics passwordMetrics,
            long protectorId, int userId) {
        if (!isAutoPinConfirmationFeatureAvailable()) {
            return false;
        }

        byte[] pwdDataBytes = loadState(PASSWORD_DATA_NAME, protectorId, userId);
        if (pwdDataBytes == null) {
            return false;
+0 −5
Original line number Diff line number Diff line
@@ -112,11 +112,6 @@ public class MockSyntheticPasswordManager extends SyntheticPasswordManager {
        }
    }

    @Override
    public boolean isAutoPinConfirmationFeatureAvailable() {
        return true;
    }

    @Override
    protected IWeaver getWeaverHidlService() throws RemoteException {
        return mWeaverService;