Remove hack of @pm@ backup when initializing transport

as it isn't needed anymore with v2 since we don't do duplicate restore sets anymore
This commit is contained in:
Torsten Grote 2024-09-11 15:31:22 -03:00
parent 7f9e84fdb6
commit 3c4b4f705c
No known key found for this signature in database
GPG key ID: 3E5F77D92CF891FF

View file

@ -11,8 +11,6 @@ import android.app.backup.IBackupObserver
import android.os.UserHandle import android.os.UserHandle
import android.util.Log import android.util.Log
import androidx.annotation.WorkerThread import androidx.annotation.WorkerThread
import com.stevesoltys.seedvault.BackupMonitor
import com.stevesoltys.seedvault.MAGIC_PACKAGE_MANAGER
import com.stevesoltys.seedvault.transport.TRANSPORT_ID import com.stevesoltys.seedvault.transport.TRANSPORT_ID
class BackupInitializer( class BackupInitializer(
@ -25,17 +23,7 @@ class BackupInitializer(
fun initialize(onError: () -> Unit, onSuccess: () -> Unit) { fun initialize(onError: () -> Unit, onSuccess: () -> Unit) {
val observer = BackupObserver("Initialization", onError) { val observer = BackupObserver("Initialization", onError) {
// After successful initialization, we request a @pm@ backup right away, onSuccess()
// because if this finds empty state, it asks us to do another initialization.
// And then we end up with yet another restore set token.
// Since we want the final token as soon as possible, we need to get it here.
Log.d(TAG, "Requesting initial $MAGIC_PACKAGE_MANAGER backup...")
backupManager.requestBackup(
arrayOf(MAGIC_PACKAGE_MANAGER),
BackupObserver("Initial backup of @pm@", onError, onSuccess),
BackupMonitor(),
0,
)
} }
backupManager.initializeTransportsForUser( backupManager.initializeTransportsForUser(
UserHandle.myUserId(), UserHandle.myUserId(),