Stop crash on repeated enters on virtual keyboard
Change https://googleplex-android-review.git.corp.google.com/#/c/742462/ removed the mDone since graying out the button seemed to remove the need for this. However, you can also enter this command repeatedly from the soft keyboard. Put mDone back. Bug: 23181625 Change-Id: I42e8ecb9824b17825778c9c113130506cc3a200b
This commit is contained in:
@@ -146,6 +146,10 @@ public class ChooseLockPassword extends SettingsActivity {
|
|||||||
private int mRequestedQuality = DevicePolicyManager.PASSWORD_QUALITY_NUMERIC;
|
private int mRequestedQuality = DevicePolicyManager.PASSWORD_QUALITY_NUMERIC;
|
||||||
private ChooseLockSettingsHelper mChooseLockSettingsHelper;
|
private ChooseLockSettingsHelper mChooseLockSettingsHelper;
|
||||||
private Stage mUiStage = Stage.Introduction;
|
private Stage mUiStage = Stage.Introduction;
|
||||||
|
|
||||||
|
// True once we have confirmed new PIN/password to prevent virtual keyboard
|
||||||
|
// re-entries of the same PIN
|
||||||
|
private boolean mDone = false;
|
||||||
private TextView mHeaderText;
|
private TextView mHeaderText;
|
||||||
private String mFirstPin;
|
private String mFirstPin;
|
||||||
private KeyboardView mKeyboardView;
|
private KeyboardView mKeyboardView;
|
||||||
@@ -302,6 +306,7 @@ public class ChooseLockPassword extends SettingsActivity {
|
|||||||
mCurrentPassword = savedInstanceState.getString(KEY_CURRENT_PASSWORD);
|
mCurrentPassword = savedInstanceState.getString(KEY_CURRENT_PASSWORD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mDone = false;
|
||||||
if (activity instanceof SettingsActivity) {
|
if (activity instanceof SettingsActivity) {
|
||||||
final SettingsActivity sa = (SettingsActivity) activity;
|
final SettingsActivity sa = (SettingsActivity) activity;
|
||||||
int id = mIsAlphaMode ? R.string.lockpassword_choose_your_password_header
|
int id = mIsAlphaMode ? R.string.lockpassword_choose_your_password_header
|
||||||
@@ -509,6 +514,7 @@ public class ChooseLockPassword extends SettingsActivity {
|
|||||||
|
|
||||||
|
|
||||||
public void handleNext() {
|
public void handleNext() {
|
||||||
|
if (mDone) return;
|
||||||
mChosenPassword = mPasswordEntry.getText().toString();
|
mChosenPassword = mPasswordEntry.getText().toString();
|
||||||
if (TextUtils.isEmpty(mChosenPassword)) {
|
if (TextUtils.isEmpty(mChosenPassword)) {
|
||||||
return;
|
return;
|
||||||
@@ -524,6 +530,7 @@ public class ChooseLockPassword extends SettingsActivity {
|
|||||||
} else if (mUiStage == Stage.NeedToConfirm) {
|
} else if (mUiStage == Stage.NeedToConfirm) {
|
||||||
if (mFirstPin.equals(mChosenPassword)) {
|
if (mFirstPin.equals(mChosenPassword)) {
|
||||||
setNextEnabled(false);
|
setNextEnabled(false);
|
||||||
|
mDone = true;
|
||||||
new SaveChosenPasswordAndFinish().execute();
|
new SaveChosenPasswordAndFinish().execute();
|
||||||
} else {
|
} else {
|
||||||
CharSequence tmp = mPasswordEntry.getText();
|
CharSequence tmp = mPasswordEntry.getText();
|
||||||
|
Reference in New Issue
Block a user