mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
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:
parent
50ade01e55
commit
72b981f73b
132 changed files with 2186 additions and 916 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue