summaryrefslogtreecommitdiffstats
path: root/cmds/bmgr/src/com/android/commands
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2010-02-04 15:52:40 -0800
committerChristopher Tate <ctate@google.com>2010-02-04 16:01:09 -0800
commit8472581aa32eee1368de379c2c079ea0a66baa3c (patch)
treec7e71e08b7e465fa710c7e0903b8a2a74cce6fc4 /cmds/bmgr/src/com/android/commands
parent348f7b904851e3edcf09b8362406ff2f4ae57db2 (diff)
downloadframeworks_base-8472581aa32eee1368de379c2c079ea0a66baa3c.zip
frameworks_base-8472581aa32eee1368de379c2c079ea0a66baa3c.tar.gz
frameworks_base-8472581aa32eee1368de379c2c079ea0a66baa3c.tar.bz2
Add single-package restore from an app's most-recent data
Renamed the RestoreSession performRestore() method to restoreAll(), and added a new restorePackage() method that only restores the single specified app. In order to restore an app other than itself, the caller must hold the android.permission.BACKUP permission. This change also introduces dataset tracking: the Backup Manager persistently remembers both the current backup dataset's identity and that of the "ancestral" dataset, i.e. the one most recently used for a whole-device restore such as performed by SetupWizard. When a single package is restored via restorePackage(), the selection of most-recent dataset to use is this: 1. The data from the currently-active backup dataset, if such exists. An app that has ever backed up data will therefore get its last- known-good data. 2. The app's data from the ancestral dataset, if such exists. This covers the case of a factory reset followed by reinstallation of an app at a later time. The app had not yet backed anything up post-wipe, but the old data is in the ancestral dataset and should be brought forward when the app reappears. 3. If neither 1. nor 2. exist, there is no data to restore, so just skip it and return failure. Note that the infrastructure to automatically attempt a restore after an application has been installed does not yet exist; that's coming. Change-Id: I0ba170df9885128000c46ed28d3dddda3a63a143
Diffstat (limited to 'cmds/bmgr/src/com/android/commands')
-rw-r--r--cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
index 8c15d0b..acfbb07 100644
--- a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
+++ b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
@@ -315,7 +315,7 @@ public final class Bmgr {
for (RestoreSet s : sets) {
if (s.token == token) {
System.out.println("Scheduling restore: " + s.name);
- didRestore = (mRestore.performRestore(token, observer) == 0);
+ didRestore = (mRestore.restoreAll(token, observer) == 0);
break;
}
}