diff --git a/controller/app/src/main/java/org/appdevforall/k2go/PRootEngine.java b/controller/app/src/main/java/org/appdevforall/k2go/PRootEngine.java index 3dd58866b..d403a0582 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/PRootEngine.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/PRootEngine.java @@ -408,6 +408,55 @@ public void killProcess() { final Process p = currentProcess; if (p == null) return; p.destroy(); + reap(p); + } + + /** + * K2GO-593: stop the command and every box process it started. {@link #killProcess} sends + * SIGTERM, and proot does not exit on it: it stays until its guests end, so a cancelled runrole + * kept downloading. SIGKILL ends proot, and PTRACE_O_EXITKILL (K2GO-544) then makes the kernel + * kill all its guests. + */ + public void forceKill() { + final Process p = currentProcess; + if (p == null || !isAlive(p)) return; // an ended command's pid can belong to another process now + // Not destroyForcibly(): on the device it left proot running, the same as destroy(). + int pid = pidOf(p); + if (pid > 0) { + android.os.Process.sendSignal(pid, android.os.Process.SIGNAL_KILL); + Log.i(TAG, "K2GO-593: SIGKILL sent to proot pid " + pid); + } else { + Log.w(TAG, "K2GO-593: proot pid unknown; falling back to destroy()"); + p.destroy(); + } + reap(p); + } + + /** Process.isAlive() is API 26+, minSdk is 24: exitValue() throws while the process runs. */ + private static boolean isAlive(Process p) { + try { + p.exitValue(); + return false; + } catch (IllegalThreadStateException running) { + return true; + } + } + + /** The pid of a child process, or -1 if unknown. Process.pid() is API 33+, minSdk is 24. */ + static int pidOf(Process p) { + java.util.regex.Matcher m = + java.util.regex.Pattern.compile("pid=(\\d+)").matcher(String.valueOf(p)); + if (m.find()) return Integer.parseInt(m.group(1)); + try { + java.lang.reflect.Field f = p.getClass().getDeclaredField("pid"); + f.setAccessible(true); + return f.getInt(p); + } catch (Exception e) { + return -1; + } + } + + private static void reap(final Process p) { // Reap the child off the caller's thread so it does not linger as a // zombie / hold proot mounts. Process.waitFor(timeout) is API 26+ and // minSdk is 24, so we drain on the shared io() executor instead of diff --git a/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/InstallService.java b/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/InstallService.java index a442b4a7b..a459d7177 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/InstallService.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/InstallService.java @@ -953,8 +953,10 @@ private void installNextModule() { "cd /opt/iiab/iiab && ./runrole " + roleName; // K2GO-464: refresh the stale rootfs apt index before the runrole, or a pinned dep 404s as the // box ages. Best-effort (short timeout, || true) so an offline/local-only install still runs. + // K2GO-593: a Cancel SIGKILLs the runrole, also during dpkg; finish any interrupted dpkg first. final String installCmd = - "apt-get -o Acquire::http::Timeout=10 -o Acquire::https::Timeout=10 update || true ; " + runroleCmd; + "DEBIAN_FRONTEND=noninteractive dpkg --force-confdef --force-confold --configure -a < /dev/null || true ; " + + "apt-get -o Acquire::http::Timeout=10 -o Acquire::https::Timeout=10 update || true ; " + runroleCmd; // K2GO-394: the runrole (post-processing) as a deferred step. For maps it runs only AFTER the // base maps are downloaded through dash-node (the gate below); other modules run it at once. @@ -1074,7 +1076,9 @@ private void revertModuleInLocalVars(String module, Runnable then) { if (prootEngine == null) prootEngine = new PRootEngine(); String revertCmd = "sed -i -E '/^[[:space:]]*" + module + "_(install|enabled)[[:space:]]*:/d' /etc/iiab/local_vars.yml && " + "echo '" + module + "_install: False' >> /etc/iiab/local_vars.yml && " + - "echo '" + module + "_enabled: False' >> /etc/iiab/local_vars.yml"; + "echo '" + module + "_enabled: False' >> /etc/iiab/local_vars.yml ; " + + // K2GO-593: a killed runrole leaves its task dirs (a partial download) behind. + "rm -rf /root/.ansible/tmp/ansible-tmp-*"; prootEngine.executeInContainer(this, debianRootfs.getAbsolutePath(), revertCmd, new PRootEngine.OutputListener() { @Override public void onOutputLine(String line) { } @Override public void onProcessExit(int exitCode) { then.run(); } @@ -1140,10 +1144,8 @@ private void stopModuleStallWatch() { * unset so that callback runs (the cancel path suppresses it). {@code gen} drops a kill queued for * a module that has since ended. * - *

Known limit (shared with doCancel): killProcess SIGKILLs proot, orphaning its in-container - * child. Low impact by the role's own flags -- aria2c self-exits (max-tries=5, timeout=60) and the - * meta4 fetch just idles a socket; neither firehoses disk, so recovery works regardless. Reap the - * orphan (reuse EnvironmentProcess's /proc sweep) only if a retry-conflict is ever observed. + *

