SetupWizard: Distinguish interactive and wrapper subactivities

We were using the SubBaseActivity class for two different kind of
activities:
 (1) "Wrapper" activities, where we define an activity that on
     start simply launches another one
 (2) "Interactive" activities, where the user has to manually
     trigger the start of the subactivity, or skip the step.

When the subactivity ends, only in case (1) we want to finish our
activity as well, since we wouldn't have anything to show.

Change-Id: I1a3ae51f6146ac32b5e7542d9a18b0b032efe144
This commit is contained in:
Alessandro Astone
2020-11-13 21:56:33 +01:00
parent cff638652a
commit 35eda3a50b
5 changed files with 41 additions and 6 deletions

View File

@@ -40,6 +40,10 @@ public abstract class SubBaseActivity extends BaseSetupWizardActivity {
protected abstract void onStartSubactivity();
protected void onSubactivityCanceled(Intent data) {
// Do nothing.
}
@Override
protected void onCreate(Bundle savedInstanceState) {
if (LOGV) {
@@ -142,8 +146,7 @@ public abstract class SubBaseActivity extends BaseSetupWizardActivity {
nextAction(RESULT_ACTIVITY_NOT_FOUND);
finish();
} else {
applyBackwardTransition(getSubactivityPreviousTransition());
finishAction(RESULT_CANCELED, data);
onSubactivityCanceled(data);
}
}