Skip to content

[Data] Implement ConsentPreferences with DataStore #37

@LeGeRyChEeSe

Description

@LeGeRyChEeSe

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions