From 9c102e56347bf376fb057d0d8711886e15597c13 Mon Sep 17 00:00:00 2001 From: vadimt Date: Wed, 31 May 2023 10:59:25 -0700 Subject: [PATCH] Fixing a flake when workspace loading never finishes. The flake was caused by the fact that addOnDrawListener(), the redraw is not guaranteed. This ultimately results to the workspace loading never finishing. Forcing the redraw. Bug: 267200150 Test: atest Launcher3Tests:com.android.launcher3.celllayout.ReorderWidgets#simpleReorder --rerun-until-failure Flag: N/A Change-Id: I47683425150a07ab2632e2bebdeca4d304e30d1b --- src/com/android/launcher3/util/ViewOnDrawExecutor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/android/launcher3/util/ViewOnDrawExecutor.java b/src/com/android/launcher3/util/ViewOnDrawExecutor.java index c2767beb3d..fada4a3f01 100644 --- a/src/com/android/launcher3/util/ViewOnDrawExecutor.java +++ b/src/com/android/launcher3/util/ViewOnDrawExecutor.java @@ -59,6 +59,7 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable, private void attachObserver() { if (!mCompleted) { mAttachedView.getViewTreeObserver().addOnDrawListener(this); + mAttachedView.getRootView().invalidate(); } }