refactor: migrate preferences to DataStore and decouple core:domain for KMP (#4731)

This commit is contained in:
James Rich 2026-03-05 20:37:35 -06:00 committed by GitHub
parent 87fdaa26ff
commit b9b68d2779
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
113 changed files with 1790 additions and 1320 deletions

View file

@ -0,0 +1,34 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.meshtastic.core.common.database
import kotlinx.coroutines.flow.StateFlow
/** Interface for managing database instances and cache limits. */
interface DatabaseManager {
/** Reactive stream of the current database cache limit. */
val cacheLimit: StateFlow<Int>
/** Returns the current database cache limit from storage. */
fun getCurrentCacheLimit(): Int
/** Sets the database cache limit. */
fun setCacheLimit(limit: Int)
/** Switches the active database to the one associated with the given [address]. */
suspend fun switchActiveDatabase(address: String?)
}