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

Commit 3073d0eb authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Automerger Merge Worker
Browse files

Merge "[Shell Transition]Release floating task view after second task select."...

Merge "[Shell Transition]Release floating task view after second task select." into tm-dev am: 5d9a319c

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/17184431

Change-Id: I69b8ae73e6cfe3a4bf9ceab65c460bfec159c1ce
parents 1302660d 5d9a319c
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import static com.android.launcher3.util.SplitConfigurationOptions.DEFAULT_SPLIT
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;

import android.annotation.NonNull;
import android.app.ActivityOptions;
import android.app.ActivityThread;
import android.app.PendingIntent;
@@ -163,7 +164,8 @@ public class SplitSelectStateController {
                : new int[]{taskId2, taskId1};
        if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
            RemoteSplitLaunchTransitionRunner animationRunner =
                    new RemoteSplitLaunchTransitionRunner(taskId1, taskPendingIntent, taskId2);
                    new RemoteSplitLaunchTransitionRunner(taskId1, taskPendingIntent, taskId2,
                            callback);
            mSystemUiProxy.startTasks(taskIds[0], null /* mainOptions */, taskIds[1],
                    null /* sideOptions */, STAGE_POSITION_BOTTOM_OR_RIGHT, splitRatio,
                    new RemoteTransitionCompat(animationRunner, MAIN_EXECUTOR,
@@ -210,19 +212,26 @@ public class SplitSelectStateController {
        private final int mInitialTaskId;
        private final PendingIntent mInitialTaskPendingIntent;
        private final int mSecondTaskId;
        private final Consumer<Boolean> mSuccessCallback;

        RemoteSplitLaunchTransitionRunner(int initialTaskId, PendingIntent initialTaskPendingIntent,
                int secondTaskId) {
                int secondTaskId, Consumer<Boolean> callback) {
            mInitialTaskId = initialTaskId;
            mInitialTaskPendingIntent = initialTaskPendingIntent;
            mSecondTaskId = secondTaskId;
            mSuccessCallback = callback;
        }

        @Override
        public void startAnimation(IBinder transition, TransitionInfo info,
                SurfaceControl.Transaction t, Runnable finishCallback) {
        public void startAnimation(@NonNull IBinder transition, @NonNull TransitionInfo info,
                @NonNull SurfaceControl.Transaction t, @NonNull Runnable finishCallback) {
            TaskViewUtils.composeRecentsSplitLaunchAnimator(mInitialTaskId,
                    mInitialTaskPendingIntent, mSecondTaskId, info, t, finishCallback);
                    mInitialTaskPendingIntent, mSecondTaskId, info, t, () -> {
                    finishCallback.run();
                    if (mSuccessCallback != null) {
                        mSuccessCallback.accept(true);
                    }
                });
            // After successful launch, call resetState
            resetState();
        }