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.
This commit is contained in:
Torsten Grote 2019-06-12 11:01:56 -03:00
parent 7fcd9aa091
commit d678566967
No known key found for this signature in database
GPG key ID: 3E5F77D92CF891FF

View file

@ -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);