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:
parent
7fcd9aa091
commit
d678566967
1 changed files with 33 additions and 0 deletions
|
@ -7,6 +7,7 @@ import android.content.Context;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.ParcelFileDescriptor;
|
import android.os.ParcelFileDescriptor;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import com.stevesoltys.backup.transport.component.BackupComponent;
|
import com.stevesoltys.backup.transport.component.BackupComponent;
|
||||||
import com.stevesoltys.backup.transport.component.RestoreComponent;
|
import com.stevesoltys.backup.transport.component.RestoreComponent;
|
||||||
|
@ -21,6 +22,8 @@ public class ConfigurableBackupTransport extends BackupTransport {
|
||||||
private static final String TRANSPORT_DIRECTORY_NAME =
|
private static final String TRANSPORT_DIRECTORY_NAME =
|
||||||
"com.stevesoltys.backup.transport.ConfigurableBackupTransport";
|
"com.stevesoltys.backup.transport.ConfigurableBackupTransport";
|
||||||
|
|
||||||
|
private static final String TAG = TRANSPORT_DIRECTORY_NAME;
|
||||||
|
|
||||||
private final BackupComponent backupComponent;
|
private final BackupComponent backupComponent;
|
||||||
|
|
||||||
private final RestoreComponent restoreComponent;
|
private final RestoreComponent restoreComponent;
|
||||||
|
@ -49,6 +52,24 @@ public class ConfigurableBackupTransport extends BackupTransport {
|
||||||
return this.getClass().getName();
|
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
|
@Override
|
||||||
public long requestBackupTime() {
|
public long requestBackupTime() {
|
||||||
return backupComponent.requestBackupTime();
|
return backupComponent.requestBackupTime();
|
||||||
|
@ -69,6 +90,12 @@ public class ConfigurableBackupTransport extends BackupTransport {
|
||||||
return backupComponent.currentDestinationString();
|
return backupComponent.currentDestinationString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int performBackup(PackageInfo packageInfo, ParcelFileDescriptor inFd, int flags) {
|
||||||
|
// TODO handle flags
|
||||||
|
return performBackup(packageInfo, inFd);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int performBackup(PackageInfo targetPackage, ParcelFileDescriptor fileDescriptor) {
|
public int performBackup(PackageInfo targetPackage, ParcelFileDescriptor fileDescriptor) {
|
||||||
return backupComponent.performIncrementalBackup(targetPackage, fileDescriptor);
|
return backupComponent.performIncrementalBackup(targetPackage, fileDescriptor);
|
||||||
|
@ -79,6 +106,12 @@ public class ConfigurableBackupTransport extends BackupTransport {
|
||||||
return backupComponent.checkFullBackupSize(size);
|
return backupComponent.checkFullBackupSize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int performFullBackup(PackageInfo targetPackage, ParcelFileDescriptor socket, int flags) {
|
||||||
|
// TODO handle flags
|
||||||
|
return performFullBackup(targetPackage, socket);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int performFullBackup(PackageInfo targetPackage, ParcelFileDescriptor fileDescriptor) {
|
public int performFullBackup(PackageInfo targetPackage, ParcelFileDescriptor fileDescriptor) {
|
||||||
return backupComponent.performFullBackup(targetPackage, fileDescriptor);
|
return backupComponent.performFullBackup(targetPackage, fileDescriptor);
|
||||||
|
|
Loading…
Reference in a new issue