Pass the originating app's versionCode along with a restore set

This change amends the doRestore() / onRestore() interface to backup agents to
provide the integer android:versionCode of the app that stored the backup set.
This should help agents figure out how to handle whatever historical data set
they're handed at restore time.
This commit is contained in:
Christopher Tate
2009-06-22 16:44:51 -07:00
parent 3a31a93b8a
commit 5cbbf5652a
9 changed files with 48 additions and 22 deletions

View File

@@ -192,7 +192,7 @@ public class PackageManagerBackupAgent extends BackupAgent {
// "Restore" here is a misnomer. What we're really doing is reading back the
// set of app signatures associated with each backed-up app in this restore
// image. We'll use those later to determine what we can legitimately restore.
public void onRestore(BackupDataInput data, ParcelFileDescriptor newState)
public void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState)
throws IOException {
List<ApplicationInfo> restoredApps = new ArrayList<ApplicationInfo>();
HashMap<String, Metadata> sigMap = new HashMap<String, Metadata>();