diff options
author | Christopher Tate <ctate@google.com> | 2013-02-19 14:08:59 -0800 |
---|---|---|
committer | Christopher Tate <ctate@google.com> | 2013-03-08 15:08:10 -0800 |
commit | 294b512ecaa98a6a8ef12285ad14e7a4091b5d57 (patch) | |
tree | d89983eed02f4cc3fc48fb50cd0d779ff345752b /core/java/android/app/backup | |
parent | 2042cc403a6eba2de1c5220e8402b045bdf24192 (diff) | |
download | frameworks_base-294b512ecaa98a6a8ef12285ad14e7a4091b5d57.zip frameworks_base-294b512ecaa98a6a8ef12285ad14e7a4091b5d57.tar.gz frameworks_base-294b512ecaa98a6a8ef12285ad14e7a4091b5d57.tar.bz2 |
DO NOT MERGE - Full backup/restore now handles OBBs sensibly
OBB backup/ restore is no longer handled within the target app
process. This is done to avoid having to require that OBB-using
apps have full read/write permission for external storage.
The new OBB backup service is a new component running in the
same app as the already-existing shared storage backup agent.
The backup infrastructure delegates backup/restore of apps'
OBB contents to this component (because the system process
may not itself read/write external storage).
From the command line, OBB backup is enabled by using new
-obb / -noobb flags with adb backup. The default is noobb.
Finally, a couple of nit fixes:
- buffer-size mismatch between the writer and reader of chunked
file data has been corrected; now the reading side won't be
issuing an extra pipe read per chunk.
- bu now explicitly closes the transport socket fd after
adopting it. This was benign but triggered a logged
warning about leaked fds.
(Cherrypicked)
Change-Id: I471f6348abcccb7bf1e1710b7beda9f23de53e14
Diffstat (limited to 'core/java/android/app/backup')
-rw-r--r-- | core/java/android/app/backup/BackupAgent.java | 1 | ||||
-rw-r--r-- | core/java/android/app/backup/FullBackup.java | 2 | ||||
-rw-r--r-- | core/java/android/app/backup/IBackupManager.aidl | 7 |
3 files changed, 7 insertions, 3 deletions
diff --git a/core/java/android/app/backup/BackupAgent.java b/core/java/android/app/backup/BackupAgent.java index 44aa06f..3425765 100644 --- a/core/java/android/app/backup/BackupAgent.java +++ b/core/java/android/app/backup/BackupAgent.java @@ -472,6 +472,7 @@ public abstract class BackupAgent extends ContextWrapper { File efLocation = getExternalFilesDir(null); if (efLocation != null) { basePath = getExternalFilesDir(null).getCanonicalPath(); + mode = -1; // < 0 is a token to skip attempting a chmod() } } } else { diff --git a/core/java/android/app/backup/FullBackup.java b/core/java/android/app/backup/FullBackup.java index 2fe08f3..cb0737e 100644 --- a/core/java/android/app/backup/FullBackup.java +++ b/core/java/android/app/backup/FullBackup.java @@ -89,7 +89,7 @@ public class FullBackup { * last modification time of the output file. if the {@code mode} parameter is * negative then this parameter will be ignored. * @param outFile Location within the filesystem to place the data. This must point - * to a location that is writeable by the caller, prefereably using an absolute path. + * to a location that is writeable by the caller, preferably using an absolute path. * @throws IOException */ static public void restoreFile(ParcelFileDescriptor data, diff --git a/core/java/android/app/backup/IBackupManager.aidl b/core/java/android/app/backup/IBackupManager.aidl index acdd0b5..bb4f5f1 100644 --- a/core/java/android/app/backup/IBackupManager.aidl +++ b/core/java/android/app/backup/IBackupManager.aidl @@ -152,6 +152,8 @@ interface IBackupManager { * @param fd The file descriptor to which a 'tar' file stream is to be written * @param includeApks If <code>true</code>, the resulting tar stream will include the * application .apk files themselves as well as their data. + * @param includeObbs If <code>true</code>, the resulting tar stream will include any + * application expansion (OBB) files themselves belonging to each application. * @param includeShared If <code>true</code>, the resulting tar stream will include * the contents of the device's shared storage (SD card or equivalent). * @param allApps If <code>true</code>, the resulting tar stream will include all @@ -164,8 +166,9 @@ interface IBackupManager { * @param packageNames The package names of the apps whose data (and optionally .apk files) * are to be backed up. The <code>allApps</code> parameter supersedes this. */ - void fullBackup(in ParcelFileDescriptor fd, boolean includeApks, boolean includeShared, - boolean allApps, boolean allIncludesSystem, in String[] packageNames); + void fullBackup(in ParcelFileDescriptor fd, boolean includeApks, boolean includeObbs, + boolean includeShared, boolean allApps, boolean allIncludesSystem, + in String[] packageNames); /** * Restore device content from the data stream passed through the given socket. The |