rouse-context/work
Jason Monk 0a0e914a2a Fix #116: Migrate all SharedPreferences usage to DataStore
Drop the last SharedPreferences call sites and replace them with typed
Preferences DataStore accessors:

- SecurityCheckPreferences: last-check time, self-cert / CT-log results,
  cert fingerprint (written by SecurityCheckWorker, read by
  TunnelForegroundService and SettingsViewModel)
- CertRenewalPreferences: last-attempt time, last outcome (written by
  CertRenewalWorker, observed by CertRenewalBannerFlow as a live Flow)
- SpuriousWakePreferences: wake counters and timestamp ring buffer,
  with the SpuriousWakeRecorder interface now suspend; the backing
  class is renamed DataStoreSpuriousWakeRecorder
- AppStatePreferences: first-launch marker and security-check interval
  (replaces the legacy rouse_settings prefs file)

Workers access their preferences through `by inject()` from Koin;
SettingsViewModel takes nullable accessor classes instead of raw
SharedPreferences. The McpSession alert gate reads from a
StateFlow-materialized view so the `() -> Boolean` contract is preserved
without reintroducing runBlocking.

Pre-release so no migration shim: legacy SharedPreferences files are
simply abandoned on upgrade. Only comments retain the SharedPreferences
word (pointing at this commit / the issue).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 21:24:08 -04:00
..
src Fix #116: Migrate all SharedPreferences usage to DataStore 2026-04-14 21:24:08 -04:00
build.gradle.kts Fix #116: Migrate all SharedPreferences usage to DataStore 2026-04-14 21:24:08 -04:00