Remove password blacklist check
Bug: 73750934 Test: compiles Change-Id: Ic6c40255333d171dc55df479dd6c0004371551b7
This commit is contained in:
@@ -241,7 +241,6 @@ public class ChooseLockPassword extends SettingsActivity {
|
|||||||
static final int NOT_ENOUGH_DIGITS = 1 << 9;
|
static final int NOT_ENOUGH_DIGITS = 1 << 9;
|
||||||
static final int NOT_ENOUGH_SYMBOLS = 1 << 10;
|
static final int NOT_ENOUGH_SYMBOLS = 1 << 10;
|
||||||
static final int NOT_ENOUGH_NON_LETTER = 1 << 11;
|
static final int NOT_ENOUGH_NON_LETTER = 1 << 11;
|
||||||
static final int BLACKLISTED = 1 << 12;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keep track internally of where the user is in choosing a pattern.
|
* Keep track internally of where the user is in choosing a pattern.
|
||||||
@@ -728,16 +727,6 @@ public class ChooseLockPassword extends SettingsActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only check the blacklist if the password is otherwise valid. Checking the blacklist
|
|
||||||
// can be expensive and it is not useful to report the fact it is on a blacklist if it
|
|
||||||
// couldn't be set anyway.
|
|
||||||
if (errorCode == NO_ERROR) {
|
|
||||||
if (mLockPatternUtils.getDevicePolicyManager()
|
|
||||||
.isPasswordBlacklisted(mUserId, password)) {
|
|
||||||
errorCode |= BLACKLISTED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return errorCode;
|
return errorCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -856,11 +845,6 @@ public class ChooseLockPassword extends SettingsActivity {
|
|||||||
messages.add(getString((mIsAlphaMode) ? R.string.lockpassword_password_recently_used
|
messages.add(getString((mIsAlphaMode) ? R.string.lockpassword_password_recently_used
|
||||||
: R.string.lockpassword_pin_recently_used));
|
: R.string.lockpassword_pin_recently_used));
|
||||||
}
|
}
|
||||||
if ((errorCode & BLACKLISTED) > 0) {
|
|
||||||
messages.add(getString((mIsAlphaMode)
|
|
||||||
? R.string.lockpassword_password_blacklisted_by_admin
|
|
||||||
: R.string.lockpassword_pin_blacklisted_by_admin));
|
|
||||||
}
|
|
||||||
return messages.toArray(new String[0]);
|
return messages.toArray(new String[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -120,36 +120,6 @@ public class ChooseLockPasswordTest {
|
|||||||
.isEqualTo(123);
|
.isEqualTo(123);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void blacklist_addsErrorMessageForPin() {
|
|
||||||
final ChooseLockPassword activity = buildChooseLockPasswordActivity(
|
|
||||||
new IntentBuilder(application)
|
|
||||||
.setUserId(UserHandle.myUserId())
|
|
||||||
// Set to numeric for a PIN
|
|
||||||
.setPasswordQuality(DevicePolicyManager.PASSWORD_QUALITY_NUMERIC)
|
|
||||||
.build());
|
|
||||||
final ChooseLockPasswordFragment fragment = getChooseLockPasswordFragment(activity);
|
|
||||||
final int errors = ChooseLockPasswordFragment.BLACKLISTED;
|
|
||||||
final String[] messages = fragment.convertErrorCodeToMessages(errors);
|
|
||||||
assertThat(messages).isEqualTo(new String[] {
|
|
||||||
activity.getString(R.string.lockpassword_pin_blacklisted_by_admin) });
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void blacklist_addsErrorMessageForPassword() {
|
|
||||||
final ChooseLockPassword activity = buildChooseLockPasswordActivity(
|
|
||||||
new IntentBuilder(application)
|
|
||||||
.setUserId(UserHandle.myUserId())
|
|
||||||
// Set to alphabetic for a password
|
|
||||||
.setPasswordQuality(DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC)
|
|
||||||
.build());
|
|
||||||
final ChooseLockPasswordFragment fragment = getChooseLockPasswordFragment(activity);
|
|
||||||
final int errors = ChooseLockPasswordFragment.BLACKLISTED;
|
|
||||||
final String[] messages = fragment.convertErrorCodeToMessages(errors);
|
|
||||||
assertThat(messages).isEqualTo(new String[] {
|
|
||||||
activity.getString(R.string.lockpassword_password_blacklisted_by_admin) });
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void assertThat_chooseLockIconChanged_WhenFingerprintExtraSet() {
|
public void assertThat_chooseLockIconChanged_WhenFingerprintExtraSet() {
|
||||||
ShadowDrawable drawable = setActivityAndGetIconDrawable(true);
|
ShadowDrawable drawable = setActivityAndGetIconDrawable(true);
|
||||||
|
Reference in New Issue
Block a user