diff options
| author | Jim Miller <jaggies@google.com> | 2010-04-13 17:43:36 -0700 |
|---|---|---|
| committer | Jim Miller <jaggies@google.com> | 2010-04-14 01:15:05 -0700 |
| commit | 2deec7edc937b1d19df0a74c4cd0c5ee3ef33070 (patch) | |
| tree | 29bae509042b617da667c1dc1c49590feccb29d2 /src/com/android/settings/MasterClear.java | |
| parent | fc5a02225e8bca21f07543f55e1b51a33670c501 (diff) | |
| download | packages_apps_Settings-2deec7edc937b1d19df0a74c4cd0c5ee3ef33070.tar.gz packages_apps_Settings-2deec7edc937b1d19df0a74c4cd0c5ee3ef33070.tar.bz2 packages_apps_Settings-2deec7edc937b1d19df0a74c4cd0c5ee3ef33070.zip | |
Fix 2594148: confirm PIN/Password before resetting device
This fixes a bug where user was allowed to factory reset the device
without entering their PIN/Password.
It also fixes the same issue with MediaFormat (Settings->SD Card->Format).
Change-Id: I0677a50aa771ad8663513fd7ec398a70953dcde2
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 7e408d1d7..4de0e448e 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(); } } |
