Repository navigation
K2GO-588 feat(privacy): with Keep offline, actions ask once, box services stay off, catalogs follow the choice - #814
Merged
Conversation
…nternet asks to allow it once The gate shows Keep offline (primary) and Allow only this time. Nothing is stored, so the next action asks again. A ZIM, Books or Kolibri order is banked only after an allow or a metered decline, so a later drain never connects for an order the user kept offline. Controls that need the internet look grey but stay tappable (wizard, Get More confirms, check for updates).
…online choice is on Brings back the ADR-5094 / K2GO-390 refresh: weekly plus a TTL-gated check on open, Wi-Fi only, ETag conditional GET, failure backoff. With Keep offline the jobs are cancelled, and the worker reads the choice when it runs, so a queued job does not connect. The forced check on a download 404 stays, because it is part of the download the user started. The Update catalogs row is removed.
…and their switches are locked KeepBoxOfflineUseCase sets off every installed service that reports outbound on. It runs at app open, before the pending restarts apply, and when the Privacy screen loads. The box keeps the state in each service config, so the app keeps no copy. The locked switches tell where to change the choice.
…othing and the button warns first The Settings feedback screen disables Send and Test crash report and says where to change the choice. The feedback button looks grey; a tap tells that the app the user picks to send the report can connect, then continues or cancels.
…anked; more controls look grey The gate banked a ZIM or Books order when there was no network, so a later drain could connect for an order the user never allowed. Rebuild and the module update actions now also look grey while the app is kept offline.
…cales Machine translation for review. The parked strings move from strings_untranslated.xml to strings.xml.
…edback buttons explain on tap The feedback button warning now says that this can connect to the internet, with Keep offline as the primary choice and Send anyway as the other. On the Send feedback screen, Send and Test crash report look grey but stay tappable: a tap tells why and where to change the choice. Translated to all locales.
…d translations are not cut
…left unused 34 strings in all 34 strings.xml files (the old consent screen, the legacy setup and about screens, the Update catalogs row) and 2 drawables. Found with lint UnusedResources against main; no other reference in any flavor.
…erated assets The merge brings main (K2GO-552). help.db, module_sizes.csv and rootfs_sizes.csv are generated by the build and came into an earlier commit of this branch by mistake. They are now the same as in main.
This was referenced Nov 22, 2026
Merged
The Settings toggle keeps both changes: OnlineChoiceEffects applies the choice, and the controls that need the internet are marked again.
- OnlineAllowance answers "may a saved order of this kind connect now": the choice is on, or the user allowed that kind at its commit point in this process. Every hasPending (ZIM, books, courses, maps, modules) and ContentAdmission read it, so a wishlist saved before Keep offline, by the wizard, or as a refused module no longer drains with no prompt. Pending downloads still lists it. - After "Allow only this time", a metered "Not now" or no network keeps the order offline (nothing saved), as Keep offline does. - The commit points (ZIM, books, Kolibri, maps, modules, wizard install) record the allow.
…ck rule - The proot dash-node rebuild (older boxes) goes through the gate too. - The dashboard Rebuild button keeps its grey look when its status loads. - Every hand-off of feedback to another app (the floating button, the disk-guard report, the dash-node update failure, an install failure) shows the Keep offline warning in one place, sendFeedback.
… catalog jobs now - OnlineChoiceEffects.apply also re-syncs the catalog jobs (one static entry per catalog owner; the Kolibri one runs once per process) and, on Keep offline, switches every outbound box service off and restarts only those. - KeepBoxOfflineUseCase tries every service; a failure no longer skips the others or the pending restarts at app open. - The locked Privacy switch has no click listener, so a tap on it shows the note.
…s the session allows - The wizard install also allows maps, which the wizard can bank. - Turning on Keep offline clears every allow of the session, so a queued order waits instead of draining. - At Keep offline, one failed service restart no longer stops the others.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
With the one privacy choice off ("Keep offline", PR 1), the app and the box do not connect on their own. This PR makes the rest of that real:
NetworkPolicyGateshows "This needs the internet" with Keep offline (primary) and Allow only this time. Nothing is stored: the next action asks again. After an allow, the metered-data check runs as before.guardOrder(...)gives these callers a separateonKeptOfflinepath.KeepBoxOfflineUseCasesets off every box service that reports outbound on (Kolibri, Forgejo). It runs at app open (before the pending restarts apply) and when the Privacy screen loads. The switches are locked; a tap tells where to change the choice (Settings > About).util/Snackbars), so long messages and translations are not cut at the Material default of 2.Why
K2GO-588: "Keep offline" must mean real network silence for the app and the box, with a clear way to allow one action.
Steps to QA
adb shell dumpsys jobscheduler | grep catalog-refreshshows the weekly jobs. With Keep offline at the next launch they are gone.Verifications
:app:lintStandardDebug,:app:testStandardDebugUnitTest,:app:assembleStandardDebug,:app:compileFdroidDebugJavaWithJavac: pass.KeepBoxOfflineUseCaseTest(3 cases).OnlineConsentstays the one source; the box keeps its own state in each service config; the catalog jobs and the box switches have an owner that sets and clears them.catalog-refresh-kiwixENQUEUED (UNMETERED, 7 days) and the check now SUCCEEDED. Choice off + picker: the weekly job is CANCELLED.k2go_zim_wishlistempty and the pick in the selection; Allow only this time banks it and startsZimDownloadService.main(lint of both flavors, unit tests, APK and F-Droid compile pass):mainbuild, Kolibri usage statistics and Forgejo update check were turned on (/k2go-api/system/privacy:outbound:true,pending:true). This build was installed over it without a data clear. At the first app open:outbound:falsefor both,pending:false.UI changes
New strings (translated to all 33 locales, machine translation for review):
Removed: the "Update catalogs" row (button and status line) in Get More.
Light and dark: verified on device.
Notes
feat/K2GO-588-one-privacy-choice). Retarget tomainafter K2GO-588 feat(privacy): one choice for usage data, crash reports and automatic connections #815 merges. The branch hasmain(with K2GO-552) through K2GO-588 feat(privacy): one choice for usage data, crash reports and automatic connections #815.UnusedResources, compared with the report onmain.help.db,module_sizes.csvandrootfs_sizes.csvcame into an earlier commit of this branch by mistake (they are build output). The merge commit sets them back to themainversion, so this PR does not change them.Review fixes (2026-11-22)
A code review found lifecycle gaps. Maintainer decisions and fixes (3ec3a21, 961ee56, 299645a, 04a7e52):
OnlineAllowance: a saved order (ZIM, books, courses, maps, modules) connects only when the choice is on, or when the user allowed that kind at its commit point in this process. Every*Provisioner.hasPendingandContentAdmissionread it, so a wishlist saved before Keep offline, by the wizard, or as a refused module no longer drains with no prompt. Pending downloads still lists it. Turning on Keep offline ends every allow. The allow lives in memory only, likeSessionMeteredConsentStore(the precedent for this static state): a new process asks again.FeedbackFab.sendFeedback. Settings > Send feedback keeps its block with a snackbar (maintainer request).Decisions recorded:
Known, not fixed: with held orders the progress screen ends as success while its rows say "Queued". Intermediate commit 299645a does not compile alone; the branch tip does.
Verifications for the fixes: lint (both flavors), unit tests (new
KeepBoxOfflineUseCaseTestcase: a failing service does not stop the others), APK and F-Droid compile; a second review pass on the fixes (its two bugs, wizard maps and the gate-open question, are fixed in 04a7e52 and #815). Device and PCAPdroid evidence: see #815 (Keep offline: 0 B, no connection; choice on: catalogs fromk2go-download.appdevforall.orgat once).