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

Commit 72c1ca86 authored by Jay Aliomer's avatar Jay Aliomer
Browse files

Invalidate empty pages at the start of wallpaper

Fixes: 222632463
Test: pick colorful wallpaper and use one page only with widget
Change-Id: Ie20786e0ad72926e029bc34ec379426af3001428
parent a9448a67
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1685,13 +1685,12 @@ public abstract class WallpaperService extends Service {

        void updatePage(EngineWindowPage currentPage, int pageIndx, int numPages,
                float xOffsetStep) {
            // to save creating a runnable, check twice
            long current = System.currentTimeMillis();
            // in case the clock is zero, we start with negative time
            long current = SystemClock.elapsedRealtime() - DEFAULT_UPDATE_SCREENSHOT_DURATION;
            long lapsed = current - currentPage.getLastUpdateTime();
            // Always update the page when the last update time is <= 0
            // This is important especially when the device first boots
            if (lapsed < DEFAULT_UPDATE_SCREENSHOT_DURATION
                    && currentPage.getLastUpdateTime() > 0) {
            if (lapsed < DEFAULT_UPDATE_SCREENSHOT_DURATION) {
                return;
            }
            Surface surface = mSurfaceHolder.getSurface();