summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author wilsonshih <wilsonshih@google.com> 2020-06-16 11:47:30 +0800
committer wilsonshih <wilsonshih@google.com> 2020-06-16 12:00:24 +0800
commit5cac2a027968afddc7e1089a9dbb46369874d544 (patch)
treebab37583c35887d75d663f0e651d25c3d781f249
parent5463497bed15a30ce8924640b74971d935a41e8c (diff)
Force relayout when wallpaper engine become visible.
After 9118c9b the surface can be destroy after the window state become invisible, since WallpaperService copy the surface from WMS and it is not implement with ViewRootImpl, WallpaperService#Engine should call relayout to get new surface when client need to redraw it. Bug: 158955956 Test: verify the wallpaper can show by launch LiveWallpaperChange with live wallpaper and push/pull it from recents several times. Test: atest WallpaperServiceTest ImageWallpaperTest Change-Id: I79f97df61696eea325183e9b9057cbb10ce8cc66
-rw-r--r--core/java/android/service/wallpaper/WallpaperService.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java
index f944dd78dc3d..0d420c5936ae 100644
--- a/core/java/android/service/wallpaper/WallpaperService.java
+++ b/core/java/android/service/wallpaper/WallpaperService.java
@@ -1184,7 +1184,8 @@ public abstract class WallpaperService extends Service {
// may have been destroyed so now we need to make
// sure it is re-created.
doOffsetsChanged(false);
- updateSurface(false, false, false);
+ // force relayout to get new surface
+ updateSurface(true, false, false);
}
onVisibilityChanged(visible);
}