Merge "Don't launch Choose Lock again if recreating" into oc-mr1-dev am: 0ece5f2a06
am: 2dad90da4b
Change-Id: Iadffbc4f2e84c9c36ed7d0470831aac6bb0656f4
This commit is contained in:
@@ -219,7 +219,7 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
mManagedPasswordProvider = ManagedLockPasswordProvider.get(getActivity(), mUserId);
|
mManagedPasswordProvider = ManagedLockPasswordProvider.get(getActivity(), mUserId);
|
||||||
|
|
||||||
if (mPasswordConfirmed) {
|
if (mPasswordConfirmed) {
|
||||||
updatePreferencesOrFinish();
|
updatePreferencesOrFinish(savedInstanceState != null);
|
||||||
if (mForChangeCredRequiredForBoot) {
|
if (mForChangeCredRequiredForBoot) {
|
||||||
maybeEnableEncryption(mLockPatternUtils.getKeyguardStoredPasswordQuality(
|
maybeEnableEncryption(mLockPatternUtils.getKeyguardStoredPasswordQuality(
|
||||||
mUserId), false);
|
mUserId), false);
|
||||||
@@ -234,7 +234,7 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
|| !helper.launchConfirmationActivity(CONFIRM_EXISTING_REQUEST,
|
|| !helper.launchConfirmationActivity(CONFIRM_EXISTING_REQUEST,
|
||||||
getString(R.string.unlock_set_unlock_launch_picker_title), true, mUserId)) {
|
getString(R.string.unlock_set_unlock_launch_picker_title), true, mUserId)) {
|
||||||
mPasswordConfirmed = true; // no password set, so no need to confirm
|
mPasswordConfirmed = true; // no password set, so no need to confirm
|
||||||
updatePreferencesOrFinish();
|
updatePreferencesOrFinish(savedInstanceState != null);
|
||||||
} else {
|
} else {
|
||||||
mWaitingForConfirmation = true;
|
mWaitingForConfirmation = true;
|
||||||
}
|
}
|
||||||
@@ -332,7 +332,7 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
if (requestCode == CONFIRM_EXISTING_REQUEST && resultCode == Activity.RESULT_OK) {
|
if (requestCode == CONFIRM_EXISTING_REQUEST && resultCode == Activity.RESULT_OK) {
|
||||||
mPasswordConfirmed = true;
|
mPasswordConfirmed = true;
|
||||||
mUserPassword = data.getStringExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD);
|
mUserPassword = data.getStringExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD);
|
||||||
updatePreferencesOrFinish();
|
updatePreferencesOrFinish(false /* isRecreatingActivity */);
|
||||||
if (mForChangeCredRequiredForBoot) {
|
if (mForChangeCredRequiredForBoot) {
|
||||||
if (!TextUtils.isEmpty(mUserPassword)) {
|
if (!TextUtils.isEmpty(mUserPassword)) {
|
||||||
maybeEnableEncryption(
|
maybeEnableEncryption(
|
||||||
@@ -395,7 +395,7 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
outState.putBoolean(ENCRYPT_REQUESTED_DISABLED, mEncryptionRequestDisabled);
|
outState.putBoolean(ENCRYPT_REQUESTED_DISABLED, mEncryptionRequestDisabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePreferencesOrFinish() {
|
private void updatePreferencesOrFinish(boolean isRecreatingActivity) {
|
||||||
Intent intent = getActivity().getIntent();
|
Intent intent = getActivity().getIntent();
|
||||||
int quality = intent.getIntExtra(LockPatternUtils.PASSWORD_TYPE_KEY, -1);
|
int quality = intent.getIntExtra(LockPatternUtils.PASSWORD_TYPE_KEY, -1);
|
||||||
if (quality == -1) {
|
if (quality == -1) {
|
||||||
@@ -413,7 +413,8 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
updatePreferenceText();
|
updatePreferenceText();
|
||||||
updateCurrentPreference();
|
updateCurrentPreference();
|
||||||
updatePreferenceSummaryIfNeeded();
|
updatePreferenceSummaryIfNeeded();
|
||||||
} else {
|
} else if (!isRecreatingActivity) {
|
||||||
|
// Don't start the activity again if we are recreated for configuration change
|
||||||
updateUnlockMethodAndFinish(quality, false, true /* chooseLockSkipped */);
|
updateUnlockMethodAndFinish(quality, false, true /* chooseLockSkipped */);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user