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
diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
index 14d391b..bcad478 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
@@ -86,7 +86,7 @@
}
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 94764a5..8696be2 100644
--- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java
+++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java
@@ -81,7 +81,7 @@
// While animating into recents, update the visible task data as needed
setter.addOnFrameCallback(() -> 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 e67a9bc..91344b0 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 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 @@
@Override
public void onStateTransitionComplete(RecentsState finalState) {
- if (finalState == HOME) {
+ if (!finalState.isRecentsViewVisible()) {
// Clean-up logic that occurs when recents is no longer in use/visible.
reset();
}
diff --git a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
index d20d0a5..c89eaaf 100644
--- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
@@ -17,14 +17,11 @@
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
-import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.CLEAR_ALL_BUTTON;
-import static com.android.launcher3.LauncherState.EDIT_MODE;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK;
import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
-import static com.android.launcher3.LauncherState.SPRING_LOADED;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SPLIT_SELECTION_EXIT_HOME;
import static com.android.wm.shell.shared.desktopmode.DesktopModeFlags.WALLPAPER_ACTIVITY;
@@ -173,8 +170,7 @@
@Override
public void onStateTransitionComplete(LauncherState finalState) {
- if (finalState == NORMAL || finalState == SPRING_LOADED || finalState == EDIT_MODE
- || finalState == ALL_APPS) {
+ if (!finalState.isRecentsViewVisible) {
// Clean-up logic that occurs when recents is no longer in use/visible.
reset();
}