Fix a NPE in confirm lock screen.

The NPE happens is when using pin later. It's too late to recover if we
just catch the NPE where it happens, so we should early terminate the
call by adding TextUtil.isEmpty(pin) check.

Change-Id: Id280cd1b8781678540c9ea281b3186edd04d61f9
Fixes: 31895774
Test: make RunSettingsRoboTests
Test: manually enter correct/wrong/empty password/pin in confirm lock UI
(cherry picked from commit 774e1d8443)
This commit is contained in:
Fan Zhang
2016-10-03 09:05:55 -07:00
parent 6cab381bc2
commit 8b2baed2be

View File

@@ -320,11 +320,15 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
return;
}
mPasswordEntryInputDisabler.setInputEnabled(false);
final String pin = mPasswordEntry.getText().toString();
if (TextUtils.isEmpty(pin)) {
return;
}
mPasswordEntryInputDisabler.setInputEnabled(false);
final boolean verifyChallenge = getActivity().getIntent().getBooleanExtra(
ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, false);
Intent intent = new Intent();
if (verifyChallenge) {
if (isInternalActivity()) {