Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Fix 2504863: Use password min/max constants in ChooseLockPassword
Browse files Browse the repository at this point in the history
This fixes a bug where the system was defaulting to 8 digits max password length.

The UI is best for N <=12, but works for more.  I set the default limit to 16 which is
more than most humans can remember. That also seems to be the practical limit for the small
sample of DevicePolicyManagers I checked.

DevicePolicyManagers can always specify more digits if they really want.

Change-Id: I8637e0c9366800886759424b5a28f48dca15c535
  • Loading branch information
Jim Miller committed Mar 10, 2010
1 parent 41297ef commit 70d5c3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/com/android/settings/ChooseLockPassword.java
Expand Up @@ -54,7 +54,7 @@ public class ChooseLockPassword extends Activity implements OnClickListener, OnE
private static final String KEY_UI_STAGE = "ui_stage";
private TextView mPasswordEntry;
private int mPasswordMinLength = 4;
private int mPasswordMaxLength = 8;
private int mPasswordMaxLength = 16;
private LockPatternUtils mLockPatternUtils;
private int mRequestedMode = LockPatternUtils.MODE_PIN;
private ChooseLockSettingsHelper mChooseLockSettingsHelper;
Expand Down Expand Up @@ -109,8 +109,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mLockPatternUtils = new LockPatternUtils(this);
mRequestedMode = getIntent().getIntExtra(LockPatternUtils.PASSWORD_TYPE_KEY, mRequestedMode);
mPasswordMinLength = getIntent().getIntExtra("password_min_length", mPasswordMinLength);
mPasswordMaxLength = getIntent().getIntExtra("password_max_length", mPasswordMaxLength);
mPasswordMinLength = getIntent().getIntExtra(PASSWORD_MIN_KEY, mPasswordMinLength);
mPasswordMaxLength = getIntent().getIntExtra(PASSWORD_MAX_KEY, mPasswordMaxLength);
int minMode = mLockPatternUtils.getRequestedPasswordMode();
if (mRequestedMode < minMode) {
mRequestedMode = minMode;
Expand Down

0 comments on commit 70d5c3a

Please sign in to comment.