Refactor settings storage to Preferences DataStore to remove Protobuf#525
Refactor settings storage to Preferences DataStore to remove Protobuf#525davidjiagoogle wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates the application's settings storage from Proto DataStore to Preferences DataStore, removing all Protobuf dependencies, plugins, and schema files. Model enums and DebugSettings have been updated to remove proto conversion methods, with DebugSettings now using a custom string-based serialization format. LocalSettingsRepository has been refactored to read and write settings using Preferences keys. The review feedback highlights critical robustness issues where unsafe string parsing (using valueOf directly on stored preferences or parsing DebugSettings without validation) could lead to runtime crashes (e.g., IllegalArgumentException or NumberFormatException) if the data is corrupted or malformed. Implementing safe parsing helpers with fallback defaults is highly recommended to ensure app stability.
This PR refactors settings storage from Proto DataStore to Preferences DataStore. This allows us to completely remove the com.google.protobuf dependency and its generated Java code, saving ~134 KB of bytecode footprint in platform environments where dependencies are linked dynamically.