diff options
| author | Jim Miller <jaggies@google.com> | 2010-04-14 14:47:48 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-04-14 14:47:48 -0700 |
| commit | c02a09aa565318f37d9481d05d50610fe722e4b4 (patch) | |
| tree | 549a8a696e159b861e5e365f264b6de83ced5511 /src/com/android/settings/MasterClear.java | |
| parent | 6023d0b93d18c868450c3390a43984acdfbad1eb (diff) | |
| parent | 2deec7edc937b1d19df0a74c4cd0c5ee3ef33070 (diff) | |
| download | packages_apps_Settings-c02a09aa565318f37d9481d05d50610fe722e4b4.zip packages_apps_Settings-c02a09aa565318f37d9481d05d50610fe722e4b4.tar.gz packages_apps_Settings-c02a09aa565318f37d9481d05d50610fe722e4b4.tar.bz2 | |
Merge "Fix 2594148: confirm PIN/Password before resetting device" into froyo
Diffstat (limited to 'src/com/android/settings/MasterClear.java')
| -rw-r--r-- | src/com/android/settings/MasterClear.java | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/com/android/settings/MasterClear.java b/src/com/android/settings/MasterClear.java index 7e408d1..4de0e44 100644 --- a/src/com/android/settings/MasterClear.java +++ b/src/com/android/settings/MasterClear.java @@ -69,19 +69,16 @@ public class MasterClear extends Activity { }; /** - * Keyguard validation is run using the standard {@link ConfirmLockPattern} + * Keyguard validation is run using the standard {@link ConfirmLockPattern} * component as a subactivity + * @param request the request code to be returned once confirmation finishes + * @return true if confirmation launched */ - private void runKeyguardConfirmation() { - final Intent intent = new Intent(); - intent.setClassName("com.android.settings", - "com.android.settings.ConfirmLockPattern"); - // supply header and footer text in the intent - intent.putExtra(ConfirmLockPattern.HEADER_TEXT, - getText(R.string.master_clear_gesture_prompt)); - intent.putExtra(ConfirmLockPattern.FOOTER_TEXT, - getText(R.string.master_clear_gesture_explanation)); - startActivityForResult(intent, KEYGUARD_REQUEST); + private boolean runKeyguardConfirmation(int request) { + return new ChooseLockSettingsHelper(this) + .launchConfirmationActivity(request, + getText(R.string.master_clear_gesture_prompt), + getText(R.string.master_clear_gesture_explanation)); } @Override @@ -96,6 +93,8 @@ public class MasterClear extends Activity { // confirmation prompt; otherwise, go back to the initial state. if (resultCode == Activity.RESULT_OK) { establishFinalConfirmationState(); + } else if (resultCode == Activity.RESULT_CANCELED) { + finish(); } else { establishInitialState(); } @@ -108,9 +107,7 @@ public class MasterClear extends Activity { */ private Button.OnClickListener mInitiateListener = new Button.OnClickListener() { public void onClick(View v) { - if (mLockUtils.isLockPatternEnabled()) { - runKeyguardConfirmation(); - } else { + if (!runKeyguardConfirmation(KEYGUARD_REQUEST)) { establishFinalConfirmationState(); } } |
