Loading core/java/com/android/internal/widget/LockPatternUtils.java +41 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.os.SystemClock; import android.os.UserHandle; import android.os.UserManager; import android.os.storage.StorageManager; import android.provider.DeviceConfig; import android.provider.Settings; import android.text.TextUtils; import android.util.Log; Loading Loading @@ -165,9 +166,17 @@ public class LockPatternUtils { private static final String KNOWN_TRUST_AGENTS = "lockscreen.knowntrustagents"; private static final String IS_TRUST_USUALLY_MANAGED = "lockscreen.istrustusuallymanaged"; private static final String AUTO_PIN_CONFIRM = "lockscreen.auto_pin_confirm"; public static final String CURRENT_LSKF_BASED_PROTECTOR_ID_KEY = "sp-handle"; public static final String PASSWORD_HISTORY_DELIMITER = ","; /** * drives the pin auto confirmation feature availability in code logic. */ public static final String FLAG_ENABLE_AUTO_PIN_CONFIRMATION = "AutoPinConfirmation__enable_auto_pin_confirmation"; @UnsupportedAppUsage private final Context mContext; @UnsupportedAppUsage Loading Loading @@ -647,6 +656,38 @@ public class LockPatternUtils { || isDemoUser; } /** * Sets the pin auto confirm capability to enabled or disabled * @param enabled enables pin auto confirm capability when true * @param userId user ID of the user this has effect on */ public void setAutoPinConfirm(boolean enabled, int userId) { setBoolean(AUTO_PIN_CONFIRM, enabled, userId); } /** * Determines if the auto pin confirmation feature is enabled or not for current user * If setting is not available, the default behaviour is disabled * @param userId user ID of the user this has effect on * * @return true, if the entered pin should be auto confirmed */ public boolean isAutoPinConfirmEnabled(int userId) { return getBoolean(AUTO_PIN_CONFIRM, /* defaultValue= */ false, userId); } /** * Whether the auto pin feature logic is available or not. * @return true, if deviceConfig flag is set to true or the flag is not propagated and * defaultValue is true. */ public boolean isAutoPinConfirmFeatureAvailable() { return DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_AUTO_PIN_CONFIRMATION, FLAG_ENABLE_AUTO_PIN_CONFIRMATION, /* defaultValue= */ false); } /** Returns if the given quality maps to an alphabetic password */ public static boolean isQualityAlphabeticPassword(int quality) { return quality >= PASSWORD_QUALITY_ALPHABETIC; Loading Loading
core/java/com/android/internal/widget/LockPatternUtils.java +41 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.os.SystemClock; import android.os.UserHandle; import android.os.UserManager; import android.os.storage.StorageManager; import android.provider.DeviceConfig; import android.provider.Settings; import android.text.TextUtils; import android.util.Log; Loading Loading @@ -165,9 +166,17 @@ public class LockPatternUtils { private static final String KNOWN_TRUST_AGENTS = "lockscreen.knowntrustagents"; private static final String IS_TRUST_USUALLY_MANAGED = "lockscreen.istrustusuallymanaged"; private static final String AUTO_PIN_CONFIRM = "lockscreen.auto_pin_confirm"; public static final String CURRENT_LSKF_BASED_PROTECTOR_ID_KEY = "sp-handle"; public static final String PASSWORD_HISTORY_DELIMITER = ","; /** * drives the pin auto confirmation feature availability in code logic. */ public static final String FLAG_ENABLE_AUTO_PIN_CONFIRMATION = "AutoPinConfirmation__enable_auto_pin_confirmation"; @UnsupportedAppUsage private final Context mContext; @UnsupportedAppUsage Loading Loading @@ -647,6 +656,38 @@ public class LockPatternUtils { || isDemoUser; } /** * Sets the pin auto confirm capability to enabled or disabled * @param enabled enables pin auto confirm capability when true * @param userId user ID of the user this has effect on */ public void setAutoPinConfirm(boolean enabled, int userId) { setBoolean(AUTO_PIN_CONFIRM, enabled, userId); } /** * Determines if the auto pin confirmation feature is enabled or not for current user * If setting is not available, the default behaviour is disabled * @param userId user ID of the user this has effect on * * @return true, if the entered pin should be auto confirmed */ public boolean isAutoPinConfirmEnabled(int userId) { return getBoolean(AUTO_PIN_CONFIRM, /* defaultValue= */ false, userId); } /** * Whether the auto pin feature logic is available or not. * @return true, if deviceConfig flag is set to true or the flag is not propagated and * defaultValue is true. */ public boolean isAutoPinConfirmFeatureAvailable() { return DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_AUTO_PIN_CONFIRMATION, FLAG_ENABLE_AUTO_PIN_CONFIRMATION, /* defaultValue= */ false); } /** Returns if the given quality maps to an alphabetic password */ public static boolean isQualityAlphabeticPassword(int quality) { return quality >= PASSWORD_QUALITY_ALPHABETIC; Loading