From d678566967f30757a8273f862bf43a01d0f2dea8 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Wed, 12 Jun 2019 11:01:56 -0300 Subject: [PATCH] Exclude key-value backup apps for now We do this as a temporary fix, because our backup methods are not called which are updating the package counter. So our mechanism to find out about the end of the backup is broken. Excluding key-value backups fixes it for now. --- .../ConfigurableBackupTransport.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/app/src/main/java/com/stevesoltys/backup/transport/ConfigurableBackupTransport.java b/app/src/main/java/com/stevesoltys/backup/transport/ConfigurableBackupTransport.java index 69c92f31..cc99aff9 100644 --- a/app/src/main/java/com/stevesoltys/backup/transport/ConfigurableBackupTransport.java +++ b/app/src/main/java/com/stevesoltys/backup/transport/ConfigurableBackupTransport.java @@ -7,6 +7,7 @@ import android.content.Context; import android.content.pm.PackageInfo; import android.net.Uri; import android.os.ParcelFileDescriptor; +import android.util.Log; import com.stevesoltys.backup.transport.component.BackupComponent; import com.stevesoltys.backup.transport.component.RestoreComponent; @@ -21,6 +22,8 @@ public class ConfigurableBackupTransport extends BackupTransport { private static final String TRANSPORT_DIRECTORY_NAME = "com.stevesoltys.backup.transport.ConfigurableBackupTransport"; + private static final String TAG = TRANSPORT_DIRECTORY_NAME; + private final BackupComponent backupComponent; private final RestoreComponent restoreComponent; @@ -49,6 +52,24 @@ public class ConfigurableBackupTransport extends BackupTransport { return this.getClass().getName(); } + @Override + public boolean isAppEligibleForBackup(PackageInfo targetPackage, boolean isFullBackup) { + // TODO re-include key-value (incremental) + // affected apps: + // * com.android.documentsui + // * android + // * com.android.nfc + // * com.android.calendar + // * com.android.providers.settings + // * com.android.cellbroadcastreceiver + // * com.android.calllogbackup + // * com.android.providers.blockednumber + // * com.android.providers.userdictionary + if (isFullBackup) return true; + Log.i(TAG, "Excluding key-value backup of " + targetPackage.packageName); + return false; + } + @Override public long requestBackupTime() { return backupComponent.requestBackupTime(); @@ -69,6 +90,12 @@ public class ConfigurableBackupTransport extends BackupTransport { return backupComponent.currentDestinationString(); } + @Override + public int performBackup(PackageInfo packageInfo, ParcelFileDescriptor inFd, int flags) { + // TODO handle flags + return performBackup(packageInfo, inFd); + } + @Override public int performBackup(PackageInfo targetPackage, ParcelFileDescriptor fileDescriptor) { return backupComponent.performIncrementalBackup(targetPackage, fileDescriptor); @@ -79,6 +106,12 @@ public class ConfigurableBackupTransport extends BackupTransport { return backupComponent.checkFullBackupSize(size); } + @Override + public int performFullBackup(PackageInfo targetPackage, ParcelFileDescriptor socket, int flags) { + // TODO handle flags + return performFullBackup(targetPackage, socket); + } + @Override public int performFullBackup(PackageInfo targetPackage, ParcelFileDescriptor fileDescriptor) { return backupComponent.performFullBackup(targetPackage, fileDescriptor);