Skip to content

Commit 943da7b

Browse files
Dianne HackbornAndroid (Google) Code Review
authored andcommitted
Merge "Fix issue #5342788: Setting wallpaper from gallery set default..." into ics-mr0
2 parents f1ed59b + 3da3182 commit 943da7b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

services/java/com/android/server/WallpaperManagerService.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
102102
* everytime the wallpaper is changed.
103103
*/
104104
private final FileObserver mWallpaperObserver = new FileObserver(
105-
WALLPAPER_DIR.getAbsolutePath(), CREATE | CLOSE_WRITE | DELETE | DELETE_SELF) {
105+
WALLPAPER_DIR.getAbsolutePath(), CLOSE_WRITE | DELETE | DELETE_SELF) {
106106
@Override
107107
public void onEvent(int event, String path) {
108108
if (path == null) {
@@ -118,8 +118,11 @@ public void onEvent(int event, String path) {
118118
File changedFile = new File(WALLPAPER_DIR, path);
119119
if (WALLPAPER_FILE.equals(changedFile)) {
120120
notifyCallbacksLocked();
121-
if (mWallpaperComponent == null || mImageWallpaperPending) {
122-
mImageWallpaperPending = false;
121+
if (mWallpaperComponent == null || event != CLOSE_WRITE
122+
|| mImageWallpaperPending) {
123+
if (event == CLOSE_WRITE) {
124+
mImageWallpaperPending = false;
125+
}
123126
bindWallpaperComponentLocked(mImageWallpaperComponent,
124127
true, false);
125128
saveSettingsLocked();

0 commit comments

Comments
 (0)