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_SCRIPT_URI, srcIntent.getStringExtra(EXTRA_SCRIPT_URI)); dstIntent.putExtra(EXTRA_ACTION_ID, srcIntent.getStringExtra(EXTRA_ACTION_ID)); }  static Intent getNextIntent(Intent originalIntent, int resultCode); static Intent getNextIntent(Intent originalIntent, int resultCode, Intent data); static void copyWizardManagerExtras(Intent srcIntent, Intent dstIntent); static boolean isSetupWizardIntent(Intent intent); static boolean isUserSetupComplete(Context context); static boolean isDeviceProvisioned(Context context); static boolean isLightTheme(Intent intent, boolean def); static boolean isLightTheme(String theme, boolean def); static @StyleRes int getThemeRes(Intent intent, @StyleRes int defaultTheme); static @StyleRes int getThemeRes(String theme, @StyleRes int defaultTheme); static final String EXTRA_THEME; static final String EXTRA_USE_IMMERSIVE_MODE; static final String SETTINGS_GLOBAL_DEVICE_PROVISIONED; static final String SETTINGS_SECURE_USER_SETUP_COMPLETE; static final String THEME_HOLO; static final String THEME_HOLO_LIGHT; static final String THEME_MATERIAL; static final String THEME_MATERIAL_LIGHT; static final String THEME_GLIF; static final String THEME_GLIF_LIGHT; static final String THEME_GLIF_PIXEL; static final String THEME_GLIF_PIXEL_LIGHT; }
@Test public void testCopyWizardManagerIntent() { Bundle wizardBundle = new Bundle(); wizardBundle.putString("foo", "bar"); Intent originalIntent = new Intent() .putExtra(WizardManagerHelper.EXTRA_THEME, "test_theme") .putExtra(WizardManagerHelper.EXTRA_WIZARD_BUNDLE, wizardBundle) .putExtra(WizardManagerHelper.EXTRA_IS_FIRST_RUN, true) .putExtra(WizardManagerHelper.EXTRA_SCRIPT_URI, "test_script_uri") .putExtra(WizardManagerHelper.EXTRA_ACTION_ID, "test_action_id"); Intent intent = new Intent("test.intent.action"); WizardManagerHelper.copyWizardManagerExtras(originalIntent, intent); assertEquals("Intent action should be kept", "test.intent.action", intent.getAction()); assertEquals("EXTRA_THEME should be copied", "test_theme", intent.getStringExtra(WizardManagerHelper.EXTRA_THEME)); Bundle copiedWizardBundle = intent.getParcelableExtra(WizardManagerHelper.EXTRA_WIZARD_BUNDLE); assertEquals("Wizard bundle should be copied", "bar", copiedWizardBundle.getString("foo")); assertTrue("EXTRA_IS_FIRST_RUN should be copied", intent.getBooleanExtra(WizardManagerHelper.EXTRA_IS_FIRST_RUN, false)); assertEquals("EXTRA_SCRIPT_URI should be copied", "test_script_uri", intent.getStringExtra(WizardManagerHelper.EXTRA_SCRIPT_URI)); assertEquals("EXTRA_ACTION_ID should be copied", "test_action_id", intent.getStringExtra(WizardManagerHelper.EXTRA_ACTION_ID)); }