summaryrefslogtreecommitdiffstats
path: root/core/java/android/content/pm/ApplicationInfo.java
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2010-02-24 16:06:18 -0800
committerChristopher Tate <ctate@google.com>2010-02-24 17:23:54 -0800
commit3dda518a4fd57cdded3afa50d8aa206501de7fc6 (patch)
tree4f94ac2f5cf057501c9cbd9f4f814432c701443b /core/java/android/content/pm/ApplicationInfo.java
parent27eb24148a935d10c2c490205174c59a47e76dc6 (diff)
downloadframeworks_base-3dda518a4fd57cdded3afa50d8aa206501de7fc6.zip
frameworks_base-3dda518a4fd57cdded3afa50d8aa206501de7fc6.tar.gz
frameworks_base-3dda518a4fd57cdded3afa50d8aa206501de7fc6.tar.bz2
Add 'restoreAnyVersion' attr for apps that want to restore "future" data
If a backup-participating app sets android:restoreAnyVersion="true" in its manifest <application> tag, then its agent will be invoked for restore even if the available dataset was created by a later version of the app than is currently installed on the device. This will not typically be a problem for third party applications, since for them the installation and initial data restore are tightly coupled, but it can cause serious problems for applications which are both preinstalled on the system partition and overridden by later updates. The primary difficulty that this new attribute addresses is this: 1. User buys a Nexus One, Market self-updates, and the user installs some apps. At this point the backup data on the server may indicate that the version of Market which originated its bookkeeping is newer than the stock N1 Market app. 2. User loses their phone, and buys a replacement N1. At setup time, Market has not yet had a chance to self-update, so when the restore comes in, it's tagged as being from "the future" and so the restore is refused. No apps get reinstalled. Bug: 2442127 Change-Id: I076a9553dc613e5c3189350e778315718ed1ed2b
Diffstat (limited to 'core/java/android/content/pm/ApplicationInfo.java')
-rw-r--r--core/java/android/content/pm/ApplicationInfo.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 2e405c1..8773f59 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -248,6 +248,19 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
public static final int FLAG_NATIVE_DEBUGGABLE = 1<<21;
/**
+ * Value for {@link #flags}: Set to true if the application's backup
+ * agent claims to be able to handle restore data even "from the future,"
+ * i.e. from versions of the application with a versionCode greater than
+ * the one currently installed on the device.
+ *
+ * <p>If android:allowBackup is set to false or no android:backupAgent
+ * is specified, this flag will be ignored.
+ *
+ * {@hide}
+ */
+ public static final int FLAG_RESTORE_ANY_VERSION = 1<<22;
+
+ /**
* Flags associated with the application. Any combination of
* {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE},
* {@link #FLAG_PERSISTENT}, {@link #FLAG_FACTORY_TEST}, and