summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2011-08-12 16:26:54 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-08-12 16:26:54 -0700
commit60afe163b982b3f3a580927e4fc1030c4ace542c (patch)
treedf12b89580cbf77b3034e40b8cdf242048763ca5 /src
parent40e3d1f7b00dd9a21484f3c2f34a5cab92ec0ed1 (diff)
parent7e1c6cc0fe3c3520d9d026c0dabbfb6e38113df9 (diff)
downloadpackages_apps_settings-60afe163b982b3f3a580927e4fc1030c4ace542c.zip
packages_apps_settings-60afe163b982b3f3a580927e4fc1030c4ace542c.tar.gz
packages_apps_settings-60afe163b982b3f3a580927e4fc1030c4ace542c.tar.bz2
am 7e1c6cc0: am d7d6c7ff: am 34d9b03f: Merge "Fix wrong behavior when changing pin code in settings"
* commit '7e1c6cc0fe3c3520d9d026c0dabbfb6e38113df9': Fix wrong behavior when changing pin code in settings
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/IccLockSettings.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/com/android/settings/IccLockSettings.java b/src/com/android/settings/IccLockSettings.java
index 6494567..0df69a0 100644
--- a/src/com/android/settings/IccLockSettings.java
+++ b/src/com/android/settings/IccLockSettings.java
@@ -61,6 +61,11 @@ public class IccLockSettings extends PreferenceActivity
private static final String DIALOG_PIN = "dialogPin";
private static final String DIALOG_ERROR = "dialogError";
private static final String ENABLE_TO_STATE = "enableState";
+
+ // Save and restore inputted PIN code when configuration changed
+ // (ex. portrait<-->landscape) during change PIN code
+ private static final String OLD_PINCODE = "oldPinCode";
+ private static final String NEW_PINCODE = "newPinCode";
private static final int MIN_PIN_LENGTH = 4;
private static final int MAX_PIN_LENGTH = 8;
@@ -133,6 +138,23 @@ public class IccLockSettings extends PreferenceActivity
mPin = savedInstanceState.getString(DIALOG_PIN);
mError = savedInstanceState.getString(DIALOG_ERROR);
mToState = savedInstanceState.getBoolean(ENABLE_TO_STATE);
+
+ // Restore inputted PIN code
+ switch (mDialogState) {
+ case ICC_NEW_MODE:
+ mOldPin = savedInstanceState.getString(OLD_PINCODE);
+ break;
+
+ case ICC_REENTER_MODE:
+ mOldPin = savedInstanceState.getString(OLD_PINCODE);
+ mNewPin = savedInstanceState.getString(NEW_PINCODE);
+ break;
+
+ case ICC_LOCK_MODE:
+ case ICC_OLD_MODE:
+ default:
+ break;
+ }
}
mPinDialog.setOnPinEnteredListener(this);
@@ -170,6 +192,23 @@ public class IccLockSettings extends PreferenceActivity
out.putString(DIALOG_PIN, mPinDialog.getEditText().getText().toString());
out.putString(DIALOG_ERROR, mError);
out.putBoolean(ENABLE_TO_STATE, mToState);
+
+ // Save inputted PIN code
+ switch (mDialogState) {
+ case ICC_NEW_MODE:
+ out.putString(OLD_PINCODE, mOldPin);
+ break;
+
+ case ICC_REENTER_MODE:
+ out.putString(OLD_PINCODE, mOldPin);
+ out.putString(NEW_PINCODE, mNewPin);
+ break;
+
+ case ICC_LOCK_MODE:
+ case ICC_OLD_MODE:
+ default:
+ break;
+ }
} else {
super.onSaveInstanceState(out);
}