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

Commit 17d5f77f authored by Alex Chau's avatar Alex Chau
Browse files

Remove TaskView.isDesktopTask

- Replace with DesktopTaskView instanceOf check

Bug: 249371338
Test: Manual
Flag: None
Change-Id: I02034775d3b76646ec4603026fc9e617b055f77c
parent 919ce270
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -135,6 +135,7 @@ import com.android.quickstep.util.SurfaceTransactionApplier;
import com.android.quickstep.util.SwipePipToHomeAnimator;
import com.android.quickstep.util.TaskViewSimulator;
import com.android.quickstep.util.TransformParams;
import com.android.quickstep.views.DesktopTaskView;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.RecentsViewContainer;
import com.android.quickstep.views.TaskView;
@@ -1258,8 +1259,8 @@ public abstract class AbsSwipeUpHandler<T extends RecentsViewContainer,
                ? mRecentsView.getNextPageTaskView() : null;
        TaskView currentPageTaskView = mRecentsView != null
                ? mRecentsView.getCurrentPageTaskView() : null;
        if (((nextPageTaskView != null && nextPageTaskView.isDesktopTask())
                || (currentPageTaskView != null && currentPageTaskView.isDesktopTask()))
        if ((nextPageTaskView instanceof DesktopTaskView
                || currentPageTaskView instanceof DesktopTaskView)
                && endTarget == NEW_TASK) {
            // TODO(b/268075592): add support for quickswitch to/from desktop
            return LAST_TASK;
@@ -1422,7 +1423,7 @@ public abstract class AbsSwipeUpHandler<T extends RecentsViewContainer,
            setClampScrollOffset(false);
        };
        if (mRecentsView != null && (mRecentsView.getCurrentPageTaskView() != null
                && !mRecentsView.getCurrentPageTaskView().isDesktopTask())) {
                && !(mRecentsView.getCurrentPageTaskView() instanceof DesktopTaskView))) {
            ActiveGestureLog.INSTANCE.trackEvent(ActiveGestureErrorDetector.GestureEvent
                    .SET_ON_PAGE_TRANSITION_END_CALLBACK);
            // TODO(b/268075592): add support for quickswitch to/from desktop
@@ -2250,10 +2251,8 @@ public abstract class AbsSwipeUpHandler<T extends RecentsViewContainer,
                    mRecentsAnimationController, mRecentsAnimationTargets);
        });

        if ((mRecentsView.getNextPageTaskView() != null
                && mRecentsView.getNextPageTaskView().isDesktopTask())
                || (mRecentsView.getCurrentPageTaskView() != null
                && mRecentsView.getCurrentPageTaskView().isDesktopTask())) {
        if (mRecentsView.getNextPageTaskView() instanceof DesktopTaskView
                || mRecentsView.getCurrentPageTaskView() instanceof DesktopTaskView) {
            // TODO(b/268075592): add support for quickswitch to/from desktop
            mRecentsViewScrollLinked = false;
            return;
+0 −5
Original line number Diff line number Diff line
@@ -326,11 +326,6 @@ public class DesktopTaskView extends TaskView {
        callback.accept(true);
    }

    @Override
    public boolean isDesktopTask() {
        return true;
    }

    @Override
    void refreshThumbnails(@Nullable HashMap<Integer, ThumbnailData> thumbnailDatas) {
        // Sets new thumbnails based on the incoming data and refreshes the rest.
+0 −5
Original line number Diff line number Diff line
@@ -1281,11 +1281,6 @@ public class TaskView extends FrameLayout implements Reusable {
        return deviceProfile.isTablet && !isFocusedTask();
    }

    /** Whether this task view represents the desktop */
    public boolean isDesktopTask() {
        return false;
    }

    /**
     * Called to animate a smooth transition when going directly from an app into Overview (and
     * vice versa). Icons fade in, and DWB banners slide in with a "shift up" animation.