summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorChristopher Tate <ctate@android.com>2014-12-13 00:52:08 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-12-13 00:52:14 +0000
commit90c0ae637ab84d1954ce972f55c5d3e2d2b20586 (patch)
tree2931139e32cbf81c86de8ef2765d0e942ec621bd /services
parenta6bfe6c957739fc172dd97ce4e26d8ec4ee4aa6f (diff)
parent52d750c5c24969a6a25f058bf6c724016f319e2b (diff)
downloadframeworks_base-90c0ae637ab84d1954ce972f55c5d3e2d2b20586.zip
frameworks_base-90c0ae637ab84d1954ce972f55c5d3e2d2b20586.tar.gz
frameworks_base-90c0ae637ab84d1954ce972f55c5d3e2d2b20586.tar.bz2
Merge "Check which file changed before requesting backup" into lmp-mr1-dev
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/wallpaper/WallpaperManagerService.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
index 257cbd0..bd2e923 100644
--- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
+++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
@@ -116,6 +116,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
final WallpaperData mWallpaper;
final File mWallpaperDir;
final File mWallpaperFile;
+ final File mWallpaperInfoFile;
public WallpaperObserver(WallpaperData wallpaper) {
super(getWallpaperDir(wallpaper.userId).getAbsolutePath(),
@@ -123,6 +124,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
mWallpaperDir = getWallpaperDir(wallpaper.userId);
mWallpaper = wallpaper;
mWallpaperFile = new File(mWallpaperDir, WALLPAPER);
+ mWallpaperInfoFile = new File(mWallpaperDir, WALLPAPER_INFO);
}
@Override
@@ -131,13 +133,15 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
return;
}
synchronized (mLock) {
- // changing the wallpaper means we'll need to back up the new one
- long origId = Binder.clearCallingIdentity();
- BackupManager bm = new BackupManager(mContext);
- bm.dataChanged();
- Binder.restoreCallingIdentity(origId);
-
File changedFile = new File(mWallpaperDir, path);
+ if (mWallpaperFile.equals(changedFile)
+ || mWallpaperInfoFile.equals(changedFile)) {
+ // changing the wallpaper means we'll need to back up the new one
+ long origId = Binder.clearCallingIdentity();
+ BackupManager bm = new BackupManager(mContext);
+ bm.dataChanged();
+ Binder.restoreCallingIdentity(origId);
+ }
if (mWallpaperFile.equals(changedFile)) {
notifyCallbacksLocked(mWallpaper);
final boolean written = (event == CLOSE_WRITE || event == MOVED_TO);