diff options
author | Christopher Tate <ctate@google.com> | 2015-03-12 18:24:30 -0700 |
---|---|---|
committer | Christopher Tate <ctate@google.com> | 2015-03-12 18:24:30 -0700 |
commit | 27aec3c54a0319a989f7969ab6a368e9e1ae9d28 (patch) | |
tree | 1e6502cca63497d8274ec2eaf34ae30051951b41 /services/backup | |
parent | d58617b4f519e69cf8a828210f138d2bcbe4e20a (diff) | |
download | frameworks_base-27aec3c54a0319a989f7969ab6a368e9e1ae9d28.zip frameworks_base-27aec3c54a0319a989f7969ab6a368e9e1ae9d28.tar.gz frameworks_base-27aec3c54a0319a989f7969ab6a368e9e1ae9d28.tar.bz2 |
Don't run full backups until package metadata has been pushed
Bug 19692849
Change-Id: I13615db7408b5c6fbc787c4773103c052e70f0b2
Diffstat (limited to 'services/backup')
-rw-r--r-- | services/backup/java/com/android/server/backup/BackupManagerService.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java index d35609e..8fcdd39 100644 --- a/services/backup/java/com/android/server/backup/BackupManagerService.java +++ b/services/backup/java/com/android/server/backup/BackupManagerService.java @@ -3909,6 +3909,16 @@ public class BackupManagerService { return; } + // Don't proceed unless we have already established package metadata + // for the current dataset via a key/value backup pass. + File stateDir = new File(mBaseStateDir, transport.transportDirName()); + File pmState = new File(stateDir, PACKAGE_MANAGER_SENTINEL); + if (pmState.length() <= 0) { + Slog.i(TAG, "Full backup requested but dataset not yet initialized " + + "via k/v backup pass; ignoring"); + return; + } + // Set up to send data to the transport final int N = mPackages.size(); for (int i = 0; i < N; i++) { |