Skip to content

K2GO-588 feat(privacy): one choice for usage data, crash reports and automatic connections - #815

Merged
luisguzman-adfa merged 9 commits into
mainfrom
feat/K2GO-588-one-privacy-choice
Nov 22, 2026
Merged

luisguzman-adfa merged 9 commits into
mainfrom
feat/K2GO-588-one-privacy-choice

Conversation

@luisguzman-adfa

@luisguzman-adfa luisguzman-adfa commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

  • One stored choice (OnlineConsent) replaces the analytics and crash-report opt-ins. The old answers are dropped and every user is asked once (see Review fixes).
  • The automatic-fetch rule (NetworkCostAdmission.allowsAutomatic) also needs the choice on. App and dash-node update checks, the Kolibri Studio tree, the live rootfs size and the Kiwix directory read stop when the choice is off.
  • Settings > About: one switch. The onboarding asks the question in every flavor (F-Droid too), also when the wizard resumes at the setup choice.
  • Crash reports: events only, no Sentry sessions; turning the choice off closes Sentry.
  • In-app WebViews load only local hosts; an internet page shows a short offline note.
  • One neutral User-Agent (K2Go) for app HTTP calls; the two Mozilla/5.0 overrides are removed.
  • The unused legacy setup and about screens (a second copy of the consent UI) are removed.
  • UI changes:
    • Onboarding title: "Privacy & analytics" -> "Privacy and online content".
    • Onboarding button and About switch: "Share anonymous data" / "Share usage statistics" + "Send crash reports" -> "Share usage data and request online content" (F-Droid: "Send crash reports and request online content").
    • Onboarding body rewritten for the one choice; new WebView note "This page is on the internet. Pages inside the app work offline only."
    • All locales translated (machine translation, review welcome).

Why

  • K2GO-588: "Keep offline" said "sends nothing" but the app still connected on its own; crash reports were a second switch; F-Droid users had no choice.

Steps to QA

  • Baseline: main, choose "Keep offline": the OTA check (update.json) still runs at each launch on Wi-Fi.
  • Change: clear app data, run the wizard: the privacy question shows. Choose "Keep offline": relaunch, no update.json request and Sentry does not start. Turn the switch on in Settings > About: the next launch checks update.json and starts Sentry.

Verifications

  • Unit tests, lint of both flavors (0 errors), standard and fdroid compile.
  • main (with K2GO-552) is merged into the branch. The only conflicts were in strings.xml: both branches append at the end, so both blocks are kept (main first).
  • Device: OnePlus 7T, wizard question, Keep offline vs on (logcat). Evidence goes to K2GO-588 in Jira.
  • 2026-11-22, OnePlus 7T, PR 1 + PR 2 + PR 3 together on current main, installed over a main build with a library (no data clear): the old answers are dropped and the question shows once (see Review fixes). Settings > About: dark and light verified. The onboarding was verified in dark only (light needs a data clear).
  • A local build has no google-services.json, so analytics is compiled out and the label is the crash-report one. CI builds of standard and Play have the file and show "Share usage data and request online content".
  • Same ticket: K2GO-588 feat(privacy): with Keep offline, actions ask once, box services stay off, catalogs follow the choice #814 (grey actions with "Allow only this time", catalog refresh, feedback, box Privacy; stacked on this PR) and K2GO-588 fix(download): the rootfs download is HTTP only, never BitTorrent #813 (remove BitTorrent).

Notes

Review fixes (2026-11-22)

A code review found gaps. Maintainer decisions and fixes (b29d9eb, 8b19e16, 6b26f7a, 0b7b045):

  • Every user is asked once after the update. The choice covers more than the old opt-ins, so analytics_opt_in, analytics_enrollment_shown and crash_reports_opt_in are dropped (new keys online_choice / online_choice_asked). Until the answer: Keep offline. The wizard asks a fresh install; Home asks an existing install when the boot gate opens, before the K2GO-552 password notice, so the two dialogs never stack.
  • One owner applies a change of the choice (OnlineChoiceEffects, called from onboarding and Settings). Crash reports start at once on yes (before: at the next launch). Sentry.close() runs off the main thread. Sentry sends no client reports.
  • Map tiles with the choice on: on an unmetered network, a local page's internet sub-requests load again (the K2GO-580 rule, now gated by the choice). An internet page still never opens in an in-app WebView.
  • HostScope treats a single-label host (http://box/) as local.
  • The consent androidTest checks the real default and restores the device value.
  • The label and question text moved to presentation (OnlineChoiceDialog).

Device, OnePlus 7T, #813 + #815 + #814 on current main, installed over the earlier build without a data clear:

  • After the update, Home shows the question once and the old key is gone.
  • PCAPdroid, target app K2Go only: with Keep offline, 0 B and no connection over a walk of all screens (the 6 library modules, Get more, About, help) plus 5 min idle, and again on the final build (walk + 3 min idle). Control: with the choice on, K2Go connects to k2go-download.appdevforall.org at once (catalogs).

Noted by the review, not changed here: the dead InstallationPlanner.getOrFetchCatalog path stays gated (hotspot class); a cached "update available" can stay visible with Keep offline; the user-tapped OTA APK download (DownloadManager) sends the system User-Agent.

…automatic connections

One stored choice replaces the analytics and crash-report opt-ins; the automatic-fetch rule and the
Kiwix directory read follow it. Asked in every flavor, one switch in Settings > About. Crash events
only (no Sentry sessions); off closes Sentry. Neutral User-Agent for app HTTP calls.
Only local hosts load; an internet page shows a short offline note instead of a blank screen.
…eens

They held a second copy of the consent UI and were no longer reachable.
… it resumes at setup

With permissions already granted the wizard opens at the setup choice and skipped the question.
main added the K2GO-552 strings at the end of each strings.xml, like this
branch. Both blocks are kept, main first.
- The choice covers more than the old analytics and crash-report opt-ins, so
  their answers are dropped (new keys online_choice / online_choice_asked) and
  every user is asked once. Home asks an existing install after the boot gate;
  the wizard asks a fresh install. Until the answer: Keep offline.
- OnlineChoiceEffects is the one place that applies a change (onboarding and
  Settings): analytics collection, and crash reports start at once on yes.
  Sentry.close() runs off the main thread (it can wait for its transport).
- Sentry sends no client reports (counts of dropped events).
- The label and question text move to presentation (OnlineChoiceDialog).
…s local

- A local page's own internet sub-requests (map tiles, fonts) load when the
  choice is on and the network is unmetered (the K2GO-580 rule, now gated by
  the choice). An internet page still never opens in an in-app WebView.
- HostScope treats a single-label name (http://box/) as local, so a box link
  no longer shows the "This page is on the internet" note.
…pens

On a cold start after the update, onResume runs while the gate is still up, so
the question waited for the next resume. It is now asked when the gate opens,
and the admin-password notice (K2GO-552) follows it, so the two dialogs never
stack.
@luisguzman-adfa
luisguzman-adfa merged commit c8fc713 into main Nov 22, 2026
4 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/K2GO-588-one-privacy-choice branch November 22, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui change or edit to UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant