Merge "Update wallpaper offset when changing target from null" into sc-dev am: ccdb324274 am: a1d274c92a am: 04a301b6de

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15521640

Change-Id: Ic1cde13ed66474684d1f8d65e1d453405dd47d67
diff --git a/services/core/java/com/android/server/wm/WallpaperController.java b/services/core/java/com/android/server/wm/WallpaperController.java
index 0f61f1a..7893612 100644
--- a/services/core/java/com/android/server/wm/WallpaperController.java
+++ b/services/core/java/com/android/server/wm/WallpaperController.java
@@ -559,6 +559,9 @@
         final WindowState prevWallpaperTarget = mWallpaperTarget;
         mWallpaperTarget = wallpaperTarget;
 
+        if (prevWallpaperTarget == null && wallpaperTarget != null) {
+            updateWallpaperOffsetLocked(mWallpaperTarget, false);
+        }
         if (wallpaperTarget == null || prevWallpaperTarget == null) {
             return;
         }