diff options
| author | 2020-12-21 11:56:01 +0800 | |
|---|---|---|
| committer | 2021-02-04 03:25:46 +0000 | |
| commit | ed0a167067bdadc3deff0ce18bbf94fba4cd744a (patch) | |
| tree | 2f2aca0bedaba348c42e90d35acc6b6b463b6f4f | |
| parent | 2122345cc60ed4c9fb9aa92d8cf31d4765812835 (diff) | |
Workaround for wallpapers render thread been paused while visible.
Workaround for some wallpapers cannot trigger the rendering threads of
the remaining engines even if they are visible, so we need to toggle
the state to get their attention.
Bug: 168759123
Test: atest WallpaperManagerTest WallpaperServiceTest
WallpaperServiceTests
Change-Id: I4c047f6e932b280e6408f44e590e39b1a9b62128
| -rw-r--r-- | core/java/android/service/wallpaper/WallpaperService.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java index 507dc7a1d59a..95c959da8456 100644 --- a/core/java/android/service/wallpaper/WallpaperService.java +++ b/core/java/android/service/wallpaper/WallpaperService.java @@ -1494,6 +1494,16 @@ public abstract class WallpaperService extends Service { private void doDetachEngine() { mActiveEngines.remove(mEngine); mEngine.detach(); + // Some wallpapers will not trigger the rendering threads of the remaining engines even + // if they are visible, so we need to toggle the state to get their attention. + if (!mDetached.get()) { + for (Engine eng : mActiveEngines) { + if (eng.mVisible) { + eng.doVisibilityChanged(false); + eng.doVisibilityChanged(true); + } + } + } } @Override |