summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/ChooseLockGeneric.java2
-rw-r--r--src/com/android/settings/ChooseLockPassword.java17
-rw-r--r--src/com/android/settings/ChooseLockSettingsHelper.java1
-rw-r--r--src/com/android/settings/SecuritySettings.java1
4 files changed, 16 insertions, 5 deletions
diff --git a/src/com/android/settings/ChooseLockGeneric.java b/src/com/android/settings/ChooseLockGeneric.java
index 30a72ef99..c444dc47e 100644
--- a/src/com/android/settings/ChooseLockGeneric.java
+++ b/src/com/android/settings/ChooseLockGeneric.java
@@ -278,7 +278,7 @@ public class ChooseLockGeneric extends SettingsActivity {
} else if (KEY_UNLOCK_SET_PATTERN.equals(key)) {
enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_SOMETHING;
} else if (KEY_UNLOCK_SET_PIN.equals(key)) {
- enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_NUMERIC;
+ enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX;
} else if (KEY_UNLOCK_SET_PASSWORD.equals(key)) {
enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_COMPLEX;
}
diff --git a/src/com/android/settings/ChooseLockPassword.java b/src/com/android/settings/ChooseLockPassword.java
index 90cd25138..6dfb0f7db 100644
--- a/src/com/android/settings/ChooseLockPassword.java
+++ b/src/com/android/settings/ChooseLockPassword.java
@@ -329,10 +329,18 @@ public class ChooseLockPassword extends SettingsActivity {
}
}
if (DevicePolicyManager.PASSWORD_QUALITY_NUMERIC == mRequestedQuality
- && (letters > 0 || symbols > 0)) {
- // This shouldn't be possible unless user finds some way to bring up
- // soft keyboard
- return getString(R.string.lockpassword_pin_contains_non_digits);
+ || DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX == mRequestedQuality) {
+ if (letters > 0 || symbols > 0) {
+ // This shouldn't be possible unless user finds some way to bring up
+ // soft keyboard
+ return getString(R.string.lockpassword_pin_contains_non_digits);
+ }
+ // Check for repeated characters or sequences (e.g. '1234', '0000', '2468')
+ final int sequence = LockPatternUtils.maxLengthSequence(password);
+ if (DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX == mRequestedQuality
+ && sequence > LockPatternUtils.MAX_ALLOWED_SEQUENCE) {
+ return getString(R.string.lockpassword_pin_no_sequential_digits);
+ }
} else if (DevicePolicyManager.PASSWORD_QUALITY_COMPLEX == mRequestedQuality) {
if (letters < mPasswordMinLetters) {
return String.format(getResources().getQuantityString(
@@ -375,6 +383,7 @@ public class ChooseLockPassword extends SettingsActivity {
return getString(mIsAlphaMode ? R.string.lockpassword_password_recently_used
: R.string.lockpassword_pin_recently_used);
}
+
return null;
}
diff --git a/src/com/android/settings/ChooseLockSettingsHelper.java b/src/com/android/settings/ChooseLockSettingsHelper.java
index 15d1203ca..d59fefbe2 100644
--- a/src/com/android/settings/ChooseLockSettingsHelper.java
+++ b/src/com/android/settings/ChooseLockSettingsHelper.java
@@ -60,6 +60,7 @@ public final class ChooseLockSettingsHelper {
launched = confirmPattern(request, message, details);
break;
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC:
+ case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX:
case DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC:
case DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC:
case DevicePolicyManager.PASSWORD_QUALITY_COMPLEX:
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index 0af022ac6..6961b2a2e 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -151,6 +151,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
resid = R.xml.security_settings_pattern;
break;
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC:
+ case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX:
resid = R.xml.security_settings_pin;
break;
case DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC: