From d21f004f1e43ac39755a11c7b434df257f719e0e Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Sat, 27 May 2023 00:59:57 +0800 Subject: [PATCH] Invoke redraw callback for wallpaper if size is changed As the comment of SurfaceHolder.Callback2#surfaceRedrawNeeded: Called when the application needs to redraw the content of its surface, after it is resized or for some other reason. In case some path other than handleResized calls updateSurface without requesting redraw but triggers a size change. Bug: 283952978 Test: Unlock to an app with different orientation and off/on screen again quickly. Change-Id: I9951bc85628e93547d36a2936e3c7c6162d55c49 --- core/java/android/service/wallpaper/WallpaperService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java index 7f0a666da91fa..4e086c2ad134c 100644 --- a/core/java/android/service/wallpaper/WallpaperService.java +++ b/core/java/android/service/wallpaper/WallpaperService.java @@ -1391,7 +1391,7 @@ public abstract class WallpaperService extends Service { Trace.endSection(); } - if (redrawNeeded) { + if (redrawNeeded || sizeChanged) { Trace.beginSection("WPMS.Engine.onSurfaceRedrawNeeded"); onSurfaceRedrawNeeded(mSurfaceHolder); Trace.endSection();