Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a611fdc6 authored by Christopher Tate's avatar Christopher Tate
Browse files

Always store wallpaper metadata to backup

By gating this on system/lock wallpaper imagery state we were
inadvertently missing backup state for some live-wallpaper use
cases.

Bug 31023198

Change-Id: Ie53000453e6618844be7c01766c1b715d14cc713
parent 3dfd09e8
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -147,11 +147,12 @@ public class WallpaperBackupAgent extends BackupAgent {
            }

            // only back up the wallpapers if we've been told they're eligible
            if ((sysEligible || lockEligible) && mWallpaperInfo.exists()) {
            if (mWallpaperInfo.exists()) {
                if (sysChanged || lockChanged || !infoStage.exists()) {
                    if (DEBUG) Slog.v(TAG, "New wallpaper configuration; copying");
                    FileUtils.copyFileOrThrow(mWallpaperInfo, infoStage);
                }
                if (DEBUG) Slog.v(TAG, "Storing wallpaper metadata");
                fullBackupFile(infoStage, data);
            }
            if (sysEligible && mWallpaperFile.exists()) {
@@ -159,6 +160,7 @@ public class WallpaperBackupAgent extends BackupAgent {
                    if (DEBUG) Slog.v(TAG, "New system wallpaper; copying");
                    FileUtils.copyFileOrThrow(mWallpaperFile, imageStage);
                }
                if (DEBUG) Slog.v(TAG, "Storing system wallpaper image");
                fullBackupFile(imageStage, data);
                prefs.edit().putInt(SYSTEM_GENERATION, sysGeneration).apply();
            }
@@ -169,6 +171,7 @@ public class WallpaperBackupAgent extends BackupAgent {
                    if (DEBUG) Slog.v(TAG, "New lock wallpaper; copying");
                    FileUtils.copyFileOrThrow(mLockWallpaperFile, lockImageStage);
                }
                if (DEBUG) Slog.v(TAG, "Storing lock wallpaper image");
                fullBackupFile(lockImageStage, data);
                prefs.edit().putInt(LOCK_GENERATION, lockGeneration).apply();
            }