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

Commit 85224ebd authored by Jerry Chang's avatar Jerry Chang
Browse files

Consolidate recent animation in split screen with shell-transition

Also exclude corresponding parent task when wrapping up remote animation
target for recents animation.

Bug: 206487881
Test: manual check recent animation after split screen activated
Change-Id: I2e80eca1124d9a9e360513334211bde8a52575ea
parent 1af0e4d2
Loading
Loading
Loading
Loading
+20 −9
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@ import com.android.quickstep.util.TaskViewSimulator;
import com.android.quickstep.util.TransformParams;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;

import java.util.ArrayList;

/**
 * Glues together the necessary components to animate a remote target using a
 * {@link TaskViewSimulator}
@@ -144,20 +146,29 @@ public class RemoteTargetGluer {
     */
    private RemoteAnimationTargets createRemoteAnimationTargetsForTarget(
            RemoteAnimationTargets targets,
            @Nullable RemoteAnimationTargetCompat targetToExclude) {
        int finalLength = targets.unfilteredApps.length - (targetToExclude == null ? 0 : 1);
        RemoteAnimationTargetCompat[] targetsWithoutExcluded =
                new RemoteAnimationTargetCompat[finalLength];
        int i = 0;
            RemoteAnimationTargetCompat targetToExclude) {
        ArrayList<RemoteAnimationTargetCompat> targetsWithoutExcluded =
                new ArrayList<RemoteAnimationTargetCompat>();

        for (RemoteAnimationTargetCompat targetCompat : targets.unfilteredApps) {
            if (targetCompat == targetToExclude) {
                continue;
            }
            targetsWithoutExcluded[i] = targetCompat;
            i++;
            if (targetToExclude != null
                    && targetToExclude.taskInfo != null
                    && targetCompat.taskInfo != null
                    && targetToExclude.taskInfo.parentTaskId == targetCompat.taskInfo.taskId) {
                // Also exclude corresponding parent task
                continue;
            }

            targetsWithoutExcluded.add(targetCompat);
        }
        return new RemoteAnimationTargets(targetsWithoutExcluded,
                targets.wallpapers, targets.nonApps, targets.targetMode);
        final RemoteAnimationTargetCompat[] filteredApps =
                targetsWithoutExcluded.toArray(
                        new RemoteAnimationTargetCompat[targetsWithoutExcluded.size()]);
        return new RemoteAnimationTargets(
                filteredApps, targets.wallpapers, targets.nonApps, targets.targetMode);
    }

    public RemoteTargetHandle[] getRemoteTargetHandles() {