Merge "Workaround for wallpapers render thread been paused while visible." into sc-dev

This commit is contained in:
Wei Sheng Shih
2021-02-04 06:50:49 +00:00
committed by Android (Google) Code Review

View File

@@ -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