summaryrefslogtreecommitdiff
path: root/library/main
diff options
context:
space:
mode:
Diffstat (limited to 'library/main')
-rw-r--r--library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java b/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java
index f25d646..a93694c 100644
--- a/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java
+++ b/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java
@@ -43,6 +43,8 @@ public class WizardManagerHelper {
private static final String EXTRA_RESULT_CODE = "com.android.setupwizard.ResultCode";
@VisibleForTesting
static final String EXTRA_IS_FIRST_RUN = "firstRun";
+ @VisibleForTesting
+ static final String EXTRA_IS_DEFERRED_SETUP = "deferredSetup";
public static final String EXTRA_THEME = "theme";
public static final String EXTRA_USE_IMMERSIVE_MODE = "useImmersiveMode";
@@ -141,6 +143,8 @@ public class WizardManagerHelper {
dstIntent.putExtra(EXTRA_THEME, srcIntent.getStringExtra(EXTRA_THEME));
dstIntent.putExtra(EXTRA_IS_FIRST_RUN,
srcIntent.getBooleanExtra(EXTRA_IS_FIRST_RUN, false));
+ dstIntent.putExtra(EXTRA_IS_DEFERRED_SETUP,
+ srcIntent.getBooleanExtra(EXTRA_IS_DEFERRED_SETUP, false));
dstIntent.putExtra(EXTRA_SCRIPT_URI, srcIntent.getStringExtra(EXTRA_SCRIPT_URI));
dstIntent.putExtra(EXTRA_ACTION_ID, srcIntent.getStringExtra(EXTRA_ACTION_ID));
}
@@ -197,6 +201,18 @@ public class WizardManagerHelper {
}
/**
+ * Checks whether an intent is running in the deferred setup wizard flow.
+ *
+ * @param originalIntent The original intent that was used to start the step, usually via
+ * {@link android.app.Activity#getIntent()}.
+ * @return true if the intent passed in was running in deferred setup wizard.
+ */
+ public static boolean isDeferredSetupWizard(Intent originalIntent) {
+ return originalIntent != null
+ && originalIntent.getBooleanExtra(EXTRA_IS_DEFERRED_SETUP, false);
+ }
+
+ /**
* Checks the intent whether the extra indicates that the light theme should be used or not. If
* the theme is not specified in the intent, or the theme specified is unknown, the value def
* will be returned.