diff options
author | Christopher Tate <ctate@google.com> | 2014-06-23 17:01:06 -0700 |
---|---|---|
committer | Christopher Tate <ctate@google.com> | 2014-06-30 17:43:05 -0700 |
commit | 51fea57e06fcb1dab1d239a5fff6e75ba2b7cee7 (patch) | |
tree | a11647d14f291a4f8bfcfdab2e34cff6c16e8c03 /core/java/com | |
parent | 9a347f199284ad8bcb8a81bfbd306fe0b1a710ba (diff) | |
download | frameworks_base-51fea57e06fcb1dab1d239a5fff6e75ba2b7cee7.zip frameworks_base-51fea57e06fcb1dab1d239a5fff6e75ba2b7cee7.tar.gz frameworks_base-51fea57e06fcb1dab1d239a5fff6e75ba2b7cee7.tar.bz2 |
Refactor restore to deal with heterogeneous datasets
Transport-based restore now handles both key/value and full-data
(stream) data delivery.
Also: PMBA now holds metadata for *all* apps, not just those with
backup agents. Since we need to consult this for every restore-
at-install operation we cache this locally now, tagged per transport
and per remote dataset, to avoid having to re-download it as part
of every future restore operation.
Also fixed a bug in LocalTransport that was preventing restore of
key/value datasets, i.e. all of them that were nominally available
prior to this change.
NOTE: at present there is no automatic full-data backup; if for
testing purposes you need to create some to then use for restore,
you still need to use 'bmgr fullbackup ...' to push them.
NOTE: at present the unified transport restore uses a refactored
"engine" implementation to handle stream data that encapsulates
the existing "adb restore" implementation. However, the adb
restore code path has not yet been refactored to wrap the newly-
extracted engine version; it still contains its own copy of all
the relevant logic. This will change in a future CL, at which
point offline/USB archive restore will simply wrap the same
shared stream-restore engine implementation.
Bug 15330073
Bug 15989617
Change-Id: Ieedb18fd7836ad31ba24656ec9feaaf69e164af8
Diffstat (limited to 'core/java/com')
-rw-r--r-- | core/java/com/android/internal/backup/LocalTransport.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/java/com/android/internal/backup/LocalTransport.java b/core/java/com/android/internal/backup/LocalTransport.java index b098de8..8b56ceb 100644 --- a/core/java/com/android/internal/backup/LocalTransport.java +++ b/core/java/com/android/internal/backup/LocalTransport.java @@ -353,7 +353,7 @@ public class LocalTransport extends BackupTransport { // ------------------------------------------------------------------------------------ // Restore handling - static final long[] POSSIBLE_SETS = { 2, 3, 4, 5, 6, 7, 8, 9 }; + static final long[] POSSIBLE_SETS = { 2, 3, 4, 5, 6, 7, 8, 9 }; @Override public RestoreSet[] getAvailableRestoreSets() { @@ -384,7 +384,8 @@ public class LocalTransport extends BackupTransport { @Override public int startRestore(long token, PackageInfo[] packages) { - if (DEBUG) Log.v(TAG, "start restore " + token); + if (DEBUG) Log.v(TAG, "start restore " + token + " : " + packages.length + + " matching packages"); mRestorePackages = packages; mRestorePackage = -1; mRestoreToken = token; @@ -438,7 +439,8 @@ public class LocalTransport extends BackupTransport { if (mRestoreType != RestoreDescription.TYPE_KEY_VALUE) { throw new IllegalStateException("getRestoreData(fd) for non-key/value dataset"); } - File packageDir = new File(mRestoreSetDir, mRestorePackages[mRestorePackage].packageName); + File packageDir = new File(mRestoreSetIncrementalDir, + mRestorePackages[mRestorePackage].packageName); // The restore set is the concatenation of the individual record blobs, // each of which is a file in the package's directory. We return the |