Files
Meshtastic-Android/core/prefs
James Rich 501c81ecde build: drop compiler flags and opt-ins made redundant by Kotlin 2.4
Kotlin 2.4.0 (#5760) stabilized several features this build still
configured manually:

- kotlin.uuid.Uuid (incl. Uuid.random/parse) is stable: remove the
  global -opt-in and the per-file @OptIn(ExperimentalUuidApi) usages.
  Only the generateV4/V7 variants remain experimental and nothing in
  the repo uses them.
- kotlin.time Clock/Instant have been stable since 2.3 and no
  still-experimental kotlin.time API is used: remove the global
  -opt-in=kotlin.time.ExperimentalTime.
- Context parameters are stable: remove -Xcontext-parameters.
- Annotation use-site defaulting (param-property) is the language
  default now; the compiler reported -Xannotation-default-target as
  redundant: remove it.
- OptimizeNonSkippingGroups is default Compose compiler behavior and
  the feature flag is deprecated (removal slated for Kotlin 2.6):
  drop it from ComposeCompilerConfiguration.

Verified: spotlessApply spotlessCheck detekt assembleDebug test
allTests kmpSmokeCompile all pass (2756 tests, 0 failures), with no
remaining warnings about the removed flags.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 20:45:40 -05:00
..

:core:prefs

Overview

The :core:prefs module provides a type-safe preferences layer backed by DataStore (multiplatform). On Android, legacy SharedPreferences are automatically migrated to DataStore on first access via SharedPreferencesMigration.

Key Components

1. DataStore Providers (CorePrefsAndroidModule)

Provides named DataStore<Preferences> singletons for each preference domain (analytics, app, map, mesh, radio, UI, etc.). Each DataStore uses an injected CoroutineDispatchers.io scope and includes a SharedPreferencesMigration for seamless migration from the legacy preference files.

2. Specialized Prefs

  • RadioPrefs: Manages radio-specific settings (e.g., the last connected device address).
  • UiPrefs: Manages UI preferences (e.g., theme selection, unit systems).
  • MapPrefs: Manages mapping preferences (e.g., preferred map provider).

Dependency Graph

graph TB
  :core:prefs[prefs]:::kmp-library
  :core:prefs -.-> :core:repository
  :core:prefs -.-> :core:common
  :core:prefs -.-> :core:di

classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-application-compose fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef compose-desktop-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-library-compose fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library-compose fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;