mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 11:38:51 +01:00
Use foreground service to perform restore
This commit is contained in:
@@ -18,16 +18,15 @@
|
||||
*/
|
||||
package com.moez.QKSMS.interactor
|
||||
|
||||
import com.moez.QKSMS.model.BackupFile
|
||||
import com.moez.QKSMS.repository.BackupRepository
|
||||
import io.reactivex.Flowable
|
||||
import javax.inject.Inject
|
||||
|
||||
class PerformRestore @Inject constructor(
|
||||
private val backupRepo: BackupRepository
|
||||
) : Interactor<BackupFile>() {
|
||||
) : Interactor<String>() {
|
||||
|
||||
override fun buildObservable(params: BackupFile): Flowable<*> {
|
||||
override fun buildObservable(params: String): Flowable<*> {
|
||||
return Flowable.just(params)
|
||||
.doOnNext(backupRepo::performRestore)
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
*/
|
||||
package com.moez.QKSMS.manager
|
||||
|
||||
import androidx.core.app.NotificationCompat
|
||||
|
||||
interface NotificationManager {
|
||||
|
||||
fun update(threadId: Long)
|
||||
@@ -28,4 +30,6 @@ interface NotificationManager {
|
||||
|
||||
fun buildNotificationChannelId(threadId: Long): String
|
||||
|
||||
fun getNotificationForBackup(): NotificationCompat.Builder
|
||||
|
||||
}
|
||||
@@ -37,7 +37,7 @@ interface BackupRepository {
|
||||
*/
|
||||
fun getBackups(): Observable<List<BackupFile>>
|
||||
|
||||
fun performRestore(backupFile: BackupFile)
|
||||
fun performRestore(filePath: String)
|
||||
|
||||
fun getRestoreProgress(): Observable<Progress>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user