From 0033148ef0e62eff495a02e147221275b10a897c Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Wed, 18 Sep 2024 10:06:14 +0100 Subject: [PATCH] Only call reset() when transitioning to a State that doesn't have RecentView visible - Changes to BaseRecentsViewStateController/FallbackRecentsStateController to avoid calling reset when canceling transitioniong to a RecentsView visible state (e.g. canceling Overivew -> OverivewModal) - Changes to LauncherRecentsView/FallbackRecentsView to have a consistent check in deciding if we should reset on transition finished - Note: With 3P Launcher, there is an existing issue that isn't fix by this change: While in Overview or Split select, tap empty space to dismiss Recentsview, then immediately swipe up, Overview tiles will be blank. This is because the swipe up isn't a "brand new" gesture and doesn't call onGestureAnimationStart, so it does not reload thumbnails after the reset in animation cancels. Fix: 359872614 Test: Reproduction steps in b/246232494, b/243471493, b/242715097 and b/359872614 Test: Trasitionoing between Normal,Hint,Overview,OverivewModal,QuickSwitch etc., and which Home/Back gesture in between to cancel the transitions; repeat the test with 3P Launcher Flag: EXEMPT BUG_FIX Change-Id: I86dd0c070196c9a7ce3269599811b7537dd4da37 --- .../uioverrides/BaseRecentsViewStateController.java | 2 +- .../quickstep/fallback/FallbackRecentsStateController.java | 2 +- .../com/android/quickstep/fallback/FallbackRecentsView.java | 3 +-- .../com/android/quickstep/views/LauncherRecentsView.java | 6 +----- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java index 14d391ba1c..bcad478eae 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java @@ -86,7 +86,7 @@ public abstract class BaseRecentsViewStateController } setStateWithAnimationInternal(toState, config, builder); builder.addEndListener(success -> { - if (!success) { + if (!success && !toState.isRecentsViewVisible) { mRecentsView.reset(); } }); diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java index 94764a58cc..8696be21d5 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java @@ -81,7 +81,7 @@ public class FallbackRecentsStateController implements StateHandler mRecentsView.loadVisibleTaskData(FLAG_UPDATE_ALL)); setter.addEndListener(success -> { - if (!success) { + if (!success && !toState.isRecentsViewVisible()) { mRecentsView.reset(); } }); diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java index e67a9bc1b6..91344b01c0 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java @@ -19,7 +19,6 @@ import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static com.android.quickstep.GestureState.GestureEndTarget.RECENTS; import static com.android.quickstep.fallback.RecentsState.DEFAULT; -import static com.android.quickstep.fallback.RecentsState.HOME; import static com.android.quickstep.fallback.RecentsState.MODAL_TASK; import static com.android.quickstep.fallback.RecentsState.OVERVIEW_SPLIT_SELECT; @@ -260,7 +259,7 @@ public class FallbackRecentsView extends RecentsView