diff options
Diffstat (limited to 'library')
-rw-r--r-- | library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java | 17 | ||||
-rw-r--r-- | library/test/robotest/src/com/android/setupwizardlib/util/WizardManagerHelperTest.java | 3 |
2 files changed, 13 insertions, 7 deletions
diff --git a/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java b/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java index 896c013..32929aa 100644 --- a/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java +++ b/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java @@ -27,6 +27,8 @@ import android.support.annotation.VisibleForTesting; import com.android.setupwizardlib.R; +import java.util.Arrays; + public class WizardManagerHelper { private static final String ACTION_NEXT = "com.android.wizard.NEXT"; @@ -142,13 +144,14 @@ public class WizardManagerHelper { */ public static void copyWizardManagerExtras(Intent srcIntent, Intent dstIntent) { dstIntent.putExtra(EXTRA_WIZARD_BUNDLE, srcIntent.getBundleExtra(EXTRA_WIZARD_BUNDLE)); - 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)); + for (String key : Arrays.asList( + EXTRA_IS_FIRST_RUN, EXTRA_IS_DEFERRED_SETUP, EXTRA_IS_PRE_DEFERRED_SETUP)) { + dstIntent.putExtra(key, srcIntent.getBooleanExtra(key, false)); + } + + for (String key : Arrays.asList(EXTRA_THEME, EXTRA_SCRIPT_URI, EXTRA_ACTION_ID)) { + dstIntent.putExtra(key, srcIntent.getStringExtra(key)); + } } /** diff --git a/library/test/robotest/src/com/android/setupwizardlib/util/WizardManagerHelperTest.java b/library/test/robotest/src/com/android/setupwizardlib/util/WizardManagerHelperTest.java index 6477b51..c236bb5 100644 --- a/library/test/robotest/src/com/android/setupwizardlib/util/WizardManagerHelperTest.java +++ b/library/test/robotest/src/com/android/setupwizardlib/util/WizardManagerHelperTest.java @@ -274,6 +274,7 @@ public class WizardManagerHelperTest { .putExtra(WizardManagerHelper.EXTRA_WIZARD_BUNDLE, wizardBundle) .putExtra(WizardManagerHelper.EXTRA_IS_FIRST_RUN, true) .putExtra(WizardManagerHelper.EXTRA_IS_DEFERRED_SETUP, true) + .putExtra(WizardManagerHelper.EXTRA_IS_PRE_DEFERRED_SETUP, true) // Script URI and Action ID are kept for backwards compatibility .putExtra(WizardManagerHelper.EXTRA_SCRIPT_URI, "test_script_uri") .putExtra(WizardManagerHelper.EXTRA_ACTION_ID, "test_action_id"); @@ -292,6 +293,8 @@ public class WizardManagerHelperTest { intent.getBooleanExtra(WizardManagerHelper.EXTRA_IS_FIRST_RUN, false)); assertTrue("EXTRA_IS_DEFERRED_SETUP should be copied", intent.getBooleanExtra(WizardManagerHelper.EXTRA_IS_DEFERRED_SETUP, false)); + assertTrue("EXTRA_IS_PRE_DEFERRED_SETUP should be copied", + intent.getBooleanExtra(WizardManagerHelper.EXTRA_IS_PRE_DEFERRED_SETUP, false)); // Script URI and Action ID are replaced by Wizard Bundle in M, but are kept for backwards // compatibility |