Fix issue #5628789: Cannot set static/custom wallpaper after clearing Settings data

Need to make sure the "files" directory is created.

Change-Id: I8d5b374a5a03590a5ce7fafb5171705414f7b2f9
This commit is contained in:
Dianne Hackborn
2011-11-29 18:01:50 -08:00
parent 1808f214b0
commit ebac48c6ad

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;