From 35af2d967c4e2880436ca47ee9192cf7a3563aa8 Mon Sep 17 00:00:00 2001 From: Uwais Ashraf Date: Mon, 16 Oct 2023 08:53:03 +0000 Subject: [PATCH] Revert "Finish recents animation for standalone recents on home" Revert submission 24941288-b302703228 Reason for revert: Most likely cause of droidmonitored test failures. b/305629625. Original change was merged at this point https://screenshot.googleplex.com/99p3F266XUYYbA2 causing a 100% failure on main. Reverted changes: /q/submissionid:24941288-b302703228 Bug: 305629625 Change-Id: Id27c68ec70410d16aeae3bde8b361d9b347ec7eb --- .../quickstep/TaskAnimationManager.java | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java index c0027ed900..4b47209abd 100644 --- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java +++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java @@ -21,7 +21,6 @@ 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_END_TARGET_ANIMATION_FINISHED; import static com.android.quickstep.GestureState.STATE_RECENTS_ANIMATION_INITIALIZED; import static com.android.quickstep.GestureState.STATE_RECENTS_ANIMATION_STARTED; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.START_RECENTS_ANIMATION; @@ -41,6 +40,7 @@ import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.util.DisplayController; +import com.android.quickstep.TopTaskTracker.CachedTaskInfo; import com.android.quickstep.util.ActiveGestureLog; import com.android.quickstep.views.RecentsView; import com.android.systemui.shared.recents.model.ThumbnailData; @@ -154,24 +154,6 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn mLastAppearedTaskTargets[i] = task; } mLastGestureState.updateLastAppearedTaskTargets(mLastAppearedTaskTargets); - - if (ENABLE_SHELL_TRANSITIONS && mTargets.hasRecents - // The filtered (MODE_CLOSING) targets only contain 1 home activity. - && mTargets.apps.length == 1 - && mTargets.apps[0].windowConfiguration.getActivityType() - == ACTIVITY_TYPE_HOME) { - // This is launching RecentsActivity on top of a 3p launcher. There are no - // other apps need to keep visible so finish the animating state after the - // enter animation of overview is done. Then 3p launcher can be stopped. - mLastGestureState.runOnceAtState(STATE_END_TARGET_ANIMATION_FINISHED, () -> { - // Only finish if the end target is RECENTS. Otherwise, if the target is - // NEW_TASK, startActivityFromRecents will be skipped. - if (mLastGestureState.getEndTarget() == RECENTS) { - finishRunningRecentsAnimation(false /* toHome */, - true /* forceFinish */, null /* forceFinishCb */); - } - }); - } } @Override @@ -274,8 +256,15 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn if (ENABLE_SHELL_TRANSITIONS) { final ActivityOptions options = ActivityOptions.makeBasic(); - // Use regular (non-transient) launch for all apps page to control IME. - if (!activityInterface.allowAllAppsFromOverview()) { + // Allowing to pause Home if Home is top activity and Recents is not Home. So when user + // start home when recents animation is playing, the home activity can be resumed again + // to let the transition controller collect Home activity. + CachedTaskInfo cti = gestureState.getRunningTask(); + boolean homeIsOnTop = cti != null && cti.isHomeTask(); + if (activityInterface.allowAllAppsFromOverview()) { + homeIsOnTop = true; + } + if (!homeIsOnTop) { options.setTransientLaunch(); } options.setSourceInfo(ActivityOptions.SourceInfo.TYPE_RECENTS_ANIMATION, eventTime);