summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);