Merge "Invalidate empty pages at the start of wallpaper" into tm-dev am: 16d2613662

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17756831

Change-Id: I8949aee3725454b21846b90313c7b9460bf745e0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Lucas Dupin
2022-04-14 23:29:22 +00:00
committed by Automerger Merge Worker

View File

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