diff options
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/content/pm/ApplicationInfo.java | 9 | ||||
| -rw-r--r-- | core/java/android/content/pm/PackageParser.java | 5 | ||||
| -rw-r--r-- | core/res/res/values/attrs_manifest.xml | 9 | ||||
| -rw-r--r-- | core/res/res/values/public.xml | 1 |
5 files changed, 26 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt index fd546f1cfb63..aef48c1130b9 100644 --- a/api/current.txt +++ b/api/current.txt @@ -580,6 +580,7 @@ package android { field public static final int fromXScale = 16843202; // 0x10101c2 field public static final int fromYDelta = 16843208; // 0x10101c8 field public static final int fromYScale = 16843204; // 0x10101c4 + field public static final int fullBackupOnly = 16843893; // 0x1010475 field public static final int fullBright = 16842954; // 0x10100ca field public static final int fullDark = 16842950; // 0x10100c6 field public static final int functionalTest = 16842787; // 0x1010023 @@ -8125,6 +8126,7 @@ package android.content.pm { field public static final int FLAG_DEBUGGABLE = 2; // 0x2 field public static final int FLAG_EXTERNAL_STORAGE = 262144; // 0x40000 field public static final int FLAG_FACTORY_TEST = 16; // 0x10 + field public static final int FLAG_FULL_BACKUP_ONLY = 67108864; // 0x4000000 field public static final int FLAG_HAS_CODE = 4; // 0x4 field public static final int FLAG_INSTALLED = 8388608; // 0x800000 field public static final int FLAG_IS_DATA_ONLY = 16777216; // 0x1000000 diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java index 06f4019df06d..be4e86441755 100644 --- a/core/java/android/content/pm/ApplicationInfo.java +++ b/core/java/android/content/pm/ApplicationInfo.java @@ -325,6 +325,15 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { public static final int FLAG_IS_GAME = 1<<25; /** + * Value for {@link #flags}: {@code true} if the application asks that only + * full-data streaming backups of its data be performed even though it defines + * a {@link android.app.backup.BackupAgent BackupAgent}, which normally + * indicates that the app will manage its backed-up data via incremental + * key/value updates. + */ + public static final int FLAG_FULL_BACKUP_ONLY = 1<<26; + + /** * Value for {@link #flags}: set to {@code true} if the application * is permitted to hold privileged permissions. * diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 91895ff5d68e..b25725ee2d2e 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -2088,6 +2088,11 @@ public class PackageParser { false)) { ai.flags |= ApplicationInfo.FLAG_RESTORE_ANY_VERSION; } + if (sa.getBoolean( + com.android.internal.R.styleable.AndroidManifestApplication_fullBackupOnly, + false)) { + ai.flags |= ApplicationInfo.FLAG_FULL_BACKUP_ONLY; + } } } diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index 814d8fc0c800..48b931123a9a 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -814,6 +814,14 @@ via adb. The default value of this attribute is <code>true</code>. --> <attr name="allowBackup" format="boolean" /> + <!-- Indicates that even though the application provides a <code>BackupAgent</code>, + only full-data streaming backup operations are to be performed to save the app's + data. This lets the app rely on full-data backups while still participating in + the backup and restore process via the BackupAgent's full-data backup APIs. + When this attribute is <code>true</code> the app's BackupAgent overrides of + the onBackup() and onRestore() callbacks can be empty stubs. --> + <attr name="fullBackupOnly" format="boolean" /> + <!-- Whether the application in question should be terminated after its settings have been restored during a full-system restore operation. Single-package restore operations will never cause the application to @@ -1044,6 +1052,7 @@ <attr name="testOnly" /> <attr name="backupAgent" /> <attr name="allowBackup" /> + <attr name="fullBackupOnly" /> <attr name="killAfterRestore" /> <attr name="restoreNeedsApplication" /> <attr name="restoreAnyVersion" /> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 1580d690f630..1bdb3cfc007b 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2206,6 +2206,7 @@ <public type="attr" name="buttonTintMode" /> <public type="attr" name="thumbTint" /> <public type="attr" name="thumbTintMode" /> + <public type="attr" name="fullBackupOnly" /> <public-padding type="dimen" name="l_resource_pad" end="0x01050010" /> |