3 Commits

Author SHA1 Message Date
Christopher Tate
fb2ea43112 Fix full backup of shared storage
The manifest said android:allowBackup="false" for vestigal reasons;
originally, the incremental and full backup agents were separate, and
it was not possible to opt out of full backup.  When that got fixed,
unfortunately this one manifest was not corrected to the new regime.

Bug 5411789

Change-Id: Iafc8f1fdefc312dff59454485604b6c5c400f469
2011-10-18 15:47:59 -07:00
Christopher Tate
79ec80db70 Make full backup API available to apps
New methods for full backup/restore have been added to BackupAgent
(still hidden): onFullBackup() and onRestoreFile().  The former is the
entry point for a full app backup to adb/socket/etc: the app then writes
all of its files, entire, to the output.  During restore, the latter
new callback is invoked, once for each file being restored.

The full backup/restore interface does not use the previously-defined
BackupDataInput / BackupDataOutput classes, because those classes
provide an API designed for incremental key/value data structuring.
Instead, a new FullBackupDataOutput class has been introduced, through
which we restrict apps' abilities to write data during a full backup
operation to *only* writing entire on-disk files via a new BackupAgent
method called fullBackupFile().

"FullBackupAgent" exists now solely as a concrete shell class that
can be instantiated in the case of apps that do not have their own
BackupAgent implementations.

Along with the API change, responsibility for backing up the .apk
file and OBB container has been moved into the framework rather than
have the application side of the transaction do it.

Change-Id: I12849b06b1a6e4c44d080587c1e9828a52b70dae
2011-07-06 14:40:32 -07:00
Christopher Tate
b0628bfd5a Implement shared-storage full backup/restore
Every available shared-storage volume is backed up, tagged with its
ordinal in the set of mounted shared volumes.  This is an approximation
of "internal + the external card".  This lets us restore things to the
same volume [or "equivalent" volume, in the case of a cross-model
restore] as they originated on.

Also fixed a bug in the handling of files/dirs with spaces in
their names.

Change-Id: I380019da8d0bb5b3699bd7c11eeff621a88e78c3
2011-06-07 12:16:27 -07:00