Merge "[FSD2D] Remove left-over code from proof-of-concept" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a10dc432ae
@@ -4335,17 +4335,10 @@ public final class ActivityThread extends ClientTransactionHandler
|
|||||||
|
|
||||||
private String getBackupAgentName(CreateBackupAgentData data) {
|
private String getBackupAgentName(CreateBackupAgentData data) {
|
||||||
String agentName = data.appInfo.backupAgentName;
|
String agentName = data.appInfo.backupAgentName;
|
||||||
if (!UserHandle.isCore(data.appInfo.uid)
|
// full backup operation but no app-supplied agent? use the default implementation
|
||||||
&& data.operationType == BackupManager.OperationType.MIGRATION) {
|
if (agentName == null && (data.backupMode == ApplicationThreadConstants.BACKUP_MODE_FULL
|
||||||
// If this is a migration, use the default backup agent regardless of the app's
|
|| data.backupMode == ApplicationThreadConstants.BACKUP_MODE_RESTORE_FULL)) {
|
||||||
// preferences.
|
|
||||||
agentName = DEFAULT_FULL_BACKUP_AGENT;
|
agentName = DEFAULT_FULL_BACKUP_AGENT;
|
||||||
} else {
|
|
||||||
// full backup operation but no app-supplied agent? use the default implementation
|
|
||||||
if (agentName == null && (data.backupMode == ApplicationThreadConstants.BACKUP_MODE_FULL
|
|
||||||
|| data.backupMode == ApplicationThreadConstants.BACKUP_MODE_RESTORE_FULL)) {
|
|
||||||
agentName = DEFAULT_FULL_BACKUP_AGENT;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return agentName;
|
return agentName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -544,11 +544,6 @@ public abstract class BackupAgent extends ContextWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Set<String> getExtraExcludeDirsIfAny(Context context) throws IOException {
|
private Set<String> getExtraExcludeDirsIfAny(Context context) throws IOException {
|
||||||
if (isDeviceToDeviceMigration()) {
|
|
||||||
return Collections.emptySet();
|
|
||||||
}
|
|
||||||
|
|
||||||
// If this is not a migration, also exclude no-backup and cache dirs.
|
|
||||||
Set<String> excludedDirs = new HashSet<>();
|
Set<String> excludedDirs = new HashSet<>();
|
||||||
excludedDirs.add(context.getCacheDir().getCanonicalPath());
|
excludedDirs.add(context.getCacheDir().getCanonicalPath());
|
||||||
excludedDirs.add(context.getCodeCacheDir().getCanonicalPath());
|
excludedDirs.add(context.getCodeCacheDir().getCanonicalPath());
|
||||||
@@ -556,10 +551,6 @@ public abstract class BackupAgent extends ContextWrapper {
|
|||||||
return Collections.unmodifiableSet(excludedDirs);
|
return Collections.unmodifiableSet(excludedDirs);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isDeviceToDeviceMigration() {
|
|
||||||
return mOperationType == OperationType.MIGRATION;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public IncludeExcludeRules getIncludeExcludeRules(FullBackup.BackupScheme backupScheme)
|
public IncludeExcludeRules getIncludeExcludeRules(FullBackup.BackupScheme backupScheme)
|
||||||
@@ -905,11 +896,6 @@ public abstract class BackupAgent extends ContextWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isFileEligibleForRestore(File destination) throws IOException {
|
private boolean isFileEligibleForRestore(File destination) throws IOException {
|
||||||
if (isDeviceToDeviceMigration()) {
|
|
||||||
// Everything is eligible for device-to-device migration.
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
FullBackup.BackupScheme bs = FullBackup.getBackupScheme(this, mOperationType);
|
FullBackup.BackupScheme bs = FullBackup.getBackupScheme(this, mOperationType);
|
||||||
if (!bs.isFullRestoreEnabled()) {
|
if (!bs.isFullRestoreEnabled()) {
|
||||||
if (Log.isLoggable(FullBackup.TAG_XML_PARSER, Log.VERBOSE)) {
|
if (Log.isLoggable(FullBackup.TAG_XML_PARSER, Log.VERBOSE)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user