Support isSetupFlow extra in the deprecated setupwizardlib library

The isSetupFlow extra is introduced in SetupCompat/SetupDesign library. However, the
client use this setupwizardlib library will lead WizardScriptHelper#isAnySetupWizard()
of SetupCompat not work from Android Q since isSetupFlow extra will be truncated.

Success log for after patching setupwizardlib and replacing FactoryOta
http://gpaste/5367975093731328

Bug: b/129445834
Test: mma and manual test
Change-Id: Ia5ba16d2bf3d3b3e489a52369f234819165d5de7
This commit is contained in:
Cyril Lee 2019-03-28 22:41:29 +08:00
parent 67c7021554
commit f2abf71d83
1 changed files with 6 additions and 1 deletions

View File

@ -47,6 +47,7 @@ public class WizardManagerHelper {
@VisibleForTesting static final String EXTRA_IS_FIRST_RUN = "firstRun";
@VisibleForTesting static final String EXTRA_IS_DEFERRED_SETUP = "deferredSetup";
@VisibleForTesting static final String EXTRA_IS_PRE_DEFERRED_SETUP = "preDeferredSetup";
@VisibleForTesting public static final String EXTRA_IS_SETUP_FLOW = "isSetupFlow";
public static final String EXTRA_THEME = "theme";
public static final String EXTRA_USE_IMMERSIVE_MODE = "useImmersiveMode";
@ -143,7 +144,11 @@ public class WizardManagerHelper {
public static void copyWizardManagerExtras(Intent srcIntent, Intent dstIntent) {
dstIntent.putExtra(EXTRA_WIZARD_BUNDLE, srcIntent.getBundleExtra(EXTRA_WIZARD_BUNDLE));
for (String key :
Arrays.asList(EXTRA_IS_FIRST_RUN, EXTRA_IS_DEFERRED_SETUP, EXTRA_IS_PRE_DEFERRED_SETUP)) {
Arrays.asList(
EXTRA_IS_FIRST_RUN,
EXTRA_IS_DEFERRED_SETUP,
EXTRA_IS_PRE_DEFERRED_SETUP,
EXTRA_IS_SETUP_FLOW)) {
dstIntent.putExtra(key, srcIntent.getBooleanExtra(key, false));
}