Migrate backup & restore feature to use SAF (#1900)

* Migrate backup & restore feature to use SAF

* Remove unused imports

* Remove unused rx subject

* Remove unused dateFormatter

* Open picker to current dir

* Improve exception messages when handling DocumentFile
This commit is contained in:
Moez Bhatti
2023-01-02 11:44:03 -05:00
committed by GitHub
parent c31d38905b
commit 53b2ac2bf8
20 changed files with 365 additions and 242 deletions
@@ -18,6 +18,8 @@
*/
package com.moez.QKSMS.repository
import android.net.Uri
import androidx.documentfile.provider.DocumentFile
import com.moez.QKSMS.model.BackupFile
import io.reactivex.Observable
@@ -32,19 +34,24 @@ interface BackupRepository {
class Finished : Progress(true, false)
}
fun getDefaultBackupPath(): String
fun getBackupDocumentTree(): DocumentFile?
fun getBackupPathUriForPicker(): Uri
fun persistBackupDirectory(directory: Uri)
fun performBackup()
fun getBackupProgress(): Observable<Progress>
/**
* Returns a list of all local backups
*/
fun getBackups(): Observable<List<BackupFile>>
fun parseBackup(uri: Uri): BackupFile
fun performRestore(filePath: String)
fun stopRestore()
fun performRestore(uri: Uri)
fun getRestoreProgress(): Observable<Progress>
}
fun stopRestore()
}