summaryrefslogtreecommitdiff
path: root/packages/WallpaperBackup
diff options
context:
space:
mode:
authorBryan Mawhinney <bryanmawhinney@google.com>2017-02-07 15:18:07 +0000
committerBryan Mawhinney <bryanmawhinney@google.com>2017-02-07 15:30:06 +0000
commit5c14853296172fe9885eee26d86351bd935e8430 (patch)
treead59278ccafbc07a79c17c8f350ff5d365dabecd /packages/WallpaperBackup
parent6c149326d8d1ef0f8bf6dad702ffca399364d0d3 (diff)
Workaround wallpaper restore race
If WallpaperManager is asked to read a wallpaper between when we call mWm.clear and mWm.setStream, it is possible for us to end up losing restored state such as cropHint and allowBackup By not calling mWm.clear, we make this much less likely to happen. It isn't necessary to call clear, as will explicitly overwrite all the interesting state anyway. Test: by repeated adb restore Bug: 34760753 Change-Id: I2750695d5dd16077b47b5b8fca3a667b98cc4f6c
Diffstat (limited to 'packages/WallpaperBackup')
-rw-r--r--packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java3
1 files changed, 0 insertions, 3 deletions
diff --git a/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java b/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java
index ff934ef18677..19da32c83cd5 100644
--- a/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java
+++ b/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java
@@ -217,9 +217,6 @@ public class WallpaperBackupAgent extends BackupAgent {
final int sysWhich = FLAG_SYSTEM | (lockImageStage.exists() ? 0 : FLAG_LOCK);
try {
- // First off, revert to the factory state
- mWm.clear(FLAG_SYSTEM | FLAG_LOCK);
-
// It is valid for the imagery to be absent; it means that we were not permitted
// to back up the original image on the source device, or there was no user-supplied
// wallpaper image present.