Home | History | Annotate | Download | only in settings

Lines Matching full:quality

211             int quality = intent.getIntExtra(LockPatternUtils.PASSWORD_TYPE_KEY, -1);
212 if (quality == -1) {
213 // If caller didn't specify password quality, show UI and allow the user to choose.
214 quality = intent.getIntExtra(MINIMUM_QUALITY_KEY, -1);
216 quality = upgradeQuality(quality, allowBiometric);
222 disableUnusablePreferences(quality, allowBiometric);
224 updateUnlockMethodAndFinish(quality, false);
228 /** increases the quality if necessary, and returns whether biometric is allowed */
229 private int upgradeQuality(int quality, MutableBoolean allowBiometric) {
230 quality = upgradeQualityForDPM(quality);
231 quality = upgradeQualityForKeyStore(quality);
232 int encryptionQuality = upgradeQualityForEncryption(quality);
233 if (encryptionQuality > quality) {
237 allowBiometric.value = quality <=
239 } else if (quality == DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK) {
242 return quality;
248 private int upgradeQualityForDPM(int quality) {
249 // Compare min allowed password quality
251 if (quality < minQuality) {
252 quality = minQuality;
254 return quality;
258 * Mix in "encryption minimums" to any given quality value. This prevents users
261 * ASSUMPTION: Setting quality is sufficient (e.g. minimum lengths will be set
264 private int upgradeQualityForEncryption(int quality) {
265 // Don't upgrade quality for secondary users. Encryption requirements don't apply.
266 if (!Process.myUserHandle().equals(UserHandle.OWNER)) return quality;
271 if (quality < CryptKeeperSettings.MIN_PASSWORD_QUALITY) {
272 quality = CryptKeeperSettings.MIN_PASSWORD_QUALITY;
275 return quality;
278 private int upgradeQualityForKeyStore(int quality) {
280 if (quality < CredentialStorage.MIN_PASSWORD_QUALITY) {
281 quality = CredentialStorage.MIN_PASSWORD_QUALITY;
284 return quality;
288 * Disables preferences that are less secure than required quality.
290 * @param quality the requested quality.
292 private void disableUnusablePreferences(final int quality, MutableBoolean allowBiometric) {
311 enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
314 enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
316 enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK ||
320 enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_SOMETHING;
322 enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_NUMERIC;
324 enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_COMPLEX;
367 * Invokes an activity to change the user's pattern, password or PIN based on given quality
368 * and minimum quality specified by DevicePolicyManager. If quality is
371 * @param quality the desired quality. Ignored if DevicePolicyManager requires more security
372 * @param disabled whether or not to show LockScreen at all. Only meaningful when quality is
375 void updateUnlockMethodAndFinish(int quality, boolean disabled) {
384 quality = upgradeQuality(quality, null);
386 if (quality >= DevicePolicyManager.PASSWORD_QUALITY_NUMERIC) {
391 final int maxLength = mDPM.getPasswordMaximumLength(quality);
393 intent.putExtra(LockPatternUtils.PASSWORD_TYPE_KEY, quality);
407 } else if (quality == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING) {
421 } else if (quality == DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK) {
425 } else if (quality == DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) {