diff options
author | Christopher Tate <ctate@google.com> | 2010-03-12 17:28:08 -0800 |
---|---|---|
committer | Christopher Tate <ctate@google.com> | 2010-03-12 18:11:00 -0800 |
commit | 3de55bcd34afd5871816526294f9514d1adf3fe5 (patch) | |
tree | 447dbe7ee4ba3ff437b91995495d62c29c41fe14 /services | |
parent | 842f9df2c7944d5d7144b241763c65b497ba9312 (diff) | |
download | frameworks_base-3de55bcd34afd5871816526294f9514d1adf3fe5.zip frameworks_base-3de55bcd34afd5871816526294f9514d1adf3fe5.tar.gz frameworks_base-3de55bcd34afd5871816526294f9514d1adf3fe5.tar.bz2 |
API CHANGE: expose the backup-related ApplicationInfo flag masks
Fixes bug #2507582 by doing the following:
- Un-@hide the FLAG_ALLOW_BACKUP, FLAG_KILL_AFTER_RESTORE, and
FLAG_RESTORE_ANY_VERSION mask constants in ApplicationInfo. These
correspond, respectively, to the <application> manifest tag's
android:allowBackup, android:killAfterRestore, and
android:restoreAnyVersion attributes.
- Remove the android:restoreNeedsApplication attribute and the
corresponding FLAG_RESTORE_NEEDS_APPLICATION constant [which was still
marked @hide]. We now always use the application's own Application
class when performing a normal restore. In the future when we support
an externalized full-filesystem backup/restore operation, we will use
an OS-defined agent class with a base-class Application instance, but
this will not happen until a future release.
Also expands real documentation on the above ApplicationInfo constants;
that work is part of bug #2465360
Change-Id: I735d07a963ae80a01343637d83bef84e4c23fdcc
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/BackupManagerService.java | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java index ffba4ad..dae7f9c 100644 --- a/services/java/com/android/server/BackupManagerService.java +++ b/services/java/com/android/server/BackupManagerService.java @@ -819,8 +819,6 @@ class BackupManagerService extends IBackupManager.Stub { + " uid=" + p.applicationInfo.uid + " killAfterRestore=" + (((p.applicationInfo.flags & ApplicationInfo.FLAG_KILL_AFTER_RESTORE) != 0) ? "true" : "false") - + " restoreNeedsApplication=" - + (((p.applicationInfo.flags & ApplicationInfo.FLAG_RESTORE_NEEDS_APPLICATION) != 0) ? "true" : "false") ); } } @@ -1677,17 +1675,10 @@ class BackupManagerService extends IBackupManager.Stub { + "] is compatible with installed version [" + packageInfo.versionCode + "]"); - // Then set up and bind the agent (with a restricted Application object - // unless the application says otherwise) - boolean useRealApp = (packageInfo.applicationInfo.flags - & ApplicationInfo.FLAG_RESTORE_NEEDS_APPLICATION) != 0; - if (DEBUG && useRealApp) { - Slog.v(TAG, "agent requires real Application subclass for restore"); - } + // Then set up and bind the agent IBackupAgent agent = bindToAgentSynchronous( packageInfo.applicationInfo, - (useRealApp ? IApplicationThread.BACKUP_MODE_INCREMENTAL - : IApplicationThread.BACKUP_MODE_RESTORE)); + IApplicationThread.BACKUP_MODE_INCREMENTAL); if (agent == null) { Slog.w(TAG, "Can't find backup agent for " + packageName); EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE, packageName, |