Description
Implement local persistence of user consent using Android DataStore (Preferences) to benefit from a reactive Flow-based API.
File to create
app/src/main/java/com/vrhub/data/ConsentPreferences.kt
Specifications
- DataStore name:
vrhub_settings
- Key:
consent_enabled (boolean)
- Default value:
false
- API:
val consentEnabled: Flow<Boolean>
suspend fun setConsentEnabled(enabled: Boolean)
Notes
- Do not use the existing SharedPreferences (
Constants.PREFS_NAME) for this preference in order to benefit from Flow reactivity.
- Ensure the file is thread-safe and accessible from the main thread via
suspend.
Reference
docs/CLIENT_SPEC.md §5
docs/CLIENT_IMPLEMENTATION.md §4
Description
Implement local persistence of user consent using Android DataStore (Preferences) to benefit from a reactive Flow-based API.
File to create
app/src/main/java/com/vrhub/data/ConsentPreferences.ktSpecifications
vrhub_settingsconsent_enabled(boolean)falseval consentEnabled: Flow<Boolean>suspend fun setConsentEnabled(enabled: Boolean)Notes
Constants.PREFS_NAME) for this preference in order to benefit from Flow reactivity.suspend.Reference
docs/CLIENT_SPEC.md§5docs/CLIENT_IMPLEMENTATION.md§4