Loading core/java/android/app/backup/WallpaperBackupHelper.java +5 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ public class WallpaperBackupHelper extends FileBackupHelperBase implements Backu // If 'true', then apply an acceptable-size heuristic at restore time, dropping back // to the factory default wallpaper if the restored one differs "too much" from the // device's preferred wallpaper image dimensions. private static final boolean REJECT_OUTSIZED_RESTORE = true; private static final boolean REJECT_OUTSIZED_RESTORE = false; // When outsized restore rejection is enabled, this is the maximum ratio between the // source and target image heights that will be permitted. The ratio is checked both Loading @@ -60,6 +60,9 @@ public class WallpaperBackupHelper extends FileBackupHelperBase implements Backu public static final String WALLPAPER_IMAGE = new File(Environment.getUserSystemDirectory(UserHandle.USER_SYSTEM), "wallpaper").getAbsolutePath(); public static final String WALLPAPER_ORIG_IMAGE = new File(Environment.getUserSystemDirectory(UserHandle.USER_SYSTEM), "wallpaper_orig").getAbsolutePath(); public static final String WALLPAPER_INFO = new File(Environment.getUserSystemDirectory(UserHandle.USER_SYSTEM), "wallpaper_info.xml").getAbsolutePath(); Loading Loading @@ -199,7 +202,7 @@ public class WallpaperBackupHelper extends FileBackupHelperBase implements Backu // since it does not exist anywhere other than the private wallpaper // file. Slog.d(TAG, "Applying restored wallpaper image."); f.renameTo(new File(WALLPAPER_IMAGE)); f.renameTo(new File(WALLPAPER_ORIG_IMAGE)); } } } services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +3 −3 Original line number Diff line number Diff line Loading @@ -252,6 +252,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { if (DEBUG) { Slog.v(TAG, "Wallpaper written; generating crop"); } SELinux.restorecon(changedFile); if (moved) { // This is a restore, so generate the crop using any just-restored new // crop guidelines, making sure to preserve our local dimension hints. Loading @@ -259,7 +260,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { if (DEBUG) { Slog.v(TAG, "moved-to, therefore restore; reloading metadata"); } SELinux.restorecon(changedFile); loadSettingsLocked(wallpaper.userId, true); } generateCrop(wallpaper); Loading Loading @@ -353,8 +353,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { (cropHint.bottom > options.outHeight ? options.outHeight - cropHint.bottom : 0)); // Don't bother cropping if what we're left with is identity needCrop = (options.outHeight >= cropHint.height() && options.outWidth >= cropHint.width()); needCrop = (options.outHeight > cropHint.height() && options.outWidth > cropHint.width()); } // scale if the crop height winds up not matching the recommended metrics Loading Loading
core/java/android/app/backup/WallpaperBackupHelper.java +5 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ public class WallpaperBackupHelper extends FileBackupHelperBase implements Backu // If 'true', then apply an acceptable-size heuristic at restore time, dropping back // to the factory default wallpaper if the restored one differs "too much" from the // device's preferred wallpaper image dimensions. private static final boolean REJECT_OUTSIZED_RESTORE = true; private static final boolean REJECT_OUTSIZED_RESTORE = false; // When outsized restore rejection is enabled, this is the maximum ratio between the // source and target image heights that will be permitted. The ratio is checked both Loading @@ -60,6 +60,9 @@ public class WallpaperBackupHelper extends FileBackupHelperBase implements Backu public static final String WALLPAPER_IMAGE = new File(Environment.getUserSystemDirectory(UserHandle.USER_SYSTEM), "wallpaper").getAbsolutePath(); public static final String WALLPAPER_ORIG_IMAGE = new File(Environment.getUserSystemDirectory(UserHandle.USER_SYSTEM), "wallpaper_orig").getAbsolutePath(); public static final String WALLPAPER_INFO = new File(Environment.getUserSystemDirectory(UserHandle.USER_SYSTEM), "wallpaper_info.xml").getAbsolutePath(); Loading Loading @@ -199,7 +202,7 @@ public class WallpaperBackupHelper extends FileBackupHelperBase implements Backu // since it does not exist anywhere other than the private wallpaper // file. Slog.d(TAG, "Applying restored wallpaper image."); f.renameTo(new File(WALLPAPER_IMAGE)); f.renameTo(new File(WALLPAPER_ORIG_IMAGE)); } } }
services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +3 −3 Original line number Diff line number Diff line Loading @@ -252,6 +252,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { if (DEBUG) { Slog.v(TAG, "Wallpaper written; generating crop"); } SELinux.restorecon(changedFile); if (moved) { // This is a restore, so generate the crop using any just-restored new // crop guidelines, making sure to preserve our local dimension hints. Loading @@ -259,7 +260,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { if (DEBUG) { Slog.v(TAG, "moved-to, therefore restore; reloading metadata"); } SELinux.restorecon(changedFile); loadSettingsLocked(wallpaper.userId, true); } generateCrop(wallpaper); Loading Loading @@ -353,8 +353,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { (cropHint.bottom > options.outHeight ? options.outHeight - cropHint.bottom : 0)); // Don't bother cropping if what we're left with is identity needCrop = (options.outHeight >= cropHint.height() && options.outWidth >= cropHint.width()); needCrop = (options.outHeight > cropHint.height() && options.outWidth > cropHint.width()); } // scale if the crop height winds up not matching the recommended metrics Loading