From ff0f98dd03cc72de55ef27774795e7aac3613027 Mon Sep 17 00:00:00 2001 From: Sihua Ma Date: Thu, 10 Nov 2022 15:12:44 -0800 Subject: [PATCH] Clear drag views during swipe up animation progress This is to avoid clearing it too lately, at a point where the user starts to see a flicker on the screen. There was already a report of this bug. Filing a bug report on my own because the original one is hard to find. I will mark that as fixed once I find it again. Test: Manual Fix: 259157574 Change-Id: Idc9bb67ebf6fc3ff6d78880f28c46d916a02ab77 --- quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index b09e531fab..a413daa510 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -95,6 +95,7 @@ import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.AnimatorPlaybackController; +import com.android.launcher3.dragndrop.DragView; import com.android.launcher3.logging.StatsLogManager; import com.android.launcher3.logging.StatsLogManager.StatsLogger; import com.android.launcher3.statemanager.BaseState; @@ -1363,6 +1364,10 @@ public abstract class AbsSwipeUpHandler, // If we are transitioning to launcher, then listen for the activity to be restarted while // the transition is in progress if (mGestureState.getEndTarget().isLauncher) { + // This is also called when the launcher is resumed, in order to clear the pending + // widgets that have yet to be configured. + DragView.removeAllViews(mActivity); + TaskStackChangeListeners.getInstance().registerTaskStackListener( mActivityRestartListener);