storage: Address experimental time API errors
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
parent
c48aa73ad0
commit
288daadd8b
5 changed files with 8 additions and 1 deletions
storage/lib/src/main/java/org/calyxos/backup/storage
backup
plugin/saf
restore
scanner
|
@ -116,6 +116,7 @@ internal class Backup(
|
|||
}
|
||||
|
||||
@Throws(IOException::class, GeneralSecurityException::class)
|
||||
@OptIn(ExperimentalTime::class)
|
||||
private suspend fun backupFiles(
|
||||
filesResult: FileScannerResult,
|
||||
availableChunkIds: HashSet<String>,
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.calyxos.backup.storage.measure
|
|||
import org.calyxos.backup.storage.plugin.SnapshotRetriever
|
||||
import java.io.IOException
|
||||
import java.security.GeneralSecurityException
|
||||
import java.util.concurrent.TimeUnit.MILLISECONDS
|
||||
import kotlin.time.DurationUnit.MILLISECONDS
|
||||
import kotlin.time.ExperimentalTime
|
||||
import kotlin.time.toDuration
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import org.calyxos.backup.storage.plugin.saf.DocumentFileExt.listFilesBlocking
|
|||
import java.io.IOException
|
||||
import java.io.InputStream
|
||||
import java.io.OutputStream
|
||||
import kotlin.time.ExperimentalTime
|
||||
|
||||
private val folderRegex = Regex("^[a-f0-9]{16}\\.sv$")
|
||||
private val chunkFolderRegex = Regex("[a-f0-9]{2}")
|
||||
|
@ -89,6 +90,7 @@ public abstract class SafStoragePlugin(
|
|||
* Chunk folders will get cached in the given [chunkFolders] for faster access.
|
||||
*/
|
||||
@Throws(IOException::class)
|
||||
@OptIn(ExperimentalTime::class)
|
||||
private suspend fun populateChunkFolders(
|
||||
folder: DocumentFile,
|
||||
chunkFolders: HashMap<String, DocumentFile>,
|
||||
|
@ -126,6 +128,7 @@ public abstract class SafStoragePlugin(
|
|||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
@OptIn(ExperimentalTime::class)
|
||||
private fun createMissingChunkFolders(
|
||||
root: DocumentFile,
|
||||
chunkFolders: HashMap<String, DocumentFile>,
|
||||
|
|
|
@ -52,6 +52,7 @@ internal class Restore(
|
|||
MultiChunkRestore(context, storagePlugin, fileRestore, streamCrypto, streamKey)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalTime::class)
|
||||
fun getBackupSnapshots(): Flow<SnapshotResult> = flow {
|
||||
val numSnapshots: Int
|
||||
val time = measure {
|
||||
|
|
|
@ -11,6 +11,7 @@ import org.calyxos.backup.storage.content.DocFile
|
|||
import org.calyxos.backup.storage.content.MediaFile
|
||||
import org.calyxos.backup.storage.db.UriStore
|
||||
import org.calyxos.backup.storage.measure
|
||||
import kotlin.time.ExperimentalTime
|
||||
|
||||
internal class FileScannerResult(
|
||||
val smallFiles: List<ContentFile>,
|
||||
|
@ -30,6 +31,7 @@ internal class FileScanner(
|
|||
private const val FILES_LARGE = "large"
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalTime::class)
|
||||
fun getFiles(): FileScannerResult {
|
||||
// scan both APIs
|
||||
val mediaFiles = ArrayList<ContentFile>()
|
||||
|
|
Loading…
Add table
Reference in a new issue