Merge "Fix issue #5628789: Cannot set static/custom wallpaper after clearing Settings data" into ics-mr1

This commit is contained in:
Dianne Hackborn
2011-11-30 10:20:29 -08:00
committed by Android (Google) Code Review

View File

@ -476,6 +476,13 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
ParcelFileDescriptor updateWallpaperBitmapLocked(String name) {
if (name == null) name = "";
try {
if (!WALLPAPER_DIR.exists()) {
WALLPAPER_DIR.mkdir();
FileUtils.setPermissions(
WALLPAPER_DIR.getPath(),
FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH,
-1, -1);
}
ParcelFileDescriptor fd = ParcelFileDescriptor.open(WALLPAPER_FILE,
MODE_CREATE|MODE_READ_WRITE);
mName = name;