Fix lockpattern weirdness
- Pass back correct result when pressing cancel. - Make sure the start the interstitial activity after checking so we don't preempt the async thread we are still running. Bug: 21621918 Change-Id: I5558089abf02a00a268050fc48894cea86692fa0
This commit is contained in:
@@ -463,8 +463,6 @@ public class ChooseLockPattern extends SettingsActivity {
|
|||||||
mLockPatternView.clearPattern();
|
mLockPatternView.clearPattern();
|
||||||
updateStage(Stage.Introduction);
|
updateStage(Stage.Introduction);
|
||||||
} else if (mUiStage.leftMode == LeftButtonMode.Cancel) {
|
} else if (mUiStage.leftMode == LeftButtonMode.Cancel) {
|
||||||
// They are canceling the entire wizard
|
|
||||||
getActivity().setResult(RESULT_FINISHED);
|
|
||||||
getActivity().finish();
|
getActivity().finish();
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException("left footer button pressed, but stage of " +
|
throw new IllegalStateException("left footer button pressed, but stage of " +
|
||||||
@@ -639,21 +637,18 @@ public class ChooseLockPattern extends SettingsActivity {
|
|||||||
utils.setVisiblePatternEnabled(true, UserHandle.myUserId());
|
utils.setVisiblePatternEnabled(true, UserHandle.myUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wasSecureBefore) {
|
|
||||||
startActivity(getRedactionInterstitialIntent(getActivity()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mHasChallenge) {
|
if (mHasChallenge) {
|
||||||
startVerifyPattern(utils);
|
startVerifyPattern(utils, wasSecureBefore);
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
|
if (!wasSecureBefore) {
|
||||||
|
startActivity(getRedactionInterstitialIntent(getActivity()));
|
||||||
|
}
|
||||||
getActivity().setResult(RESULT_FINISHED);
|
getActivity().setResult(RESULT_FINISHED);
|
||||||
|
doFinish();
|
||||||
}
|
}
|
||||||
|
|
||||||
doFinish();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startVerifyPattern(LockPatternUtils utils) {
|
private void startVerifyPattern(LockPatternUtils utils, final boolean wasSecureBefore) {
|
||||||
mLockPatternView.disableInput();
|
mLockPatternView.disableInput();
|
||||||
if (mPendingLockCheck != null) {
|
if (mPendingLockCheck != null) {
|
||||||
mPendingLockCheck.cancel(false);
|
mPendingLockCheck.cancel(false);
|
||||||
@@ -674,6 +669,10 @@ public class ChooseLockPattern extends SettingsActivity {
|
|||||||
mLockPatternView.enableInput();
|
mLockPatternView.enableInput();
|
||||||
mPendingLockCheck = null;
|
mPendingLockCheck = null;
|
||||||
|
|
||||||
|
if (!wasSecureBefore) {
|
||||||
|
startActivity(getRedactionInterstitialIntent(getActivity()));
|
||||||
|
}
|
||||||
|
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.putExtra(
|
intent.putExtra(
|
||||||
ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, token);
|
ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, token);
|
||||||
|
Reference in New Issue
Block a user