From ebac48c6adf738cb27ea59669c9eca4467063d18 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 29 Nov 2011 18:01:50 -0800 Subject: [PATCH] Fix issue #5628789: Cannot set static/custom wallpaper after clearing Settings data Need to make sure the "files" directory is created. Change-Id: I8d5b374a5a03590a5ce7fafb5171705414f7b2f9 --- .../java/com/android/server/WallpaperManagerService.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/java/com/android/server/WallpaperManagerService.java b/services/java/com/android/server/WallpaperManagerService.java index 7fa404e854940..4925a4e46e511 100644 --- a/services/java/com/android/server/WallpaperManagerService.java +++ b/services/java/com/android/server/WallpaperManagerService.java @@ -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;