summaryrefslogtreecommitdiffstats
path: root/packages/SharedStorageBackup
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SharedStorageBackup')
-rw-r--r--packages/SharedStorageBackup/AndroidManifest.xml2
-rw-r--r--packages/SharedStorageBackup/src/com/android/sharedstoragebackup/SharedStorageAgent.java21
2 files changed, 9 insertions, 14 deletions
diff --git a/packages/SharedStorageBackup/AndroidManifest.xml b/packages/SharedStorageBackup/AndroidManifest.xml
index 258059c..39c36f1 100644
--- a/packages/SharedStorageBackup/AndroidManifest.xml
+++ b/packages/SharedStorageBackup/AndroidManifest.xml
@@ -23,7 +23,7 @@
<application android:allowClearUserData="false"
android:permission="android.permission.CONFIRM_FULL_BACKUP"
- android:fullBackupAgent=".SharedStorageAgent"
+ android:backupAgent=".SharedStorageAgent"
android:allowBackup="false" >
</application>
</manifest>
diff --git a/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/SharedStorageAgent.java b/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/SharedStorageAgent.java
index b02ca2e..6c677b8 100644
--- a/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/SharedStorageAgent.java
+++ b/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/SharedStorageAgent.java
@@ -1,9 +1,10 @@
package com.android.sharedstoragebackup;
-import android.app.backup.FullBackup;
import android.app.backup.FullBackupAgent;
+import android.app.backup.FullBackup;
import android.app.backup.BackupDataInput;
import android.app.backup.BackupDataOutput;
+import android.app.backup.FullBackupDataOutput;
import android.content.Context;
import android.os.Environment;
import android.os.ParcelFileDescriptor;
@@ -30,9 +31,11 @@ public class SharedStorageAgent extends FullBackupAgent {
}
}
+ /**
+ * Full backup of the shared-storage filesystem
+ */
@Override
- public void onBackup(ParcelFileDescriptor oldState, BackupDataOutput data,
- ParcelFileDescriptor newState) throws IOException {
+ public void onFullBackup(FullBackupDataOutput output) throws IOException {
// If there are shared-storage volumes available, run the inherited directory-
// hierarchy backup process on them. By convention in the Storage Manager, the
// "primary" shared storage volume is first in the list.
@@ -43,20 +46,12 @@ public class SharedStorageAgent extends FullBackupAgent {
// shared/N/path/to/file
// The restore will then extract to the given volume
String domain = FullBackup.SHARED_PREFIX + i;
- processTree(null, domain, v.getPath(), null, data);
+ fullBackupFileTree(null, domain, v.getPath(), null, output);
}
}
}
/**
- * Incremental onRestore() implementation is not used.
- */
- @Override
- public void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState)
- throws IOException {
- }
-
- /**
* Full restore of one file to shared storage
*/
@Override
@@ -88,6 +83,6 @@ public class SharedStorageAgent extends FullBackupAgent {
Slog.e(TAG, "Skipping data with malformed path " + relpath);
}
- FullBackup.restoreToFile(data, size, type, mode, mtime, outFile, false);
+ FullBackup.restoreFile(data, size, type, -1, mtime, outFile);
}
}