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/ChooseLockSettingsHelper.java | |
parent | fc5a02225e8bca21f07543f55e1b51a33670c501 (diff) | |
download | packages_apps_settings-2deec7edc937b1d19df0a74c4cd0c5ee3ef33070.zip packages_apps_settings-2deec7edc937b1d19df0a74c4cd0c5ee3ef33070.tar.gz packages_apps_settings-2deec7edc937b1d19df0a74c4cd0c5ee3ef33070.tar.bz2 |
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/ChooseLockSettingsHelper.java')
-rw-r--r-- | src/com/android/settings/ChooseLockSettingsHelper.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/settings/ChooseLockSettingsHelper.java b/src/com/android/settings/ChooseLockSettingsHelper.java index 6382891..ba83f8e 100644 --- a/src/com/android/settings/ChooseLockSettingsHelper.java +++ b/src/com/android/settings/ChooseLockSettingsHelper.java @@ -37,18 +37,22 @@ public class ChooseLockSettingsHelper { /** * If a pattern, password or PIN exists, prompt the user before allowing them to change it. + * @param message optional message to display about the action about to be done + * @param details optional detail message to display * @return true if one exists and we launched an activity to confirm it * @see #onActivityResult(int, int, android.content.Intent) */ - protected boolean launchConfirmationActivity(int request) { + protected boolean launchConfirmationActivity(int request, + CharSequence message, CharSequence details) { boolean launched = false; switch (mLockPatternUtils.getKeyguardStoredPasswordQuality()) { case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING: - launched = confirmPattern(request); + launched = confirmPattern(request, message, details); break; case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC: case DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC: case DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC: + // TODO: update UI layout for ConfirmPassword to show message and details launched = confirmPassword(request); break; } @@ -57,14 +61,19 @@ public class ChooseLockSettingsHelper { /** * Launch screen to confirm the existing lock pattern. + * @param message shown in header of ConfirmLockPattern if not null + * @param details shown in footer of ConfirmLockPattern if not null * @see #onActivityResult(int, int, android.content.Intent) * @return true if we launched an activity to confirm pattern */ - private boolean confirmPattern(int request) { + private boolean confirmPattern(int request, CharSequence message, CharSequence details) { if (!mLockPatternUtils.isLockPatternEnabled() || !mLockPatternUtils.savedPatternExists()) { return false; } final Intent intent = new Intent(); + // supply header and footer text in the intent + intent.putExtra(ConfirmLockPattern.HEADER_TEXT, message); + intent.putExtra(ConfirmLockPattern.FOOTER_TEXT, details); intent.setClassName("com.android.settings", "com.android.settings.ConfirmLockPattern"); mActivity.startActivityForResult(intent, request); return true; |