summaryrefslogtreecommitdiff
path: root/packages/WallpaperBackup
diff options
context:
space:
mode:
authorBryan Mawhinney <bryanmawhinney@google.com>2019-01-25 18:26:36 +0000
committerBryan Mawhinney <bryanmawhinney@google.com>2019-02-15 17:26:51 +0000
commit9cd567fb24088fdf2bbc735a43d943d7f5ed8040 (patch)
tree4acc0c8ba2909c843006d40c13594380a52147ef /packages/WallpaperBackup
parentcb889759ae1654c2b5730a72398db812df57d678 (diff)
Don't touch empty wallpaper sentinel every backup.
Even when the diffing algorithm is good (which it may not always be), it isn't free to apply the diff server side. Test: manual Change-Id: I01859a57b0a0a974b541ce03f7c35a2977df7f7c
Diffstat (limited to 'packages/WallpaperBackup')
-rw-r--r--packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java b/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java
index 4254a0ba200a..2e40c1acfa2c 100644
--- a/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java
+++ b/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java
@@ -115,8 +115,10 @@ public class WallpaperBackupAgent extends BackupAgent {
// We always back up this 'empty' file to ensure that the absence of
// storable wallpaper imagery still produces a non-empty backup data
// stream, otherwise it'd simply be ignored in preflight.
- FileOutputStream touch = new FileOutputStream(empty);
- touch.close();
+ if (!empty.exists()) {
+ FileOutputStream touch = new FileOutputStream(empty);
+ touch.close();
+ }
fullBackupFile(empty, data);
SharedPreferences prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);