Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@
* the install is companion=false (OS/tier only; maps ships in the image), replacing the old
* Step 2 "Download library" trigger. */
public void startWizardInstall() {
// ADFA-4982: the real install is starting — mark setup complete NOW (it is no longer set at the
// wizard's "download" choice, so bailing before this resumes the wizard). This also lets the
// install LibraryActivity below show progress instead of redirecting back to the wizard.
getSharedPreferences(getString(R.string.pref_file_internal), MODE_PRIVATE)
.edit().putBoolean(getString(R.string.pref_key_setup_complete), true).apply();
Intent i = new Intent(this, InstallService.class);
i.setAction(InstallService.ACTION_START);
i.putExtra(InstallService.EXTRA_TIER, getSelectedTier().name());
Expand Down Expand Up @@ -406,7 +411,7 @@
* on purpose (not deleted): ADFA-4842 (reactivate proot modules via module management) may want
* to generalize a "install these proot modules now" path from here — 4842 decides whether to
* reuse/generalize or delete. Deleting now could remove something module management wants. */
public void openMapsPreparing(String[] levels) {

Check warning on line 414 in controller/app/src/main/java/org/iiab/controller/redesign/SetupLibraryActivity.java

View workflow job for this annotation

GitHub Actions / Build & Distribute

[dep-ann*** deprecated item is not annotated with @deprecated

Check warning on line 414 in controller/app/src/main/java/org/iiab/controller/redesign/SetupLibraryActivity.java

View workflow job for this annotation

GitHub Actions / Lint & Compile Check

[dep-ann] deprecated item is not annotated with @deprecated
getSupportFragmentManager().beginTransaction()
.replace(R.id.k2go_setup_host, MapsPreparingFragment.newInstance(levels))
.addToBackStack("maps_preparing")
Expand Down Expand Up @@ -475,7 +480,7 @@
* the per-layer selection). InstallService writes the full maps_* local_vars and runs runrole
* with the shared success/failure verdict, revert-on-fail and observable progress. {@code levels}
* is aligned to the Choose groups [base, satellite, terrain, search]; null = off. */
public void startMapsInstall(String[] levels) {

Check warning on line 483 in controller/app/src/main/java/org/iiab/controller/redesign/SetupLibraryActivity.java

View workflow job for this annotation

GitHub Actions / Build & Distribute

[dep-ann*** deprecated item is not annotated with @deprecated

Check warning on line 483 in controller/app/src/main/java/org/iiab/controller/redesign/SetupLibraryActivity.java

View workflow job for this annotation

GitHub Actions / Lint & Compile Check

[dep-ann] deprecated item is not annotated with @deprecated
String base = levels != null && levels.length > 0 && levels[0] != null ? levels[0] : "osm-z11";
String sat = levels != null && levels.length > 1 && levels[1] != null ? levels[1] : "none";
String ter = levels != null && levels.length > 2 && levels[2] != null ? levels[2] : "none";
Expand All @@ -496,7 +501,7 @@
* Kept UNUSED pending ADFA-4842 (see openMapsPreparing). (ZIM uses backToGetMoreHubZim, separate.)
* ADFA-4848: "Run in background" from Preparing -> drop the whole Maps flow off the back
* stack and return to the Get More hub; the build keeps running. */
public void backToGetMoreHub() {

Check warning on line 504 in controller/app/src/main/java/org/iiab/controller/redesign/SetupLibraryActivity.java

View workflow job for this annotation

GitHub Actions / Build & Distribute

[dep-ann*** deprecated item is not annotated with @deprecated

Check warning on line 504 in controller/app/src/main/java/org/iiab/controller/redesign/SetupLibraryActivity.java

View workflow job for this annotation

GitHub Actions / Lint & Compile Check

[dep-ann] deprecated item is not annotated with @deprecated
getSupportFragmentManager().popBackStack("getmore_maps",
androidx.fragment.app.FragmentManager.POP_BACK_STACK_INCLUSIVE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
});

root.findViewById(R.id.k2go_step1_back).setOnClickListener(v -> {
// Setup was already marked complete when the wizard launched this; route to the
// library (reusing it if it is under us) instead of a bare finish() that would
// drop the user to the Android home screen.
// ADFA-4982: setup is NOT complete until the install actually starts, so routing to
// LibraryActivity here (which sees !complete) sends the user back to the wizard's setup
// choice — resuming where they were, instead of a bare finish() to the Android home screen.
android.content.Intent i = new android.content.Intent(requireContext(), LibraryActivity.class);
i.addFlags(android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP | android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ protected void onCreate(Bundle b) {
// applied language, so we don't flash back to the welcome step.
langTag = AppLocaleController.currentTag();
if (b != null) step = b.getInt("step", 0);
// ADFA-4982: a fresh launch that isn't complete yet but already has permissions means the user
// passed language + permissions and only bailed from the setup choice / edition selection —
// resume at the setup choice (step 3), not welcome/language/permissions all over again.
else if (!prefs().getBoolean(getString(R.string.pref_key_setup_complete), false) && allPermsGranted()) step = 3;
title = findViewById(R.id.wiz_title);
subtitle = findViewById(R.id.wiz_subtitle);
primary = findViewById(R.id.wiz_primary);
Expand Down Expand Up @@ -88,7 +92,9 @@ protected void onCreate(Bundle b) {

// set-up-library choices
findViewById(R.id.setup_download).setOnClickListener(v -> {
markComplete();
// ADFA-4982: do NOT mark setup complete here — only a real install does (startWizardInstall).
// If the user bails during edition/size selection, the next launch resumes at this setup
// choice (see onCreate) instead of stranding them on an empty Home.
startActivity(new Intent(this, SetupLibraryActivity.class));
finish();
});
Expand Down