diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index 4a1035fd56..e51c956016 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -65,7 +65,6 @@ import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VAL import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs; import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION; import static com.android.launcher3.views.FloatingIconView.getFloatingIconView; -import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS; import static com.android.quickstep.TaskViewUtils.findTaskViewToLaunch; import static com.android.quickstep.util.AnimUtils.clampToDuration; import static com.android.quickstep.util.AnimUtils.completeRunnableListCallback; @@ -1228,9 +1227,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener * Registers remote animations used when closing apps to home screen. */ public void registerRemoteTransitions() { - if (ENABLE_SHELL_TRANSITIONS) { - SystemUiProxy.INSTANCE.get(mLauncher).shareTransactionQueue(); - } + SystemUiProxy.INSTANCE.get(mLauncher).shareTransactionQueue(); if (SEPARATE_RECENTS_ACTIVITY.get()) { return; } @@ -1294,9 +1291,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener } protected void unregisterRemoteTransitions() { - if (ENABLE_SHELL_TRANSITIONS) { - SystemUiProxy.INSTANCE.get(mLauncher).unshareTransactionQueue(); - } + SystemUiProxy.INSTANCE.get(mLauncher).unshareTransactionQueue(); if (SEPARATE_RECENTS_ACTIVITY.get()) { return; } diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java index b63b9ddab2..02ece8e2d5 100644 --- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java @@ -19,7 +19,6 @@ import static com.android.launcher3.QuickstepTransitionManager.TRANSIENT_TASKBAR import static com.android.launcher3.statemanager.BaseState.FLAG_NON_INTERACTIVE; import static com.android.launcher3.taskbar.TaskbarEduTooltipControllerKt.TOOLTIP_STEP_FEATURES; import static com.android.launcher3.taskbar.TaskbarLauncherStateController.FLAG_VISIBLE; -import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS; import static com.android.wm.shell.shared.desktopmode.DesktopModeFlags.WALLPAPER_ACTIVITY; import android.animation.Animator; @@ -232,9 +231,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController { LauncherState state = mLauncher.getStateManager().getState(); boolean nonInteractiveState = state.hasFlag(FLAG_NON_INTERACTIVE) && !state.isTaskbarAlignedWithHotseat(mLauncher); - if ((ENABLE_SHELL_TRANSITIONS - && isVisible - && (nonInteractiveState || mSkipLauncherVisibilityChange))) { + if (isVisible && (nonInteractiveState || mSkipLauncherVisibilityChange)) { return null; } diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 17735e10dc..f67d49aa9c 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -499,10 +499,8 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer, boolean started = ((getActivityFlags() & ACTIVITY_STATE_STARTED)) != 0; if (started) { DeviceProfile profile = getDeviceProfile(); - boolean willUserBeActive = - (getActivityFlags() & ACTIVITY_STATE_USER_WILL_BE_ACTIVE) != 0; boolean visible = (state == NORMAL || state == OVERVIEW) - && (willUserBeActive || isUserActive()) + && isUserActive() && !profile.isVerticalBarLayout() && !mIsOverlayVisible; SystemUiProxy.INSTANCE.get(this) @@ -1279,10 +1277,6 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer, return ObjectWrapper.wrap(new Integer(info.id)); } - public void setHintUserWillBeActive() { - addActivityFlags(ACTIVITY_STATE_USER_WILL_BE_ACTIVE); - } - @Override public void onDisplayInfoChanged(Context context, DisplayController.Info info, int flags) { super.onDisplayInfoChanged(context, info, flags); diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java index 262564613a..1ba784bb6e 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java @@ -17,7 +17,6 @@ package com.android.launcher3.uioverrides.states; import static com.android.launcher3.Flags.enableScalingRevealHomeAnimation; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND; -import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS; import android.content.Context; import android.graphics.Color; @@ -107,8 +106,7 @@ public class BackgroundAppState extends OverviewState { @Override public boolean isTaskbarAlignedWithHotseat(Launcher launcher) { - if (ENABLE_SHELL_TRANSITIONS) return false; - return super.isTaskbarAlignedWithHotseat(launcher); + return false; } @Override diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 5392b70703..3d8c1f984f 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -939,7 +939,6 @@ public abstract class AbsSwipeUpHandler mListeners = new ArraySet<>(); private final SystemUiProxy mSystemUiProxy; - private final boolean mAllowMinimizeSplitScreen; // TODO(141886704): Remove these references when they are no longer needed private RecentsAnimationController mController; private boolean mCancelled; - public RecentsAnimationCallbacks(SystemUiProxy systemUiProxy, - boolean allowMinimizeSplitScreen) { + public RecentsAnimationCallbacks(SystemUiProxy systemUiProxy) { mSystemUiProxy = systemUiProxy; - mAllowMinimizeSplitScreen = allowMinimizeSplitScreen; } @UiThread @@ -122,7 +119,7 @@ public class RecentsAnimationCallbacks implements } mController = new RecentsAnimationController(animationController, - mAllowMinimizeSplitScreen, this::onAnimationFinished); + this::onAnimationFinished); if (mCancelled) { Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), mController::finishAnimationToApp); @@ -219,7 +216,6 @@ public class RecentsAnimationCallbacks implements public void dump(String prefix, PrintWriter pw) { pw.println(prefix + "RecentsAnimationCallbacks:"); - pw.println(prefix + "\tmAllowMinimizeSplitScreen=" + mAllowMinimizeSplitScreen); pw.println(prefix + "\tmCancelled=" + mCancelled); } diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationController.java b/quickstep/src/com/android/quickstep/RecentsAnimationController.java index 1b05e284be..adcf4ef6cd 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationController.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationController.java @@ -17,7 +17,6 @@ package com.android.quickstep; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; -import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.FINISH_RECENTS_ANIMATION; import android.content.Context; @@ -52,21 +51,17 @@ public class RecentsAnimationController { private static final String TAG = "RecentsAnimationController"; private final RecentsAnimationControllerCompat mController; private final Consumer mOnFinishedListener; - private final boolean mAllowMinimizeSplitScreen; private boolean mUseLauncherSysBarFlags = false; - private boolean mSplitScreenMinimized = false; private boolean mFinishRequested = false; // Only valid when mFinishRequested == true. private boolean mFinishTargetIsLauncher; private RunnableList mPendingFinishCallbacks = new RunnableList(); public RecentsAnimationController(RecentsAnimationControllerCompat controller, - boolean allowMinimizeSplitScreen, Consumer onFinishedListener) { mController = controller; mOnFinishedListener = onFinishedListener; - mAllowMinimizeSplitScreen = allowMinimizeSplitScreen; } /** @@ -85,33 +80,16 @@ public class RecentsAnimationController { if (mUseLauncherSysBarFlags != useLauncherSysBarFlags) { mUseLauncherSysBarFlags = useLauncherSysBarFlags; UI_HELPER_EXECUTOR.execute(() -> { - if (!ENABLE_SHELL_TRANSITIONS) { - mController.setAnimationTargetsBehindSystemBars(!useLauncherSysBarFlags); - } else { - try { - WindowManagerGlobal.getWindowManagerService().setRecentsAppBehindSystemBars( - useLauncherSysBarFlags); - } catch (RemoteException e) { - Log.e(TAG, "Unable to reach window manager", e); - } + try { + WindowManagerGlobal.getWindowManagerService().setRecentsAppBehindSystemBars( + useLauncherSysBarFlags); + } catch (RemoteException e) { + Log.e(TAG, "Unable to reach window manager", e); } }); } } - /** - * Indicates that the gesture has crossed the window boundary threshold and we should minimize - * if we are in splitscreen. - */ - public void setSplitScreenMinimized(Context context, boolean splitScreenMinimized) { - if (!mAllowMinimizeSplitScreen) { - return; - } - if (mSplitScreenMinimized != splitScreenMinimized) { - mSplitScreenMinimized = splitScreenMinimized; - } - } - /** * Remove task remote animation target from * {@link RecentsAnimationCallbacks#onTasksAppeared}}. @@ -272,9 +250,7 @@ public class RecentsAnimationController { public void dump(String prefix, PrintWriter pw) { pw.println(prefix + "RecentsAnimationController:"); - pw.println(prefix + "\tmAllowMinimizeSplitScreen=" + mAllowMinimizeSplitScreen); pw.println(prefix + "\tmUseLauncherSysBarFlags=" + mUseLauncherSysBarFlags); - pw.println(prefix + "\tmSplitScreenMinimized=" + mSplitScreenMinimized); pw.println(prefix + "\tmFinishRequested=" + mFinishRequested); pw.println(prefix + "\tmFinishTargetIsLauncher=" + mFinishTargetIsLauncher); } diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java index 85eea3b00b..49ec5973e1 100644 --- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java +++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java @@ -60,9 +60,8 @@ import java.io.PrintWriter; import java.util.HashMap; public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAnimationListener { - public static final boolean ENABLE_SHELL_TRANSITIONS = true; - public static final boolean SHELL_TRANSITIONS_ROTATION = ENABLE_SHELL_TRANSITIONS - && SystemProperties.getBoolean("persist.wm.debug.shell_transit_rotate", false); + public static final boolean SHELL_TRANSITIONS_ROTATION = + SystemProperties.getBoolean("persist.wm.debug.shell_transit_rotate", false); private final Context mCtx; private RecentsAnimationController mController; @@ -160,8 +159,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn final BaseContainerInterface containerInterface = gestureState.getContainerInterface(); mLastGestureState = gestureState; - RecentsAnimationCallbacks newCallbacks = new RecentsAnimationCallbacks( - getSystemUiProxy(), containerInterface.allowMinimizeSplitScreen()); + RecentsAnimationCallbacks newCallbacks = new RecentsAnimationCallbacks(getSystemUiProxy()); mCallbacks = newCallbacks; mCallbacks.addListener(new RecentsAnimationCallbacks.RecentsAnimationListener() { @Override @@ -191,7 +189,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn } mLastGestureState.updateLastAppearedTaskTargets(mLastAppearedTaskTargets); - if (ENABLE_SHELL_TRANSITIONS && mTargets.hasRecents + if (mTargets.hasRecents // The filtered (MODE_CLOSING) targets only contain 1 home activity. && mTargets.apps.length == 1 && mTargets.apps[0].windowConfiguration.getActivityType() diff --git a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java index 14f47d13a7..b66d4cba33 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java @@ -24,7 +24,6 @@ import static com.android.launcher3.util.VelocityUtils.PX_PER_MS; import static com.android.quickstep.AbsSwipeUpHandler.MIN_PROGRESS_FOR_OVERVIEW; import static com.android.quickstep.MultiStateCallback.DEBUG_STATES; import static com.android.quickstep.OverviewComponentObserver.startHomeIntentSafely; -import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS; import static com.android.quickstep.util.ActiveGestureLog.INTENT_EXTRA_LOG_TRACE_ID; import android.animation.Animator; @@ -212,15 +211,13 @@ public class DeviceLockedInputConsumer implements InputConsumer, // This will come back and cancel the interaction. startHomeIntentSafely(mContext, mGestureState.getHomeIntent(), null, TAG); mHomeLaunched = true; - } else if (ENABLE_SHELL_TRANSITIONS) { - if (mTaskAnimationManager.getCurrentCallbacks() != null) { - if (mRecentsAnimationController != null) { - finishRecentsAnimationForShell(dismissTask); - } else { - // the transition of recents animation hasn't started, wait for it - mCancelWhenRecentsStart = true; - mDismissTask = dismissTask; - } + } else if (mTaskAnimationManager.getCurrentCallbacks() != null) { + if (mRecentsAnimationController != null) { + finishRecentsAnimationForShell(dismissTask); + } else { + // the transition of recents animation hasn't started, wait for it + mCancelWhenRecentsStart = true; + mDismissTask = dismissTask; } } mStateCallback.setState(STATE_HANDLER_INVALIDATED); diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java index ae6757f17d..1af12f1ac1 100644 --- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java +++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java @@ -886,8 +886,7 @@ public class SplitSelectStateController { Log.w(TAG, "Package not found: " + packageName, e); } RecentsAnimationCallbacks callbacks = new RecentsAnimationCallbacks( - SystemUiProxy.INSTANCE.get(mLauncher.getApplicationContext()), - false /* allowMinimizeSplitScreen */); + SystemUiProxy.INSTANCE.get(mLauncher.getApplicationContext())); DesktopSplitRecentsAnimationListener listener = new DesktopSplitRecentsAnimationListener(splitPosition, taskBounds); diff --git a/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java b/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java index 1c417eb9d9..4c6e4ff359 100644 --- a/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java +++ b/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java @@ -84,8 +84,7 @@ public class SplitWithKeyboardShortcutController { return; } RecentsAnimationCallbacks callbacks = new RecentsAnimationCallbacks( - SystemUiProxy.INSTANCE.get(mLauncher.getApplicationContext()), - false /* allowMinimizeSplitScreen */); + SystemUiProxy.INSTANCE.get(mLauncher.getApplicationContext())); SplitWithKeyboardShortcutRecentsAnimationListener listener = new SplitWithKeyboardShortcutRecentsAnimationListener(leftOrTop); diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java index e5c54bb3d7..c7777d86a5 100644 --- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java @@ -24,7 +24,6 @@ import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITIO import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT; import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_UNDEFINED; import static com.android.launcher3.util.SplitConfigurationOptions.StagePosition; -import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS; import static com.android.quickstep.util.RecentsOrientedState.postDisplayRotation; import static com.android.quickstep.util.RecentsOrientedState.preDisplayRotation; @@ -535,21 +534,12 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { // If mDrawsBelowRecents is unset, no reordering will be enforced. if (mDrawsBelowRecents != null) { - // In legacy transitions, the animation leashes remain in same hierarchy in the - // TaskDisplayArea, so we don't want to bump the layer too high otherwise it will - // conflict with layers that WM core positions (ie. the input consumers). For shell - // transitions, the animation leashes are reparented to an animation container so we - // can bump layers as needed. - if (ENABLE_SHELL_TRANSITIONS) { - builder.setLayer(mDrawsBelowRecents - ? Integer.MIN_VALUE + app.prefixOrderIndex - // 1000 is an arbitrary number to give room for multiple layers. - : Integer.MAX_VALUE - 1000 + app.prefixOrderIndex); - } else { - builder.setLayer(mDrawsBelowRecents - ? Integer.MIN_VALUE + app.prefixOrderIndex - : 0); - } + // In shell transitions, the animation leashes are reparented to an animation container + // so we can bump layers as needed. + builder.setLayer(mDrawsBelowRecents + ? Integer.MIN_VALUE + app.prefixOrderIndex + // 1000 is an arbitrary number to give room for multiple layers. + : Integer.MAX_VALUE - 1000 + app.prefixOrderIndex); } } diff --git a/quickstep/src/com/android/quickstep/views/TaskView.kt b/quickstep/src/com/android/quickstep/views/TaskView.kt index e43d7b4fc0..3c40602ba0 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.kt +++ b/quickstep/src/com/android/quickstep/views/TaskView.kt @@ -1032,14 +1032,12 @@ constructor( // triggered by QuickstepTransitionManager.AppLaunchAnimationRunner. return RunnableList().also { recentsView.addSideTaskLaunchCallback(it) } } - if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) { - // If the recents transition is running (ie. in live tile mode), then the start - // of a new task will merge into the existing transition and it currently will - // not be run independently, so we need to rely on the onTaskAppeared() call - // for the new task to trigger the side launch callback to flush this runnable - // list (which is usually flushed when the app launch animation finishes) - recentsView.addSideTaskLaunchCallback(opts.onEndCallback) - } + // If the recents transition is running (ie. in live tile mode), then the start + // of a new task will merge into the existing transition and it currently will + // not be run independently, so we need to rely on the onTaskAppeared() call + // for the new task to trigger the side launch callback to flush this runnable + // list (which is usually flushed when the app launch animation finishes) + recentsView.addSideTaskLaunchCallback(opts.onEndCallback) return opts.onEndCallback } else { notifyTaskLaunchFailed() diff --git a/quickstep/tests/src/com/android/quickstep/TaskAnimationManagerTest.java b/quickstep/tests/src/com/android/quickstep/TaskAnimationManagerTest.java index 3a83ae34c5..28c8a4ac18 100644 --- a/quickstep/tests/src/com/android/quickstep/TaskAnimationManagerTest.java +++ b/quickstep/tests/src/com/android/quickstep/TaskAnimationManagerTest.java @@ -59,8 +59,6 @@ public class TaskAnimationManagerTest { @Test public void startRecentsActivity_allowBackgroundLaunch() { - assumeTrue(TaskAnimationManager.ENABLE_SHELL_TRANSITIONS); - final LauncherActivityInterface activityInterface = mock(LauncherActivityInterface.class); final GestureState gestureState = mock(GestureState.class); final RecentsAnimationCallbacks.RecentsAnimationListener listener = diff --git a/src/com/android/launcher3/BaseActivity.java b/src/com/android/launcher3/BaseActivity.java index 633091d87b..fec94fe8d7 100644 --- a/src/com/android/launcher3/BaseActivity.java +++ b/src/com/android/launcher3/BaseActivity.java @@ -109,11 +109,6 @@ public abstract class BaseActivity extends Activity implements ActivityContext { */ public static final int ACTIVITY_STATE_USER_ACTIVE = 1 << 4; - /** - * State flag indicating if the user will be active shortly. - */ - public static final int ACTIVITY_STATE_USER_WILL_BE_ACTIVE = 1 << 5; - /** * State flag indicating that a state transition is in progress */ @@ -316,7 +311,6 @@ public abstract class BaseActivity extends Activity implements ActivityContext { */ public void setResumed() { addActivityFlags(ACTIVITY_STATE_RESUMED | ACTIVITY_STATE_USER_ACTIVE); - removeActivityFlags(ACTIVITY_STATE_USER_WILL_BE_ACTIVE); } public boolean isUserActive() {