From 2b3dc6f73007f8b7d97ae2972e37c5d055659c8b Mon Sep 17 00:00:00 2001 From: randypfohl Date: Thu, 20 Jul 2023 12:53:31 -0700 Subject: [PATCH] Removing obsolete call to start home activity with shell transitions - The second start activity was causing issues with 3p launchers which may not expect another new intent (ie. if it handles gestures at the bottom of the screen). We can't completely remove this logic because for button navigation we don't want to fall through to the launch-next-task animation below, but we can can continue to finish the recents animation immediately. - With shell transitions, leashes for opening apps are always hidden by default so when transitioning to a 3p launcher from RecentsActivity we also need to show the surface if we want to animate it in Bug: 289609734 Test: Set 3p Launcher as default, in both gesture & button navigation - Go from 3p home -> overview, then overview -> 3p home - Go from app -> 3p home - Go from app -> overview, then overview -> 3p home - Quickswitch from app Change-Id: I6875083931de63a8097d23d180553885ed7cfb01 Signed-off-by: Winson Chung --- .../android/quickstep/FallbackSwipeHandler.java | 1 + .../android/quickstep/TaskAnimationManager.java | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java b/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java index 1913091695..eff53f3c85 100644 --- a/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java +++ b/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java @@ -139,6 +139,7 @@ public class FallbackSwipeHandler extends mTmpMatrix.setScale(scale, scale, app.localBounds.exactCenterX(), app.localBounds.exactCenterY()); builder.setMatrix(mTmpMatrix).setAlpha(alpha); + builder.setShow(); } @Override diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java index 410ba21866..eacca0dbab 100644 --- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java +++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java @@ -19,6 +19,7 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; +import static com.android.launcher3.util.NavigationMode.NO_BUTTON; import static com.android.quickstep.GestureState.GestureEndTarget.RECENTS; import static com.android.quickstep.GestureState.STATE_RECENTS_ANIMATION_INITIALIZED; import static com.android.quickstep.GestureState.STATE_RECENTS_ANIMATION_STARTED; @@ -37,6 +38,7 @@ import androidx.annotation.UiThread; import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; +import com.android.launcher3.util.DisplayController; import com.android.quickstep.TopTaskTracker.CachedTaskInfo; import com.android.quickstep.util.ActiveGestureLog; import com.android.quickstep.views.DesktopTaskView; @@ -162,10 +164,16 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn for (RemoteAnimationTarget compat : appearedTaskTargets) { if (compat.windowConfiguration.getActivityType() == ACTIVITY_TYPE_HOME - && activityInterface.getCreatedActivity() instanceof RecentsActivity) { - // When receive opening home activity while recents is running, enter home - // and dismiss recents. - ((RecentsActivity) activityInterface.getCreatedActivity()).startHome(); + && activityInterface.getCreatedActivity() instanceof RecentsActivity + && DisplayController.getNavigationMode(mCtx) != NO_BUTTON) { + // The only time we get onTasksAppeared() in button navigation with a + // 3p launcher is if the user goes to overview first, and in this case we + // can immediately finish the transition + RecentsView recentsView = + activityInterface.getCreatedActivity().getOverviewPanel(); + if (recentsView != null) { + recentsView.finishRecentsAnimation(true, null); + } return; } }