diff options
Diffstat (limited to 'src/com/android/settings/ChooseLockPattern.java')
-rw-r--r-- | src/com/android/settings/ChooseLockPattern.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/settings/ChooseLockPattern.java b/src/com/android/settings/ChooseLockPattern.java index 46bf94ca0..3d3ef1698 100644 --- a/src/com/android/settings/ChooseLockPattern.java +++ b/src/com/android/settings/ChooseLockPattern.java @@ -28,6 +28,7 @@ import static com.android.internal.widget.LockPatternView.DisplayMode; import android.app.Activity; import android.app.Fragment; import android.content.ContentResolver; +import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.provider.Settings; @@ -68,6 +69,16 @@ public class ChooseLockPattern extends SettingsActivity { return modIntent; } + public static Intent createIntent(Context context, final boolean isFallback, + boolean requirePassword, boolean confirmCredentials) { + Intent intent = new Intent(context, ChooseLockPattern.class); + intent.putExtra("key_lock_method", "pattern"); + intent.putExtra(ChooseLockGeneric.CONFIRM_CREDENTIALS, confirmCredentials); + intent.putExtra(LockPatternUtils.LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, isFallback); + intent.putExtra(EncryptionInterstitial.EXTRA_REQUIRE_PASSWORD, requirePassword); + return intent; + } + @Override protected boolean isValidFragment(String fragmentName) { if (ChooseLockPatternFragment.class.getName().equals(fragmentName)) return true; @@ -528,6 +539,10 @@ public class ChooseLockPattern extends SettingsActivity { final boolean isFallback = getActivity().getIntent() .getBooleanExtra(LockPatternUtils.LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, false); + + final boolean required = getActivity().getIntent().getBooleanExtra( + EncryptionInterstitial.EXTRA_REQUIRE_PASSWORD, true); + utils.setCredentialRequiredToDecrypt(required); utils.saveLockPattern(mChosenPattern, isFallback); utils.setLockPatternEnabled(true); |