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

Commit 39565918 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Reduce extra binder call for take task snapshot." into main

parents 4790b0fa 2c2ccac1
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -35,12 +35,6 @@ import com.android.internal.os.IResultReceiver;
 */
interface IRecentsAnimationController {

    /**
     * Takes a screenshot of the task associated with the given {@param taskId}. Only valid for the
     * current set of task ids provided to the handler.
     */
    TaskSnapshot screenshotTask(int taskId);

    /**
     * Sets the final surface transaction on a Task. This is used by Launcher to notify the system
     * that animating Activity to PiP has completed and the associated task surface should be
+0 −13
Original line number Diff line number Diff line
@@ -1226,19 +1226,6 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler,
            }
        }

        @Override
        public TaskSnapshot screenshotTask(int taskId) {
            try {
                ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION,
                        "[%d] RecentsController.screenshotTask: taskId=%d", mInstanceId, taskId);
                return ActivityTaskManager.getService().takeTaskSnapshot(taskId,
                        true /* updateCache */);
            } catch (RemoteException e) {
                Slog.e(TAG, "Failed to screenshot task", e);
            }
            return null;
        }

        @Override
        public void setInputConsumerEnabled(boolean enabled) {
            mExecutor.execute(() -> {
+0 −14
Original line number Diff line number Diff line
@@ -21,11 +21,9 @@ import android.util.Log;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
import android.window.PictureInPictureSurfaceTransaction;
import android.window.TaskSnapshot;
import android.window.WindowAnimationState;

import com.android.internal.os.IResultReceiver;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.wm.shell.recents.IRecentsAnimationController;

public class RecentsAnimationControllerCompat {
@@ -40,18 +38,6 @@ public class RecentsAnimationControllerCompat {
        mAnimationController = animationController;
    }

    public ThumbnailData screenshotTask(int taskId) {
        try {
            final TaskSnapshot snapshot = mAnimationController.screenshotTask(taskId);
            if (snapshot != null) {
                return ThumbnailData.fromSnapshot(snapshot);
            }
        } catch (RemoteException e) {
            Log.e(TAG, "Failed to screenshot task", e);
        }
        return new ThumbnailData();
    }

    public void setInputConsumerEnabled(boolean enabled) {
        try {
            mAnimationController.setInputConsumerEnabled(enabled);