Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a5c6406 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix recents transitions

- Also animate when there is no thumbnail, which can frequently
happen after exiting multi-window.
- Also animate when the target stack id is INVALID, because we
currently don't persist stack id's in the tasks.

Change-Id: I280c85e62f55d712408a3e77c43f665acb19bc4c
parent 519e0591
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -581,8 +581,12 @@ public class ActivityManager {
         * the task to the specified stack.
         */
        public static boolean useAnimationSpecForAppTransition(int stackId) {

            // TODO: INVALID_STACK_ID is also animated because we don't persist stack id's across
            // reboots.
            return stackId == FREEFORM_WORKSPACE_STACK_ID
                    || stackId == FULLSCREEN_WORKSPACE_STACK_ID || stackId == DOCKED_STACK_ID;
                    || stackId == FULLSCREEN_WORKSPACE_STACK_ID || stackId == DOCKED_STACK_ID
                    || stackId == INVALID_STACK_ID;
        }

        /** Returns true if the windows in the stack can receive input keys. */
+7 −3
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import com.android.systemui.recents.model.TaskStack;
import java.util.ArrayList;
import java.util.List;

import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
@@ -99,8 +100,7 @@ public class RecentsTransitionHelper {

        final ActivityOptions.OnAnimationStartedListener animStartedListener;
        final IAppTransitionAnimationSpecsFuture transitionFuture;
        if (task.thumbnail != null && task.thumbnail.getWidth() > 0 &&
                task.thumbnail.getHeight() > 0) {
        if (taskView != null) {
            transitionFuture = getAppTransitionFuture(task, stackView, destinationStack);
            animStartedListener = new ActivityOptions.OnAnimationStartedListener() {
                @Override
@@ -266,7 +266,11 @@ public class RecentsTransitionHelper {
        // If this is a full screen stack, the transition will be towards the single, full screen
        // task. We only need the transition spec for this task.
        List<AppTransitionAnimationSpec> specs = new ArrayList<>();
        if (targetStackId == FULLSCREEN_WORKSPACE_STACK_ID) {

        // TODO: Sometimes targetStackId is not initialized after reboot, so we also have to
        // check for INVALID_STACK_ID
        if (targetStackId == FULLSCREEN_WORKSPACE_STACK_ID || targetStackId == DOCKED_STACK_ID
                || targetStackId == INVALID_STACK_ID) {
            if (taskView == null) {
                specs.add(composeOffscreenAnimationSpec(task, offscreenTaskRect));
            } else {