diff options
| author | Christopher Tate <ctate@google.com> | 2013-03-08 23:26:35 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-03-08 23:26:36 +0000 |
| commit | 28d4f210f17fa2ea46f155bc246953e23cf9addc (patch) | |
| tree | 5477d4e57155d44d4217138bead7cef46dc4477f /core/java | |
| parent | b349883487e06ec8cd07d3e1adc97819c8c66d93 (diff) | |
| parent | 294b512ecaa98a6a8ef12285ad14e7a4091b5d57 (diff) | |
Merge "DO NOT MERGE - Full backup/restore now handles OBBs sensibly" into jb-mr2-dev
Diffstat (limited to 'core/java')
4 files changed, 52 insertions, 3 deletions
diff --git a/core/java/android/app/backup/BackupAgent.java b/core/java/android/app/backup/BackupAgent.java index 44aa06fecd74..342576553b61 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 2fe08f34b49e..cb0737e3ad72 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 acdd0b54559a..bb4f5f160bbe 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 diff --git a/core/java/com/android/internal/backup/IObbBackupService.aidl b/core/java/com/android/internal/backup/IObbBackupService.aidl new file mode 100644 index 000000000000..426dbc4009c5 --- /dev/null +++ b/core/java/com/android/internal/backup/IObbBackupService.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2013, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.internal.backup; + +import android.app.backup.IBackupManager; +import android.os.ParcelFileDescriptor; + +/** + * Interface for the Backup Manager Service to communicate with a helper service that + * handles local (whole-file) backup & restore of OBB content on behalf of applications. + * This can't be done within the Backup Manager Service itself because of the restrictions + * on system-user access to external storage, and can't be left to the apps because even + * apps that do not have permission to access external storage in the usual way can still + * use OBBs. + * + * {@hide} + */ +oneway interface IObbBackupService { + /* + * Back up a package's OBB directory tree + */ + void backupObbs(in String packageName, in ParcelFileDescriptor data, + int token, in IBackupManager callbackBinder); + + /* + * Restore an OBB file for the given package from the incoming stream + */ + void restoreObbFile(in String pkgName, in ParcelFileDescriptor data, + long fileSize, int type, in String path, long mode, long mtime, + int token, in IBackupManager callbackBinder); +} |