K2GO-593: forceKill SIGKILLs proot, and PTRACE_O_EXITKILL (K2GO-544) makes the kernel kill + * its box processes too, so no orphan keeps working after the kill. */ private void hardStallKill(final String moduleKey, final int gen) { if (gen != moduleStallGen || finished || cancelled || moduleStallKilled) return; @@ -1151,7 +1153,7 @@ private void hardStallKill(final String moduleKey, final int gen) { log("[Stall] '" + moduleKey + "' made no progress for " + (MODULE_HARD_STALL_MS / 1000) + "s; killing the runrole so it fails through to Retry"); stopModuleStallWatch(); - if (prootEngine != null) prootEngine.killProcess(); + if (prootEngine != null) prootEngine.forceKill(); // K2GO-593: SIGTERM did not end proot } /** @@ -1702,22 +1704,27 @@ private void doCancel() { } if (moduleMode) { // ADFA-4898 P5: user-confirmed cancel of a running module install. Kill the in-flight runrole - // (proot runs with --kill-on-exit, so its container children go with it), roll back that + // and its box processes (forceKill below), roll back that // module's speculative _install so a cancel is not left looking installed, and surface it // as failed so the existing per-module Retry is offered immediately. Ordering mirrors // finishModuleQueue: clear InstallGuard BEFORE postDone so the server-restart observer (the // server was pdsm-stopped for the runroles) is not raced by teardown's later clear. - final String cur = ModuleQueueRepository.get().current().currentModule; + // K2GO-593: during pdsm stop no module is current yet; the cancel stops the first one. + final String running = ModuleQueueRepository.get().current().currentModule; + final String cur = running != null ? running : (moduleQueue != null ? moduleQueue.peek() : null); stopModuleStallWatch(); // ADFA-4898 P4 - if (prootEngine != null) prootEngine.killProcess(); + // K2GO-593: SIGKILL, not SIGTERM. On SIGTERM proot stayed up and the runrole kept downloading. + if (prootEngine != null) prootEngine.forceKill(); if (failedModules == null) failedModules = new java.util.ArrayList<>(); + // K2GO-593: the user stopped it, so it is not an error; only earlier real failures notify. + final java.util.List realFailures = new java.util.ArrayList<>(failedModules); if (cur != null && !failedModules.contains(cur)) failedModules.add(cur); final java.util.List failedSnapshot = new java.util.ArrayList<>(failedModules); final Runnable finishCancel = () -> { persistClearQueue(); org.appdevforall.k2go.InstallGuard.end(this); - ModuleQueueRepository.get().postDone(failedSnapshot); - if (!failedSnapshot.isEmpty()) InstallNotifications.postModuleFailure(this, failedSnapshot); + ModuleQueueRepository.get().postCanceled(failedSnapshot, cur); + if (!realFailures.isEmpty()) InstallNotifications.postModuleFailure(this, realFailures); teardown(); }; if (cur != null) revertModuleInLocalVars(cur, finishCancel); // best-effort rollback, then finish diff --git a/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueRepository.java b/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueRepository.java index 08cc7c77c..5f7e01db4 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueRepository.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueRepository.java @@ -78,6 +78,8 @@ public boolean isInstalling(String moduleKey) { /** ADFA-5228: running with a determinate percent and an estimated seconds-remaining. */ public void postRunning(String currentModule, int remaining, int percent, long etaSeconds) { post(ModuleQueueState.running(currentModule, remaining, percent, etaSeconds)); } public void postDone(List failedModules) { stalled.postValue(false); post(ModuleQueueState.done(failedModules)); } + /** K2GO-593: the batch ended on a user Cancel of {@code canceledModule}. */ + public void postCanceled(List failedModules, String canceledModule) { stalled.postValue(false); post(ModuleQueueState.done(failedModules, canceledModule)); } public void postIdle() { stalled.postValue(false); post(ModuleQueueState.idle()); } private synchronized void post(ModuleQueueState s) { diff --git a/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueState.java b/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueState.java index 834f17427..e02136ef8 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueState.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueState.java @@ -43,11 +43,17 @@ public enum Phase { IDLE, RUNNING, DONE } public final long etaSeconds; /** Modules whose runrole failed in this batch. Only meaningful on DONE. */ public final List failedModules; + /** + * K2GO-593: the module the user stopped with Cancel, or null. It is also in + * {@link #failedModules} (it did not install, so Retry is offered); this only says why, so the + * UI shows "Canceled" instead of an error. Only meaningful on DONE. + */ + public final String canceledModule; /** Monotonic sequence for one-shot effects (finish/fail snackbars exactly once). */ public final long seq; private ModuleQueueState(Phase phase, String currentModule, int remaining, int percent, - long etaSeconds, List failedModules, long seq) { + long etaSeconds, List failedModules, String canceledModule, long seq) { this.phase = phase; this.currentModule = currentModule; this.remaining = Math.max(0, remaining); @@ -56,6 +62,7 @@ private ModuleQueueState(Phase phase, String currentModule, int remaining, int p this.failedModules = failedModules != null ? Collections.unmodifiableList(failedModules) : Collections.emptyList(); + this.canceledModule = canceledModule; this.seq = seq; } @@ -83,8 +90,13 @@ public boolean didFail(String moduleKey) { return phase == Phase.DONE && failedModules.contains(moduleKey); } + /** K2GO-593: true when the user stopped {@code moduleKey} with Cancel in the batch that just ended. */ + public boolean wasCanceled(String moduleKey) { + return phase == Phase.DONE && canceledModule != null && canceledModule.equals(moduleKey); + } + public static ModuleQueueState idle() { - return new ModuleQueueState(Phase.IDLE, null, 0, INDETERMINATE, ETA_UNKNOWN, null, 0L); + return new ModuleQueueState(Phase.IDLE, null, 0, INDETERMINATE, ETA_UNKNOWN, null, null, 0L); } /** Running with no determinate progress (indeterminate spinner). */ @@ -99,14 +111,20 @@ public static ModuleQueueState running(String currentModule, int remaining, int /** ADFA-5228: running with a determinate percent and an estimated seconds-remaining. */ public static ModuleQueueState running(String currentModule, int remaining, int percent, long etaSeconds) { - return new ModuleQueueState(Phase.RUNNING, currentModule, remaining, percent, etaSeconds, null, 0L); + return new ModuleQueueState(Phase.RUNNING, currentModule, remaining, percent, etaSeconds, null, null, 0L); } public static ModuleQueueState done(List failedModules) { - return new ModuleQueueState(Phase.DONE, null, 0, INDETERMINATE, ETA_UNKNOWN, failedModules, 0L); + return done(failedModules, null); + } + + /** K2GO-593: the batch ended because the user canceled {@code canceledModule} (also in failedModules). */ + public static ModuleQueueState done(List failedModules, String canceledModule) { + return new ModuleQueueState(Phase.DONE, null, 0, INDETERMINATE, ETA_UNKNOWN, failedModules, + canceledModule, 0L); } ModuleQueueState withSeq(long seq) { - return new ModuleQueueState(phase, currentModule, remaining, percent, etaSeconds, failedModules, seq); + return new ModuleQueueState(phase, currentModule, remaining, percent, etaSeconds, failedModules, canceledModule, seq); } } diff --git a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleDetailFragment.java b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleDetailFragment.java index 7a7a4e194..fcb3e6a1e 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleDetailFragment.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleDetailFragment.java @@ -227,11 +227,9 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c // — where the batch we just re-fired shows its rows, progress and log. NOT onBackPressed: // that dropped the user on the hub, which during an install only shows "Adding content" // with no route to the progress (the bug seen retrying from Module management). - schedule.setOnClickListener(v -> { - if (ModuleRetry.fire(v, c.key())) { - startActivity(new android.content.Intent(requireContext(), SetupProgressActivity.class)); - } - }); + schedule.setOnClickListener(v -> ModuleRetry.fire(v, c.key(), () -> { + if (isAdded()) startActivity(new android.content.Intent(requireContext(), SetupProgressActivity.class)); + })); schedule.setVisibility(View.VISIBLE); installNowBtn.setText(R.string.k2go_setup_back); installNowBtn.setOnClickListener(v -> requireActivity().getOnBackPressedDispatcher().onBackPressed()); diff --git a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleHubFragment.java b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleHubFragment.java index b973717d5..84584669d 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleHubFragment.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleHubFragment.java @@ -496,15 +496,19 @@ private View cardRow(final ModuleCards.Card c, final boolean isInstalled, // already there cannot meaningfully be waiting to be installed, and if a stale wishlist // entry survived an install, saying "Scheduled" over it would be the older lie again. boolean scheduled = !isInstalled && !unknown && ModuleWishlist.contains(requireContext(), c.key()); + boolean canceled = failed && org.appdevforall.k2go.install.presentation.ModuleQueueRepository.get() + .current().wasCanceled(c.key()); // K2GO-385 (PR3): a lifecycle state is a read-only STATUS -- dot + text, semantic colour, no // ripple (the shared K2GoStatusBadge) -- not an outlined pill that reads like a button. LinearLayout pill = K2GoStatusBadge.create(requireContext(), isInstalled ? getString(R.string.k2go_mod_phase_done) + : canceled ? getString(R.string.k2go_mod_phase_canceled) // K2GO-593 : failed ? getString(R.string.k2go_mod_phase_failed) : unknown ? getString(R.string.k2go_state_no_answer) : scheduled ? getString(R.string.k2go_mod_scheduled) : getString(R.string.k2go_state_not_installed), isInstalled ? R.color.k2go_leaf + : canceled ? R.color.k2go_muted : failed ? R.color.k2go_clay : unknown ? R.color.k2go_amber_text : scheduled ? R.color.k2go_teal : R.color.k2go_muted); diff --git a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleInstallFragment.java b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleInstallFragment.java index 95280d433..51fbc90da 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleInstallFragment.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleInstallFragment.java @@ -133,7 +133,8 @@ private void updateStatus() { // failedModules.contains(...); routed through the shared atom so the three can't drift apart. if (mq.didFail(key)) { terminalDone = true; - status.setText(getString(R.string.k2go_mod_phase_failed)); + status.setText(getString(mq.wasCanceled(key) // K2GO-593: a user stop is not an error + ? R.string.k2go_mod_phase_canceled : R.string.k2go_mod_phase_failed)); return; } if (mq.phase == ModuleQueueState.Phase.DONE) { diff --git a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleRetry.java b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleRetry.java index f44d3e9cc..f118b6d81 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleRetry.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleRetry.java @@ -12,13 +12,18 @@ */ package org.appdevforall.k2go.redesign; +import android.app.Activity; import android.content.Context; +import android.content.ContextWrapper; import android.view.View; +import androidx.annotation.Nullable; + import java.util.Collections; import org.appdevforall.k2go.env.EnvironmentLock; import org.appdevforall.k2go.install.presentation.InstallService; +import org.appdevforall.k2go.networkpolicy.presentation.NetworkPolicyGate; import org.appdevforall.k2go.system.data.SystemDoor; import org.appdevforall.k2go.system.domain.OperationDispatcher; import org.appdevforall.k2go.util.BusyMessage; @@ -28,21 +33,27 @@ public final class ModuleRetry { private ModuleRetry() {} + /** Same as {@link #fire(View, String, Runnable)} with no start callback. */ + public static void fire(View anchor, String moduleKey) { + fire(anchor, moduleKey, null); + } + /** * Re-fire the install of a single module that failed. Two gates, the same the wishlist drain uses: * the environment lock (something else owns the rootfs) and the system door (the box may run a * stopped-class op right now). Either refusal shows a busy snackbar on {@code anchor} and does - * nothing. + * nothing. K2GO-593: then the same mobile data question as "Install now", because a retry + * downloads again. * - * @return true if the retry was actually started (caller may navigate on that), false if a gate - * swallowed it or the inputs were null. + * @param onStarted run on the main thread once the retry really starts (the caller may navigate + * then); not run when a gate refuses or the user declines mobile data. */ - public static boolean fire(View anchor, String moduleKey) { - if (anchor == null || moduleKey == null) return false; + public static void fire(View anchor, String moduleKey, @Nullable Runnable onStarted) { + if (anchor == null || moduleKey == null) return; Context ctx = anchor.getContext(); if (EnvironmentLock.isHeld(ctx)) { Snackbars.make(anchor, BusyMessage.resFor(ctx)).show(); - return false; + return; } // ADFA-4898: ask the same door the wishlist drain asks before starting stopped-class runroles — // the box must be in a state that may run them (not NO_SYSTEM / DAMAGED / mid-op). This is the @@ -52,15 +63,37 @@ public static boolean fire(View anchor, String moduleKey) { // clean; and a single small file read on a deliberate tap is within the per-screen I/O budget. if (!OperationDispatcher.mayRunStopped(SystemDoor.dispatch(ctx, moduleKey))) { Snackbars.make(anchor, BusyMessage.resFor(ctx)).show(); - return false; + return; } // K2GO-430: a retry starts the install directly (not via openModuleIndex), so gate the dash-node // dependency here too. If the box dash-node is below the module's minimum, the gate shows the // "update the dashboard first" dialog and the retry does not fire. if (!org.appdevforall.k2go.dependency.presentation.DashNodeGate.allowInstall(ctx, moduleKey)) { - return false; + return; + } + final Runnable start = () -> { + // K2GO-588/593: the gate let this retry connect, also "Allow only this time" with Keep + // offline; record it as the start path does, so the run's download does not ask again. + org.appdevforall.k2go.networkpolicy.data.OnlineAllowance.allow("maps".equals(moduleKey) + ? org.appdevforall.k2go.system.domain.ContentType.MAPS.key() + : org.appdevforall.k2go.networkpolicy.data.OnlineAllowance.MODULES); + InstallService.retryModules(ctx, Collections.singletonList(moduleKey)); + if (onStarted != null) onStarted.run(); + }; + Activity act = activityOf(ctx); + if (act == null) { // no window to ask in: start only when no question is needed + if (org.appdevforall.k2go.networkpolicy.data.NetworkCostAdmission.allowsHeavyStartNow(ctx)) start.run(); + return; + } + NetworkPolicyGate.guardHeavyStart(act, start); + } + + @Nullable + private static Activity activityOf(Context ctx) { + while (ctx instanceof ContextWrapper) { + if (ctx instanceof Activity) return (Activity) ctx; + ctx = ((ContextWrapper) ctx).getBaseContext(); } - InstallService.retryModules(ctx, Collections.singletonList(moduleKey)); - return true; + return null; } } diff --git a/controller/app/src/main/java/org/appdevforall/k2go/redesign/SetupProgressActivity.java b/controller/app/src/main/java/org/appdevforall/k2go/redesign/SetupProgressActivity.java index d05950bb5..48c543bf3 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/redesign/SetupProgressActivity.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/redesign/SetupProgressActivity.java @@ -387,6 +387,13 @@ private boolean forgejoSeedInSession() { * short-circuit on isComplete would be wrong right after a Retry, which re-banks the marker while * the repository is still FAILED until the service reopens the session: that window must read as * active so the pipeline keeps tracking the retried seed instead of stopping the poll. */ + /** K2GO-593: the Forgejo role of this module run failed or was canceled, so its seed never + * starts. Read only in a module-install flow; a post-install seed run must not read a stale + * queue verdict. */ + private static boolean forgejoRoleFailedHere(boolean moduleShown) { + return moduleShown && ModuleQueueRepository.get().current().didFail("forgejo"); + } + private boolean forgejoSeedActive() { return org.appdevforall.k2go.forgejo.data.ForgejoInstallPrefs.isSeedPending(this) || org.appdevforall.k2go.forgejo.presentation.ForgejoSeedRepository.get().isRunning(); @@ -480,7 +487,7 @@ private void render() { // K2GO-423: the Forgejo seed row, after the content rows (the seed runs after the role). Shown // once it is imminent (module server up) or already has a session, so it does not sit as // "Queued" through the whole runrole while the module row already tells that story. - if (forgejoSeedInSession() + if (forgejoSeedInSession() && !forgejoRoleFailedHere(moduleShown) // K2GO-593: no seed follows then && (serverObservedUp() || postInstallSeed || org.appdevforall.k2go.forgejo.presentation.ForgejoSeedRepository.get().hasSession())) { sections.addView(forgejoSeedRow()); @@ -544,7 +551,7 @@ private void render() { && (moduleShown || postInstallSeed) // The forgejo runrole failing releases the gate ONLY in a module-install flow; a // post-install seed run (postInstallSeed) must not read a stale/unrelated queue verdict. - && !(moduleShown && mq.didFail("forgejo")); + && !forgejoRoleFailedHere(moduleShown); // ADFA-4900/4842: failed proot runroles count as failures too (Finish, not a false success). // On DONE the queue's failedModules covers maps + modules; before DONE, a start-timeout counts. // ADFA-4954: ModuleQueueRepository is process-scoped, so a DONE phase left by an @@ -589,9 +596,8 @@ private void render() { boolean moduleFlow = moduleInSession(); // ADFA-4898: the module batch reached its terminal with at least one runrole failed. The server // itself came up (so this is NOT moduleServerFailed), and a green "Adding your content" here read - // the failed batch as a clean success. Keep the SAME amber "installing" header it had before the - // failure — no new copy — and let the failure + Retry surface per-module below (hub pill + detail), - // not in this batch-level header. + // the failed batch as a clean success. K2GO-593: the amber header now says the install stopped + // (it said "installing" while nothing ran); the failure + Retry still surface per-module below. boolean moduleFailed = moduleFlow && prootFailed > 0; // Amber "working" while a module install runs, its post-DONE restart is pending, or the batch // ended with a failed module (kept on the same amber install line, never a green success). @@ -674,6 +680,7 @@ private int statusStringRes(SetupUiState.StatusMessage m) { case SLOW: return R.string.k2go_setup_slow; case STARTING: return R.string.k2go_setup_starting; case INSTALLING: return R.string.install_busy_modules; + case STOPPED: return R.string.k2go_setup_modules_stopped; // K2GO-593 case WAITING_FOR_NETWORK: return R.string.k2go_setup_waiting_network; // K2GO-408 case ADDING: default: return R.string.k2go_setup_adding; @@ -1108,14 +1115,16 @@ private View moduleRow(String key) { TextView sub = new TextView(this); sub.setTextAppearance(com.google.android.material.R.style.TextAppearance_Material3_BodySmall); String state; - if (failed) state = getString(R.string.k2go_mod_phase_failed); + boolean canceled = failed && mq.wasCanceled(key); // K2GO-593: a user stop is not an error + if (canceled) state = getString(R.string.k2go_mod_phase_canceled); + else if (failed) state = getString(R.string.k2go_mod_phase_failed); else if (done) state = getString(R.string.k2go_setup_state_done); else if (running) state = mq.percent >= 0 // ADFA-5228: show the % when determinate ? getString(R.string.k2go_mod_phase_installing) + " " + mq.percent + "%" : getString(R.string.k2go_mod_phase_installing); else state = getString(R.string.k2go_mod_phase_queued); sub.setText(state); - sub.setTextColor(ContextCompat.getColor(this, failed ? R.color.k2go_amber_text : R.color.k2go_muted)); + sub.setTextColor(ContextCompat.getColor(this, failed && !canceled ? R.color.k2go_amber_text : R.color.k2go_muted)); col.addView(sub); addRowProgressBar(col, mq, running); // ADFA-5228 row.addView(col, new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f)); @@ -1234,8 +1243,9 @@ private void retryForgejoSeed() { /** * ADFA-4898 P5: strong confirmation before cancelling a running module install, then send - * ACTION_CANCEL. The service kills the runrole (proot --kill-on-exit), rolls back the speculative - * flag and marks the module failed; the base system is untouched and the server restarts. + * ACTION_CANCEL. The service SIGKILLs the runrole proot, so the kernel ends its box processes + * (K2GO-593), rolls back the speculative flag and marks the module canceled; the base system is + * untouched and the server restarts. */ private void confirmCancelModule() { // K2GO-385: cancel-running-install confirm -> the shared BrandDialog (destructive). diff --git a/controller/app/src/main/java/org/appdevforall/k2go/setup/domain/SetupUiState.java b/controller/app/src/main/java/org/appdevforall/k2go/setup/domain/SetupUiState.java index 00f2c3ecf..7ebf5f16c 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/setup/domain/SetupUiState.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/setup/domain/SetupUiState.java @@ -19,7 +19,7 @@ public final class SetupUiState { public enum StatusTone { NEUTRAL, WAITING } /** The status line message (mapped to a string resource by the Activity). */ - public enum StatusMessage { STARTING, SLOW, ADDING, INSTALLING, WAITING_FOR_NETWORK } + public enum StatusMessage { STARTING, SLOW, ADDING, INSTALLING, WAITING_FOR_NETWORK, STOPPED } /** The bottom-controls mode (mapped to show()/scheduleRedirect()/cancelRedirect() by the Activity). */ /** FINISH_PARTIAL (K2GO-475): Finish plus a note, never the auto-redirect, so the user reads it. */ @@ -58,7 +58,7 @@ public static SetupUiState from(Inputs in) { if (in.batchServerSlow) message = StatusMessage.SLOW; // could not bring services up in time else if (in.batchServerSettling) message = StatusMessage.STARTING; // reconciler is (re)starting the server else if (in.moduleFlow && !in.batchServerUp) message = StatusMessage.INSTALLING; // runroles in flight - else if (in.moduleFailed) message = StatusMessage.INSTALLING; // keep the amber install header on a failed batch + else if (in.moduleFailed) message = StatusMessage.STOPPED; // K2GO-593: the batch ended; nothing installs now else if (in.moduleFlow) message = StatusMessage.ADDING; // module done + server up else if (!in.servicesReady) message = in.slowByPolls ? StatusMessage.SLOW : StatusMessage.STARTING; else message = StatusMessage.ADDING; @@ -70,7 +70,9 @@ public static SetupUiState from(Inputs in) { else if (in.failure) controls = Controls.FINISH_FAILURE; else controls = Controls.RUNNING; - return new SetupUiState(tone, message, amberWaiting, controls, in.runInBackgroundEnabled); + // K2GO-593: a stopped batch keeps the amber dot, but no animated dots: nothing runs now. + boolean animate = amberWaiting && message != StatusMessage.STOPPED; + return new SetupUiState(tone, message, animate, controls, in.runInBackgroundEnabled); } /** The inputs the rule reads, gathered by the Activity from its live sources. */ diff --git a/controller/app/src/main/res/values-ar/strings.xml b/controller/app/src/main/res/values-ar/strings.xml index f001366d8..0759814e4 100644 --- a/controller/app/src/main/res/values-ar/strings.xml +++ b/controller/app/src/main/res/values-ar/strings.xml @@ -1681,4 +1681,6 @@ لقد اخترت \"الإبقاء دون اتصال\". تُرسل الملاحظات باستخدام تطبيق آخر، مثل البريد الإلكتروني، ويمكن لهذا التطبيق الاتصال بالإنترنت. التطبيق مضبوط على \"الإبقاء دون اتصال\"، لذا تبقى هذه الخدمات متوقفة. لتغيير ذلك، فعّل \"%1$s\" في الإعدادات > حول. إرسال على أي حال + أُلغي + توقّف التثبيت. تحقّق من كل وحدة أدناه. diff --git a/controller/app/src/main/res/values-az/strings.xml b/controller/app/src/main/res/values-az/strings.xml index 172ff0ed8..a4901ad11 100644 --- a/controller/app/src/main/res/values-az/strings.xml +++ b/controller/app/src/main/res/values-az/strings.xml @@ -1697,4 +1697,6 @@ \"Oflayn saxla\" seçimini etdiniz. Rəy başqa tətbiqlə, məsələn e-poçtla göndərilir və həmin tətbiq internetə qoşula bilər. Tətbiq \"Oflayn saxla\" rejimindədir, ona görə bu xidmətlər söndürülmüş qalır. Bunu dəyişmək üçün Ayarlar > Haqqında bölməsində \"%1$s\" seçimini aktiv edin. Yenə də göndər + Ləğv edildi + Quraşdırma dayandı. Aşağıda hər modulu yoxlayın. diff --git a/controller/app/src/main/res/values-bg/strings.xml b/controller/app/src/main/res/values-bg/strings.xml index 282d8e56f..3de1e4e97 100644 --- a/controller/app/src/main/res/values-bg/strings.xml +++ b/controller/app/src/main/res/values-bg/strings.xml @@ -1684,4 +1684,6 @@ Избрахте \"Само офлайн\". Обратната връзка се изпраща с друго приложение, например имейл, и то може да се свърже с интернет. Приложението е настроено на \"Само офлайн\", затова тези услуги остават изключени. За да промените това, включете \"%1$s\" в Настройки > Относно. Изпрати въпреки това + Отменено + Инсталирането спря. Проверете всеки модул по-долу. diff --git a/controller/app/src/main/res/values-bn/strings.xml b/controller/app/src/main/res/values-bn/strings.xml index cb30bbbf2..d9764843a 100644 --- a/controller/app/src/main/res/values-bn/strings.xml +++ b/controller/app/src/main/res/values-bn/strings.xml @@ -1690,4 +1690,6 @@ আপনি \"অফলাইন রাখুন\" বেছে নিয়েছেন। মতামত অন্য একটি অ্যাপ দিয়ে পাঠানো হয়, যেমন ইমেল, এবং সেই অ্যাপটি ইন্টারনেটে সংযুক্ত হতে পারে। অ্যাপটি \"অফলাইন রাখুন\"-এ সেট করা আছে, তাই এই পরিষেবাগুলো বন্ধ থাকে। এটি বদলাতে, সেটিংস > সম্পর্কে-তে \"%1$s\" চালু করুন। তবুও পাঠান + বাতিল করা হয়েছে + ইনস্টল বন্ধ হয়েছে। নিচে প্রতিটি মডিউল দেখুন। diff --git a/controller/app/src/main/res/values-cs/strings.xml b/controller/app/src/main/res/values-cs/strings.xml index 47b105fba..83dddf47c 100644 --- a/controller/app/src/main/res/values-cs/strings.xml +++ b/controller/app/src/main/res/values-cs/strings.xml @@ -1686,4 +1686,6 @@ Zvolili jste \"Ponechat offline\". Zpětná vazba se odesílá jinou aplikací, například e-mailem, a tato aplikace se může připojit k internetu. Aplikace je nastavena na \"Ponechat offline\", proto tyto služby zůstávají vypnuté. Chcete-li to změnit, zapněte \"%1$s\" v Nastavení > O aplikaci. Přesto odeslat + Zrušeno + Instalace se zastavila. Zkontrolujte níže každý modul. diff --git a/controller/app/src/main/res/values-de/strings.xml b/controller/app/src/main/res/values-de/strings.xml index d1ae746b1..96658c9d0 100644 --- a/controller/app/src/main/res/values-de/strings.xml +++ b/controller/app/src/main/res/values-de/strings.xml @@ -1677,4 +1677,6 @@ Du hast \"Offline behalten\" gewählt. Feedback wird mit einer anderen App gesendet, zum Beispiel E-Mail, und diese App kann sich mit dem Internet verbinden. Die App ist auf \"Offline behalten\" eingestellt, daher bleiben diese Dienste aus. Um das zu ändern, aktiviere \"%1$s\" unter Einstellungen > Über. Trotzdem senden + Abgebrochen + Die Installation wurde beendet. Prüfen Sie unten jedes Modul. diff --git a/controller/app/src/main/res/values-el/strings.xml b/controller/app/src/main/res/values-el/strings.xml index c71e1b12b..50c8537f5 100644 --- a/controller/app/src/main/res/values-el/strings.xml +++ b/controller/app/src/main/res/values-el/strings.xml @@ -1684,4 +1684,6 @@ Επιλέξατε \"Διατήρηση εκτός σύνδεσης\". Τα σχόλια στέλνονται με άλλη εφαρμογή, για παράδειγμα το email, και αυτή η εφαρμογή μπορεί να συνδεθεί στο διαδίκτυο. Η εφαρμογή έχει ρυθμιστεί σε \"Διατήρηση εκτός σύνδεσης\", οπότε αυτές οι υπηρεσίες παραμένουν απενεργοποιημένες. Για να το αλλάξετε, ενεργοποιήστε το \"%1$s\" στις Ρυθμίσεις > Σχετικά. Αποστολή ούτως ή άλλως + Ακυρώθηκε + Η εγκατάσταση σταμάτησε. Ελέγξτε παρακάτω κάθε module. diff --git a/controller/app/src/main/res/values-es/strings.xml b/controller/app/src/main/res/values-es/strings.xml index 23c324c56..4a4bd3f2e 100644 --- a/controller/app/src/main/res/values-es/strings.xml +++ b/controller/app/src/main/res/values-es/strings.xml @@ -1754,4 +1754,6 @@ Elegiste \"Mantener sin conexión\". Los comentarios se envían con otra app, por ejemplo el correo, y esa app puede conectarse a internet. La app está configurada en \"Mantener sin conexión\", así que estos servicios siguen apagados. Para cambiarlo, activa \"%1$s\" en Ajustes > Acerca de. Enviar de todos modos + Cancelado + La instalación se detuvo. Revise cada módulo abajo. diff --git a/controller/app/src/main/res/values-fa/strings.xml b/controller/app/src/main/res/values-fa/strings.xml index d82aca277..91891a368 100644 --- a/controller/app/src/main/res/values-fa/strings.xml +++ b/controller/app/src/main/res/values-fa/strings.xml @@ -1677,4 +1677,6 @@ شما \"آفلاین بماند\" را انتخاب کرده‌اید. بازخورد با برنامه دیگری فرستاده می‌شود، مثلاً ایمیل، و آن برنامه می‌تواند به اینترنت وصل شود. برنامه روی \"آفلاین بماند\" تنظیم شده است، پس این سرویس‌ها خاموش می‌مانند. برای تغییر آن، \"%1$s\" را در تنظیمات > درباره روشن کنید. به هر حال ارسال شود + لغو شد + نصب متوقف شد. هر ماژول را در پایین بررسی کنید. diff --git a/controller/app/src/main/res/values-fr/strings.xml b/controller/app/src/main/res/values-fr/strings.xml index bfad41487..d9da2d0f1 100644 --- a/controller/app/src/main/res/values-fr/strings.xml +++ b/controller/app/src/main/res/values-fr/strings.xml @@ -1765,4 +1765,6 @@ Vous avez choisi \"Rester hors ligne\". Les commentaires sont envoyés avec une autre application, par exemple la messagerie, et cette application peut se connecter à Internet. L\'application est réglée sur \"Rester hors ligne\", ces services restent donc désactivés. Pour changer cela, activez \"%1$s\" dans Paramètres > À propos. Envoyer quand même + Annulé + L\'installation s\'est arrêtée. Vérifiez chaque module ci-dessous. diff --git a/controller/app/src/main/res/values-gu/strings.xml b/controller/app/src/main/res/values-gu/strings.xml index 78e1b930d..a07edf50f 100644 --- a/controller/app/src/main/res/values-gu/strings.xml +++ b/controller/app/src/main/res/values-gu/strings.xml @@ -1690,4 +1690,6 @@ તમે \"ઑફલાઇન રાખો\" પસંદ કર્યું છે. પ્રતિસાદ બીજી ઍપથી મોકલવામાં આવે છે, જેમ કે ઇમેઇલ, અને તે ઍપ ઇન્ટરનેટ સાથે કનેક્ટ થઈ શકે છે. ઍપ \"ઑફલાઇન રાખો\" પર સેટ છે, તેથી આ સેવાઓ બંધ રહે છે. તેને બદલવા માટે, સેટિંગ્સ > વિશે માં \"%1$s\" ચાલુ કરો. છતાં મોકલો + રદ કર્યું + ઇન્સ્ટૉલ અટકી ગયું. નીચે દરેક મૉડ્યુલ તપાસો. diff --git a/controller/app/src/main/res/values-hi/strings.xml b/controller/app/src/main/res/values-hi/strings.xml index 9792a4e7e..8a864ee03 100644 --- a/controller/app/src/main/res/values-hi/strings.xml +++ b/controller/app/src/main/res/values-hi/strings.xml @@ -1754,4 +1754,6 @@ आपने \"ऑफ़लाइन रखें\" चुना है। फ़ीडबैक किसी दूसरे ऐप से भेजा जाता है, जैसे ईमेल, और वह ऐप इंटरनेट से कनेक्ट हो सकता है। ऐप \"ऑफ़लाइन रखें\" पर सेट है, इसलिए ये सेवाएँ बंद रहती हैं। इसे बदलने के लिए, सेटिंग्स > परिचय में \"%1$s\" चालू करें। फिर भी भेजें + रद्द किया गया + इंस्टॉल रुक गया। नीचे हर मॉड्यूल देखें। diff --git a/controller/app/src/main/res/values-hu/strings.xml b/controller/app/src/main/res/values-hu/strings.xml index 170e973ed..f9bdb2287 100644 --- a/controller/app/src/main/res/values-hu/strings.xml +++ b/controller/app/src/main/res/values-hu/strings.xml @@ -1677,4 +1677,6 @@ A \"Marad offline\" lehetőséget választottad. A visszajelzést egy másik alkalmazás küldi el, például az e-mail, és ez az alkalmazás csatlakozhat az internethez. Az alkalmazás \"Marad offline\" módra van állítva, ezért ezek a szolgáltatások kikapcsolva maradnak. A módosításhoz kapcsold be a(z) \"%1$s\" beállítást itt: Beállítások > Névjegy. Küldés mégis + Megszakítva + A telepítés leállt. Alább ellenőrizze az egyes modulokat. diff --git a/controller/app/src/main/res/values-in/strings.xml b/controller/app/src/main/res/values-in/strings.xml index eb6c7f5a9..447a8eb4d 100644 --- a/controller/app/src/main/res/values-in/strings.xml +++ b/controller/app/src/main/res/values-in/strings.xml @@ -1683,4 +1683,6 @@ Anda memilih \"Tetap luring\". Masukan dikirim dengan aplikasi lain, misalnya email, dan aplikasi itu dapat terhubung ke internet. Aplikasi diatur ke \"Tetap luring\", jadi layanan ini tetap mati. Untuk mengubahnya, aktifkan \"%1$s\" di Setelan > Tentang. Tetap kirim + Dibatalkan + Pemasangan berhenti. Periksa setiap modul di bawah. diff --git a/controller/app/src/main/res/values-it/strings.xml b/controller/app/src/main/res/values-it/strings.xml index aa4497985..3c8554733 100644 --- a/controller/app/src/main/res/values-it/strings.xml +++ b/controller/app/src/main/res/values-it/strings.xml @@ -1678,4 +1678,6 @@ Hai scelto \"Mantieni offline\". Il feedback viene inviato con un\'altra app, per esempio l\'email, e quell\'app può connettersi a internet. L\'app è impostata su \"Mantieni offline\", quindi questi servizi restano spenti. Per cambiarlo, attiva \"%1$s\" in Impostazioni > Informazioni. Invia comunque + Annullata + L\'installazione si è interrotta. Controlla ogni modulo qui sotto. diff --git a/controller/app/src/main/res/values-ja/strings.xml b/controller/app/src/main/res/values-ja/strings.xml index 286ae26ed..e0cb77ba3 100644 --- a/controller/app/src/main/res/values-ja/strings.xml +++ b/controller/app/src/main/res/values-ja/strings.xml @@ -1677,4 +1677,6 @@ 「オフラインのまま」を選択しています。フィードバックは別のアプリ(例: メール)で送信され、そのアプリはインターネットに接続する場合があります。 アプリは「オフラインのまま」に設定されているため、これらのサービスはオフのままです。変更するには、設定 > 情報で\"%1$s\"をオンにしてください。 このまま送信 + キャンセルしました + インストールが停止しました。下の各モジュールを確認してください。 diff --git a/controller/app/src/main/res/values-ko/strings.xml b/controller/app/src/main/res/values-ko/strings.xml index 5a65293f8..42030e955 100644 --- a/controller/app/src/main/res/values-ko/strings.xml +++ b/controller/app/src/main/res/values-ko/strings.xml @@ -1677,4 +1677,6 @@ \"오프라인 유지\"를 선택했습니다. 피드백은 다른 앱(예: 이메일)으로 보내지며, 그 앱은 인터넷에 연결될 수 있습니다. 앱이 \"오프라인 유지\"로 설정되어 있어 이 서비스들은 꺼진 상태로 유지됩니다. 변경하려면 설정 > 정보에서 \"%1$s\"을(를) 켜세요. 그래도 보내기 + 취소됨 + 설치가 중지되었습니다. 아래에서 각 모듈을 확인하세요. diff --git a/controller/app/src/main/res/values-lt/strings.xml b/controller/app/src/main/res/values-lt/strings.xml index 8b0dc54b3..1ce4c2c33 100644 --- a/controller/app/src/main/res/values-lt/strings.xml +++ b/controller/app/src/main/res/values-lt/strings.xml @@ -1696,4 +1696,6 @@ Pasirinkote „Palikti neprisijungus“. Atsiliepimai siunčiami kita programa, pavyzdžiui, el. paštu, ir ta programa gali prisijungti prie interneto. Programoje nustatyta „Palikti neprisijungus“, todėl šios paslaugos lieka išjungtos. Norėdami tai pakeisti, įjunkite \"%1$s\" skiltyje Nustatymai > Apie. Vis tiek siųsti + Atšaukta + Diegimas sustojo. Patikrinkite kiekvieną modulį žemiau. diff --git a/controller/app/src/main/res/values-nl/strings.xml b/controller/app/src/main/res/values-nl/strings.xml index 8c16e44f2..5a5febbd4 100644 --- a/controller/app/src/main/res/values-nl/strings.xml +++ b/controller/app/src/main/res/values-nl/strings.xml @@ -1677,4 +1677,6 @@ Je hebt \"Offline houden\" gekozen. Feedback wordt verzonden met een andere app, bijvoorbeeld e-mail, en die app kan verbinding maken met internet. De app staat op \"Offline houden\", dus deze diensten blijven uit. Zet \"%1$s\" aan in Instellingen > Over om dit te wijzigen. Toch verzenden + Geannuleerd + De installatie is gestopt. Controleer hieronder elke module. diff --git a/controller/app/src/main/res/values-no/strings.xml b/controller/app/src/main/res/values-no/strings.xml index 5bc28da18..7b49dde36 100644 --- a/controller/app/src/main/res/values-no/strings.xml +++ b/controller/app/src/main/res/values-no/strings.xml @@ -1687,4 +1687,6 @@ Du valgte \"Hold offline\". Tilbakemeldinger sendes med en annen app, for eksempel e-post, og den appen kan koble til internett. Appen er satt til \"Hold offline\", så disse tjenestene forblir av. For å endre det, slå på \"%1$s\" i Innstillinger > Om. Send likevel + Avbrutt + Installasjonen stoppet. Sjekk hver modul nedenfor. diff --git a/controller/app/src/main/res/values-pl/strings.xml b/controller/app/src/main/res/values-pl/strings.xml index a76493952..06e67f40d 100644 --- a/controller/app/src/main/res/values-pl/strings.xml +++ b/controller/app/src/main/res/values-pl/strings.xml @@ -1689,4 +1689,6 @@ Wybrano \"Zachowaj offline\". Opinia jest wysyłana inną aplikacją, na przykład pocztą e-mail, a ta aplikacja może połączyć się z internetem. Aplikacja ma ustawienie \"Zachowaj offline\", więc te usługi pozostają wyłączone. Aby to zmienić, włącz \"%1$s\" w Ustawienia > Informacje. Wyślij mimo to + Anulowano + Instalacja została zatrzymana. Sprawdź poniżej każdy moduł. diff --git a/controller/app/src/main/res/values-pt/strings.xml b/controller/app/src/main/res/values-pt/strings.xml index 73827bbfa..71db19089 100644 --- a/controller/app/src/main/res/values-pt/strings.xml +++ b/controller/app/src/main/res/values-pt/strings.xml @@ -1757,4 +1757,6 @@ Escolheu \"Manter offline\". Os comentários são enviados com outra aplicação, por exemplo o email, e essa aplicação pode ligar-se à internet. A aplicação está definida como \"Manter offline\", por isso estes serviços ficam desligados. Para alterar, ative \"%1$s\" em Definições > Acerca. Enviar mesmo assim + Cancelado + A instalação parou. Verifique cada módulo abaixo. diff --git a/controller/app/src/main/res/values-ro/strings.xml b/controller/app/src/main/res/values-ro/strings.xml index 18d4d8bcb..50814a7d0 100644 --- a/controller/app/src/main/res/values-ro/strings.xml +++ b/controller/app/src/main/res/values-ro/strings.xml @@ -1678,4 +1678,6 @@ Ai ales \"Păstrează offline\". Feedbackul este trimis cu altă aplicație, de exemplu e-mailul, iar acea aplicație se poate conecta la internet. Aplicația este setată pe \"Păstrează offline\", deci aceste servicii rămân oprite. Pentru a schimba, activează \"%1$s\" în Setări > Despre. Trimite oricum + Anulată + Instalarea s-a oprit. Verifică fiecare modul de mai jos. diff --git a/controller/app/src/main/res/values-ru-rRU/strings.xml b/controller/app/src/main/res/values-ru-rRU/strings.xml index d782266ec..5a2d4a6aa 100644 --- a/controller/app/src/main/res/values-ru-rRU/strings.xml +++ b/controller/app/src/main/res/values-ru-rRU/strings.xml @@ -1755,4 +1755,6 @@ Вы выбрали \"Оставить офлайн\". Отзыв отправляется через другое приложение, например почту, и это приложение может подключиться к интернету. В приложении выбрано \"Оставить офлайн\", поэтому эти службы остаются выключенными. Чтобы изменить это, включите \"%1$s\" в разделе Настройки > О приложении. Всё равно отправить + Отменено + Установка остановлена. Проверьте каждый модуль ниже. diff --git a/controller/app/src/main/res/values-sk/strings.xml b/controller/app/src/main/res/values-sk/strings.xml index d22e23d42..9eb2aa1e5 100644 --- a/controller/app/src/main/res/values-sk/strings.xml +++ b/controller/app/src/main/res/values-sk/strings.xml @@ -1686,4 +1686,6 @@ Zvolili ste \"Ponechať offline\". Spätná väzba sa odosiela inou aplikáciou, napríklad e-mailom, a táto aplikácia sa môže pripojiť k internetu. Aplikácia je nastavená na \"Ponechať offline\", preto tieto služby zostávajú vypnuté. Ak to chcete zmeniť, zapnite \"%1$s\" v Nastavenia > O aplikácii. Napriek tomu odoslať + Zrušené + Inštalácia sa zastavila. Skontrolujte nižšie každý modul. diff --git a/controller/app/src/main/res/values-sr/strings.xml b/controller/app/src/main/res/values-sr/strings.xml index 3023cc653..9f3d09dd4 100644 --- a/controller/app/src/main/res/values-sr/strings.xml +++ b/controller/app/src/main/res/values-sr/strings.xml @@ -1691,4 +1691,6 @@ Изабрали сте \"Задржи офлајн\". Повратне информације се шаљу другом апликацијом, на пример имејлом, и та апликација може да се повеже на интернет. Апликација је подешена на \"Задржи офлајн\", па ове услуге остају искључене. Да бисте то променили, укључите \"%1$s\" у Подешавања > О апликацији. Ипак пошаљи + Отказано + Инсталација је заустављена. Проверите сваки модул испод. diff --git a/controller/app/src/main/res/values-sw/strings.xml b/controller/app/src/main/res/values-sw/strings.xml index 302503ff5..ad3b3ef63 100644 --- a/controller/app/src/main/res/values-sw/strings.xml +++ b/controller/app/src/main/res/values-sw/strings.xml @@ -1697,4 +1697,6 @@ Ulichagua \"Weka nje ya mtandao\". Maoni hutumwa kwa programu nyingine, kwa mfano barua pepe, na programu hiyo inaweza kuunganishwa kwenye intaneti. Programu imewekwa kwenye \"Weka nje ya mtandao\", kwa hivyo huduma hizi zinabaki zimezimwa. Ili kubadilisha, washa \"%1$s\" katika Mipangilio > Kuhusu. Tuma hata hivyo + Imeghairiwa + Usakinishaji umesimama. Kagua kila moduli hapa chini. diff --git a/controller/app/src/main/res/values-ta/strings.xml b/controller/app/src/main/res/values-ta/strings.xml index e402c32ef..48f2b45b8 100644 --- a/controller/app/src/main/res/values-ta/strings.xml +++ b/controller/app/src/main/res/values-ta/strings.xml @@ -1697,4 +1697,6 @@ நீங்கள் \"ஆஃப்லைனில் வைக்கவும்\" என்பதைத் தேர்ந்தெடுத்துள்ளீர்கள். கருத்து வேறொரு பயன்பாட்டின் மூலம் அனுப்பப்படும், எடுத்துக்காட்டாக மின்னஞ்சல், அந்தப் பயன்பாடு இணையத்துடன் இணையலாம். பயன்பாடு \"ஆஃப்லைனில் வைக்கவும்\" என அமைக்கப்பட்டுள்ளது, எனவே இந்தச் சேவைகள் முடக்கத்தில் இருக்கும். இதை மாற்ற, அமைப்புகள் > பற்றி என்பதில் \"%1$s\" ஐ இயக்கவும். இருந்தாலும் அனுப்பு + ரத்துசெய்யப்பட்டது + நிறுவல் நின்றது. கீழே ஒவ்வொரு தொகுதியையும் சரிபார்க்கவும். diff --git a/controller/app/src/main/res/values-tr/strings.xml b/controller/app/src/main/res/values-tr/strings.xml index 969872bf5..b97c4be35 100644 --- a/controller/app/src/main/res/values-tr/strings.xml +++ b/controller/app/src/main/res/values-tr/strings.xml @@ -1677,4 +1677,6 @@ \"Çevrimdışı tut\" seçeneğini seçtiniz. Geri bildirim başka bir uygulamayla, örneğin e-postayla gönderilir ve bu uygulama internete bağlanabilir. Uygulama \"Çevrimdışı tut\" olarak ayarlı, bu yüzden bu hizmetler kapalı kalır. Bunu değiştirmek için Ayarlar > Hakkında bölümünde \"%1$s\" seçeneğini açın. Yine de gönder + İptal edildi + Kurulum durdu. Aşağıdaki her modülü kontrol edin. diff --git a/controller/app/src/main/res/values-uk/strings.xml b/controller/app/src/main/res/values-uk/strings.xml index a439e0755..d4ecec314 100644 --- a/controller/app/src/main/res/values-uk/strings.xml +++ b/controller/app/src/main/res/values-uk/strings.xml @@ -1679,4 +1679,6 @@ Ви вибрали \"Залишити офлайн\". Відгук надсилається через інший застосунок, наприклад пошту, і цей застосунок може підключитися до інтернету. У застосунку вибрано \"Залишити офлайн\", тому ці служби залишаються вимкненими. Щоб змінити це, увімкніть \"%1$s\" у розділі Налаштування > Про застосунок. Усе одно надіслати + Скасовано + Встановлення зупинилося. Перевірте кожен модуль нижче. diff --git a/controller/app/src/main/res/values-vi/strings.xml b/controller/app/src/main/res/values-vi/strings.xml index 14865cbb2..b7ae4f0ee 100644 --- a/controller/app/src/main/res/values-vi/strings.xml +++ b/controller/app/src/main/res/values-vi/strings.xml @@ -1676,4 +1676,6 @@ Bạn đã chọn \"Giữ ngoại tuyến\". Phản hồi được gửi bằng ứng dụng khác, ví dụ email, và ứng dụng đó có thể kết nối internet. Ứng dụng đang đặt ở chế độ \"Giữ ngoại tuyến\", nên các dịch vụ này vẫn tắt. Để thay đổi, hãy bật \"%1$s\" trong Cài đặt > Giới thiệu. Vẫn gửi + Đã hủy + Quá trình cài đặt đã dừng. Hãy kiểm tra từng mô-đun bên dưới. diff --git a/controller/app/src/main/res/values-yo/strings.xml b/controller/app/src/main/res/values-yo/strings.xml index ae4829bc2..c722e3ebb 100644 --- a/controller/app/src/main/res/values-yo/strings.xml +++ b/controller/app/src/main/res/values-yo/strings.xml @@ -1696,4 +1696,6 @@ O yan \"Pa á mọ́ àìsí-íńtánẹ́ẹ̀tì\". A ń fi èsì ránṣẹ́ pẹ̀lú ìṣàmúlò mìíràn, fún àpẹẹrẹ ímeèlì, ìṣàmúlò náà sì lè sopọ̀ mọ́ íńtánẹ́ẹ̀tì. A ṣètò ìṣàmúlò sí \"Pa á mọ́ àìsí-íńtánẹ́ẹ̀tì\", nítorí náà àwọn iṣẹ́ wọ̀nyí wà ní pípa. Láti yí i padà, tan \"%1$s\" ní Ìtòlẹ́sẹẹsẹ > Nípa. Fi ránṣẹ́ bó ti wù kó rí + Ti fagilé + Fífi sórí ẹ̀rọ ti dúró. Ṣàyẹ̀wò módù kọ̀ọ̀kan nísàlẹ̀. diff --git a/controller/app/src/main/res/values-zh-rCN/strings.xml b/controller/app/src/main/res/values-zh-rCN/strings.xml index 90416c214..b10dcf561 100644 --- a/controller/app/src/main/res/values-zh-rCN/strings.xml +++ b/controller/app/src/main/res/values-zh-rCN/strings.xml @@ -1677,4 +1677,6 @@ 您选择了“保持离线”。反馈会通过其他应用(例如电子邮件)发送,该应用可能会连接到互联网。 应用已设为“保持离线”,因此这些服务保持关闭。如需更改,请在 设置 > 关于 中开启\"%1$s\"。 仍然发送 + 已取消 + 安装已停止。请检查下方的每个模块。 diff --git a/controller/app/src/main/res/values/strings.xml b/controller/app/src/main/res/values/strings.xml index b0e327532..6424e724f 100644 --- a/controller/app/src/main/res/values/strings.xml +++ b/controller/app/src/main/res/values/strings.xml @@ -1885,4 +1885,8 @@ You chose Keep offline. Feedback is sent with another app, for example email, and that app can connect to the internet. The app is set to Keep offline, so these services stay off. To change it, turn on \"%1$s\" in Settings > About. Send anyway + + Canceled + + The install stopped. Check each module below. diff --git a/controller/app/src/test/java/org/appdevforall/k2go/install/presentation/ModuleQueueStateTest.java b/controller/app/src/test/java/org/appdevforall/k2go/install/presentation/ModuleQueueStateTest.java new file mode 100644 index 000000000..90947052e --- /dev/null +++ b/controller/app/src/test/java/org/appdevforall/k2go/install/presentation/ModuleQueueStateTest.java @@ -0,0 +1,61 @@ +/* + * ============================================================================ + * Name : ModuleQueueStateTest.java + * Author : AppDevForAll + * Copyright : Copyright (c) 2026 AppDevForAll + * Description : K2GO-593. A user Cancel ends the batch with the module in the + * failed list (Retry stays offered) and marked as canceled, so + * the UI can tell a user stop from an error. + * ============================================================================ + */ +package org.appdevforall.k2go.install.presentation; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.Collections; + +import org.junit.Test; + +public class ModuleQueueStateTest { + + @Test + public void canceledModuleIsFailedAndCanceled() { + ModuleQueueState st = ModuleQueueState.done(Collections.singletonList("forgejo"), "forgejo"); + assertTrue(st.didFail("forgejo")); + assertTrue(st.wasCanceled("forgejo")); + assertTrue(st.hasFailures()); + } + + @Test + public void realFailureIsNotCanceled() { + ModuleQueueState st = ModuleQueueState.done(Collections.singletonList("forgejo")); + assertTrue(st.didFail("forgejo")); + assertFalse(st.wasCanceled("forgejo")); + assertNull(st.canceledModule); + } + + @Test + public void onlyTheCanceledModuleReadsCanceled() { + ModuleQueueState st = ModuleQueueState.done(Arrays.asList("matomo", "forgejo"), "forgejo"); + assertTrue(st.didFail("matomo")); + assertFalse(st.wasCanceled("matomo")); + assertTrue(st.wasCanceled("forgejo")); + } + + @Test + public void canceledOnlyMeansSomethingOnDone() { + assertFalse(ModuleQueueState.running("forgejo", 0).wasCanceled("forgejo")); + assertFalse(ModuleQueueState.idle().wasCanceled("forgejo")); + } + + @Test + public void sequenceKeepsTheCanceledModule() { + ModuleQueueState st = ModuleQueueState.done(Collections.singletonList("forgejo"), "forgejo").withSeq(7L); + assertEquals(7L, st.seq); + assertTrue(st.wasCanceled("forgejo")); + } +} diff --git a/controller/app/src/test/java/org/appdevforall/k2go/setup/domain/SetupUiStateTest.java b/controller/app/src/test/java/org/appdevforall/k2go/setup/domain/SetupUiStateTest.java index 4db575f62..e2e1fb141 100644 --- a/controller/app/src/test/java/org/appdevforall/k2go/setup/domain/SetupUiStateTest.java +++ b/controller/app/src/test/java/org/appdevforall/k2go/setup/domain/SetupUiStateTest.java @@ -61,9 +61,19 @@ public void moduleInFlightShowsInstalling() { } @Test - public void failedModuleKeepsInstallingHeader() { + public void failedModuleShowsStoppedHeader() { + // K2GO-593: the batch ended (server up again); "installing" would say work still runs. SetupUiState ui = new SetupUiState.Inputs() .moduleFlow(true).batchServerUp(true).moduleFailed(true).build(); + assertEquals(SetupUiState.StatusMessage.STOPPED, ui.message); + assertEquals(SetupUiState.StatusTone.WAITING, ui.tone); + assertFalse(ui.animate); // nothing runs, so no animated dots + } + + @Test + public void failedModuleBeforeServerUpStillInstalling() { + SetupUiState ui = new SetupUiState.Inputs() + .moduleFlow(true).batchServerUp(false).moduleFailed(true).build(); assertEquals(SetupUiState.StatusMessage.INSTALLING, ui.message); }