summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Android (Google) Code Review <android-gerrit@google.com> 2009-11-12 09:52:10 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2009-11-12 09:52:10 -0800
commitddf157cae48a17e72e740538a981a63394ec2274 (patch)
tree4c8334c734fcbd874ea0bc9780edf5197f13624e
parent3c58d279abed1da56b0ece74ded5854c509a42a4 (diff)
parent541fa51e5ccba9e2def2632f9835db0c9407ec5c (diff)
Merge change I5ae73af7 into eclair
* changes: Don't back up system wallpapers.
-rw-r--r--services/java/com/android/server/SystemBackupAgent.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/services/java/com/android/server/SystemBackupAgent.java b/services/java/com/android/server/SystemBackupAgent.java
index 8903ebdbeb73..67abe554f61b 100644
--- a/services/java/com/android/server/SystemBackupAgent.java
+++ b/services/java/com/android/server/SystemBackupAgent.java
@@ -45,8 +45,16 @@ public class SystemBackupAgent extends BackupHelperAgent {
public void onBackup(ParcelFileDescriptor oldState, BackupDataOutput data,
ParcelFileDescriptor newState) throws IOException {
// We only back up the data under the current "wallpaper" schema with metadata
- addHelper("wallpaper", new AbsoluteFileBackupHelper(SystemBackupAgent.this,
- new String[] { WALLPAPER_IMAGE, WALLPAPER_INFO }));
+ WallpaperManagerService wallpaper = (WallpaperManagerService)ServiceManager.getService(
+ Context.WALLPAPER_SERVICE);
+ String[] files = new String[] { WALLPAPER_IMAGE, WALLPAPER_INFO };
+ if (wallpaper != null && wallpaper.mName != null && wallpaper.mName.length() > 0) {
+ // When the wallpaper has a name, back up the info by itself.
+ // TODO: Don't rely on the innards of the service object like this!
+ // TODO: Send a delete for any stored wallpaper image in this case?
+ files = new String[] { WALLPAPER_INFO };
+ }
+ addHelper("wallpaper", new AbsoluteFileBackupHelper(SystemBackupAgent.this, files));
super.onBackup(oldState, data, newState);
}