[SetupWizard] Refactor WifiSetupActivity
Refactor WifiSetupActivity to respect the conventional logic of Setup Wizard's SubactivityWrapper. WifiSetupActivity now returns the result code back to WifiSettingsWrapper and lets the Wrapper invoke WizardManager, instead of invoking WizardManager by itself and letting its Wrapper finish early. The related change in WifiSettingsWrapper on Setup Wizard side is ag/676788. Bug: 20309008 Change-Id: Ia3bc2ff390404ff87c427782b5e7b345050bea03
This commit is contained in:
@@ -33,24 +33,11 @@ public class SetupWizardUtils {
|
||||
|
||||
// From WizardManager (must match constants maintained there)
|
||||
public static final String EXTRA_SCRIPT_URI = "scriptUri";
|
||||
public static final int NEXT_REQUEST = 10000;
|
||||
|
||||
public static boolean isUsingWizardManager(Activity activity) {
|
||||
return activity.getIntent().hasExtra(EXTRA_SCRIPT_URI);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the results of this activity to WizardManager, which will then send out the next
|
||||
* scripted activity. WizardManager does not actually return an activity result, but if we
|
||||
* invoke WizardManager without requesting a result, the framework will choose not to issue a
|
||||
* call to onActivityResult with RESULT_CANCELED when navigating backward.
|
||||
*/
|
||||
public static void sendResultsToSetupWizard(Activity activity, int resultCode) {
|
||||
final Intent intent = activity.getIntent();
|
||||
final Intent nextIntent = WizardManagerHelper.getNextIntent(intent, resultCode);
|
||||
activity.startActivityForResult(nextIntent, NEXT_REQUEST);
|
||||
}
|
||||
|
||||
public static int getTheme(Intent intent) {
|
||||
if (WizardManagerHelper.isLightTheme(intent, true)) {
|
||||
return R.style.SetupWizardTheme_Light;
|
||||
|
Reference in New Issue
Block a user