summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/ChooseLockSettingsHelper.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-11-02 09:52:29 -0700
committerAmith Yamasani <yamasani@google.com>2010-11-03 12:04:16 -0700
commitb14e1e04939ca610fd5f2439f879265450b0a6cd (patch)
tree57488b35cbd4c05927976ae0851a76f19d22e082 /src/com/android/settings/ChooseLockSettingsHelper.java
parentc9904f0028e71691adcb34a6691b96e024c33687 (diff)
downloadpackages_apps_settings-b14e1e04939ca610fd5f2439f879265450b0a6cd.zip
packages_apps_settings-b14e1e04939ca610fd5f2439f879265450b0a6cd.tar.gz
packages_apps_settings-b14e1e04939ca610fd5f2439f879265450b0a6cd.tar.bz2
Fragmentize "Factory reset" setting screen.
Split the screen into 2 fragments. Bug: 3148480
Diffstat (limited to 'src/com/android/settings/ChooseLockSettingsHelper.java')
-rw-r--r--src/com/android/settings/ChooseLockSettingsHelper.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/com/android/settings/ChooseLockSettingsHelper.java b/src/com/android/settings/ChooseLockSettingsHelper.java
index abcfc05..d31fe3b 100644
--- a/src/com/android/settings/ChooseLockSettingsHelper.java
+++ b/src/com/android/settings/ChooseLockSettingsHelper.java
@@ -16,21 +16,28 @@
package com.android.settings;
+import com.android.internal.widget.LockPatternUtils;
+
import android.app.Activity;
+import android.app.Fragment;
import android.app.admin.DevicePolicyManager;
import android.content.Intent;
-import com.android.internal.widget.LockPatternUtils;
-
public class ChooseLockSettingsHelper {
private LockPatternUtils mLockPatternUtils;
private Activity mActivity;
+ private Fragment mFragment;
public ChooseLockSettingsHelper(Activity activity) {
mActivity = activity;
mLockPatternUtils = new LockPatternUtils(activity);
}
+ public ChooseLockSettingsHelper(Activity activity, Fragment fragment) {
+ this(activity);
+ mFragment = fragment;
+ }
+
public LockPatternUtils utils() {
return mLockPatternUtils;
}
@@ -76,7 +83,11 @@ public class ChooseLockSettingsHelper {
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);
+ if (mFragment != null) {
+ mFragment.startActivityForResult(intent, request);
+ } else {
+ mActivity.startActivityForResult(intent, request);
+ }
return true;
}
@@ -89,7 +100,11 @@ public class ChooseLockSettingsHelper {
if (!mLockPatternUtils.isLockPasswordEnabled()) return false;
final Intent intent = new Intent();
intent.setClassName("com.android.settings", "com.android.settings.ConfirmLockPassword");
- mActivity.startActivityForResult(intent, request);
+ if (mFragment != null) {
+ mFragment.startActivityForResult(intent, request);
+ } else {
+ mActivity.startActivityForResult(intent, request);
+ }
return true;
}