The Settings Module is more than a configuration panel; it is the interface where the user defines their relationship with their device. It encompasses hardware-level calibration, granular app visibility controls, psychological commitment via the “Pledge,” and robust data backup/restore mechanisms.The module is designed with a heavy emphasis on Digital Sovereignty, ensuring that all data remains local and portable while providing the user with high-fidelity tools to “rig the game” in their favor.
The most technically critical part of the module. Since Android devices vary wildly in screen size and density, the CalibrationScreen allows users to match a physical object (a standard credit card) to an on-screen visual.
Logic: It calculates the real-world by dividing the pixel height of the user-adjusted slider by the standard physical length of an ID-1 card (3.375 inches).
Impact: This ensures that “10 meters of scrolling” in the app actually represents 10 physical meters on the user’s specific device.
The AppMetadataRepositoryImpl performs a “Full Sync” by comparing the list of apps currently installed on the OS (via PackageManager) against the local app_metadata table.
Source: packageManager.getInstalledApplications.
Transformation: It maps system flags to determine if an app is a “System App” or “User Visible.”
Caching: App icons are extracted and saved to the internal filesDir/app_icons to ensure the UI remains fast and works offline.
The backup process iterates through every table in the (Scroll Sessions, App Events, Daily Insights), converts them to JSON, and streams them into a compressed GZIP file. This prevents memory spikes that would occur if the entire database were loaded into RAM at once.