chore: KMP audit — commonize code, centralize utilities, eliminate dead abstractions (#5133)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
James Rich 2026-04-14 21:17:50 -05:00 committed by GitHub
parent 50ade01e55
commit 72b981f73b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
132 changed files with 2186 additions and 916 deletions

View file

@ -18,7 +18,7 @@ package org.meshtastic.core.repository
import okio.BufferedSink
import okio.BufferedSource
import org.meshtastic.core.common.util.MeshtasticUri
import org.meshtastic.core.common.util.CommonUri
/**
* Abstracts file system operations (like reading from or writing to URIs) so that ViewModels can remain
@ -29,11 +29,11 @@ interface FileService {
* Opens a file or URI for writing and provides a [BufferedSink]. The sink is automatically closed after [block]
* execution. Returns true if successful, false otherwise.
*/
suspend fun write(uri: MeshtasticUri, block: suspend (BufferedSink) -> Unit): Boolean
suspend fun write(uri: CommonUri, block: suspend (BufferedSink) -> Unit): Boolean
/**
* Opens a file or URI for reading and provides a [BufferedSource]. The source is automatically closed after [block]
* execution. Returns true if successful, false otherwise.
*/
suspend fun read(uri: MeshtasticUri, block: suspend (BufferedSource) -> Unit): Boolean
suspend fun read(uri: CommonUri, block: suspend (BufferedSource) -> Unit): Boolean
}

View file

@ -71,7 +71,7 @@ interface PacketRepository {
suspend fun updateLastReadMessage(contact: String, messageUuid: Long, lastReadTimestamp: Long)
/** Returns all packets currently queued for transmission. */
suspend fun getQueuedPackets(): List<DataPacket>?
suspend fun getQueuedPackets(): List<DataPacket>
/**
* Persists a packet in the database.