summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2011-08-11 12:33:37 -0700
committerAndroid Code Review <code-review@android.com>2011-08-11 12:33:37 -0700
commit34d9b03f1c6c5bf7d8caa74dc07124a6e67f89d5 (patch)
tree45d7fdd3dece5f46c301b3d821daa09d81becb4a /src
parentfd73824d60ca92e297f354986cad525b947d05dd (diff)
parent22135ea7739433802fa55a37790c2a931b698f30 (diff)
downloadpackages_apps_settings-34d9b03f1c6c5bf7d8caa74dc07124a6e67f89d5.zip
packages_apps_settings-34d9b03f1c6c5bf7d8caa74dc07124a6e67f89d5.tar.gz
packages_apps_settings-34d9b03f1c6c5bf7d8caa74dc07124a6e67f89d5.tar.bz2
Merge "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);
}