Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed0a1670 authored by wilsonshih's avatar wilsonshih Committed by Wei Sheng Shih
Browse files

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
parent 2122345c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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