From c5be8f8a4b9946f26f43201a06e7ec3f9b34857e Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Mon, 25 Apr 2016 14:41:50 -0700 Subject: [PATCH] Correct docs about what is ignored in full-data backup You can't back up content in e.g. getNoBackupFilesDir() even if your app explicitly tries to. Bug 28321431 Change-Id: Ifa2a4bc518de03aba4c8809e60d8bb90fce767f8 --- core/java/android/app/backup/BackupAgent.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/java/android/app/backup/BackupAgent.java b/core/java/android/app/backup/BackupAgent.java index 8e515e2b579cb..bc8280681e4a1 100644 --- a/core/java/android/app/backup/BackupAgent.java +++ b/core/java/android/app/backup/BackupAgent.java @@ -488,9 +488,11 @@ public abstract class BackupAgent extends ContextWrapper { * to place it with the proper location and permissions on the device where the * data is restored. * - *

It is safe to explicitly back up files underneath your application's - * {@link #getNoBackupFilesDir()} directory, and they will be restored to that - * location correctly. + *

Attempting to back up files in directories that are ignored by + * the backup system will have no effect. For example, if the app calls this method + * with a file inside the {@link #getNoBackupFilesDir()} directory, it will be ignored. + * See {@link #onFullBackup(FullBackupDataOutput) for details on what directories + * are excluded from backups. * * @param file The file to be backed up. The file must exist and be readable by * the caller.