summaryrefslogtreecommitdiffstats
path: root/tests/backup/src/com/android
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2009-06-18 13:11:18 -0700
committerJoe Onorato <joeo@android.com>2009-06-18 18:41:11 -0700
commitd2d9ceb7305d593c1b767bbb05de0082a9af4109 (patch)
tree1ba39c3c5901d65a18855286e240f177820a6ec6 /tests/backup/src/com/android
parentabce4e8714bed26a2b37b20ad3f02cf619d71c9a (diff)
downloadframeworks_base-d2d9ceb7305d593c1b767bbb05de0082a9af4109.zip
frameworks_base-d2d9ceb7305d593c1b767bbb05de0082a9af4109.tar.gz
frameworks_base-d2d9ceb7305d593c1b767bbb05de0082a9af4109.tar.bz2
Make RestoreHelper and friends also write out the snapshot state.
Diffstat (limited to 'tests/backup/src/com/android')
-rw-r--r--tests/backup/src/com/android/backuptest/BackupTestActivity.java7
-rw-r--r--tests/backup/src/com/android/backuptest/BackupTestAgent.java2
2 files changed, 7 insertions, 2 deletions
diff --git a/tests/backup/src/com/android/backuptest/BackupTestActivity.java b/tests/backup/src/com/android/backuptest/BackupTestActivity.java
index d87e85c..f0c3f93 100644
--- a/tests/backup/src/com/android/backuptest/BackupTestActivity.java
+++ b/tests/backup/src/com/android/backuptest/BackupTestActivity.java
@@ -161,8 +161,13 @@ public class BackupTestActivity extends ListActivity
new FileRestoreHelper(BackupTestActivity.this));
FileInputStream dataFile = openFileInput("backup_test");
BackupDataInput data = new BackupDataInput(dataFile.getFD());
- dispatch.dispatch(data);
+ ParcelFileDescriptor state = ParcelFileDescriptor.open(
+ new File(getFilesDir(), "restore_state"),
+ ParcelFileDescriptor.MODE_READ_WRITE|ParcelFileDescriptor.MODE_CREATE|
+ ParcelFileDescriptor.MODE_TRUNCATE);
+ dispatch.dispatch(data, state);
dataFile.close();
+ state.close();
} catch (IOException ex) {
throw new RuntimeException(ex);
}
diff --git a/tests/backup/src/com/android/backuptest/BackupTestAgent.java b/tests/backup/src/com/android/backuptest/BackupTestAgent.java
index e3566ec..0da4151 100644
--- a/tests/backup/src/com/android/backuptest/BackupTestAgent.java
+++ b/tests/backup/src/com/android/backuptest/BackupTestAgent.java
@@ -55,7 +55,7 @@ public class BackupTestAgent extends BackupAgent
// dispatch.addHelper(SHARED_PREFS, new SharedPrefsRestoreHelper(this));
dispatch.addHelper(DATA_FILES, new FileRestoreHelper(this));
- dispatch.dispatch(data);
+ dispatch.dispatch(data, newState);
}
}