Workaround for back press through SIM Missing page

Make sure the prior activity (NetworkSetupActivity) knows that back was
pressed - as it must have been - when the user returns to it. Otherwise,
the wizard gets stuck on a "Just a sec" page forever.

Change-Id: I35f7a78c4decc13b9dee267bfaf195fb2241395d
This commit is contained in:
Tommy Webb
2024-08-01 15:52:03 +00:00
committed by Michael Bestas
parent 8dad806a61
commit 4ed687c330

View File

@@ -20,7 +20,16 @@ public class SimMissingActivity extends BaseSetupWizardActivity {
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
if (!SetupWizardUtils.simMissing(this) || !SetupWizardUtils.hasTelephony(this)) { if (!SetupWizardUtils.simMissing(this) || !SetupWizardUtils.hasTelephony(this)) {
finishAction(RESULT_SKIP); // NetworkSetupActivity comes before us. DateTimeActivity comes after.
// If the user presses the back button on DateTimeActivity, we can only pass along
// that information to NetworkSetupActivity if we are still around. But if we finish
// here, we're gone, and NetworkSetupActivity will get whatever result we give here.
// We can't predict the future, but we can reasonably assume that the only way for
// NetworkSetupActivity to be reached later is if the user went backwards. So, we
// finish this activity faking that the user pressed the back button, which is required
// for subactivities like NetworkSetupActivity to work properly on backward navigation.
// TODO: Resolve all this.
finishAction(RESULT_SKIP, new Intent().putExtra("onBackPressed", true));
return; return;
} }
getGlifLayout().setDescriptionText(getString(R.string.sim_missing_summary)); getGlifLayout().setDescriptionText(getString(R.string.sim_missing_summary));