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

Commit 49864f3d authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove shell transition check in WM shell

Now ENABLE_SHELL_TRANSITIONS is always true.

Bug: 365884835
Flag: EXEMPT remove outdated code
Test: WMShellUnitTests
Change-Id: Ie1ae0b3c5ff14eb06e1ec94f7b55d04118902069
parent cadaad60
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static com.android.wm.shell.compatui.impl.CompatUIEventsKt.SIZE_COMPAT_RESTART_BUTTON_APPEARED;
import static com.android.wm.shell.compatui.impl.CompatUIEventsKt.SIZE_COMPAT_RESTART_BUTTON_CLICKED;
import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_TASK_ORG;
import static com.android.wm.shell.transition.Transitions.ENABLE_SHELL_TRANSITIONS;

import android.annotation.IntDef;
import android.annotation.NonNull;
@@ -670,11 +669,6 @@ public class ShellTaskOrganizer extends TaskOrganizer {
            for (TaskVanishedListener l : mTaskVanishedListeners) {
                l.onTaskVanished(taskInfo);
            }

            if (!ENABLE_SHELL_TRANSITIONS && (appearedInfo.getLeash() != null)) {
                // Preemptively clean up the leash only if shell transitions are not enabled
                appearedInfo.getLeash().release();
            }
        }
    }

+1 −3
Original line number Diff line number Diff line
@@ -80,9 +80,7 @@ public class ActivityEmbeddingController implements Transitions.TransitionHandle
    @Nullable
    public static ActivityEmbeddingController create(@NonNull Context context,
            @NonNull ShellInit shellInit, @NonNull Transitions transitions) {
        return Transitions.ENABLE_SHELL_TRANSITIONS
                ? new ActivityEmbeddingController(context, shellInit, transitions)
                : null;
        return new ActivityEmbeddingController(context, shellInit, transitions);
    }

    /** Registers to handle transitions. */
+1 −4
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.wm.shell.compatui;

import static com.android.internal.R.styleable.WindowAnimation_windowEnterAnimation;
import static com.android.internal.R.styleable.WindowAnimation_windowExitAnimation;
import static com.android.wm.shell.transition.Transitions.ENABLE_SHELL_TRANSITIONS;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -48,9 +47,7 @@ public class DialogAnimationController<T extends DialogContainerSupplier> {
    // 204 is simply 255 * 0.8.
    static final int BACKGROUND_DIM_ALPHA = 204;

    // If shell transitions are enabled, startEnterAnimation will be called after all transitions
    // have finished, and therefore the start delay should be shorter.
    private static final int ENTER_ANIM_START_DELAY_MILLIS = ENABLE_SHELL_TRANSITIONS ? 300 : 500;
    private static final int ENTER_ANIM_START_DELAY_MILLIS = 300;

    private final TransitionAnimation mTransitionAnimation;
    private final String mPackageName;
+0 −51
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import com.android.wm.shell.desktopmode.desktopwallpaperactivity.DesktopWallpape
import com.android.wm.shell.protolog.ShellProtoLogGroup;
import com.android.wm.shell.recents.RecentTasksController;
import com.android.wm.shell.sysui.ShellInit;
import com.android.wm.shell.transition.Transitions;
import com.android.wm.shell.windowdecor.WindowDecorViewModel;

import java.io.PrintWriter;
@@ -105,33 +104,6 @@ public class FullscreenTaskListener implements ShellTaskOrganizer.TaskListener {
        state.mLeash = leash;
        state.mTaskInfo = taskInfo;
        mTasks.put(taskInfo.taskId, state);

        if (Transitions.ENABLE_SHELL_TRANSITIONS) return;
        updateRecentsForVisibleFullscreenTask(taskInfo);
        boolean createdWindowDecor = false;
        if (mWindowDecorViewModelOptional.isPresent()) {
            SurfaceControl.Transaction t = new SurfaceControl.Transaction();
            createdWindowDecor = mWindowDecorViewModelOptional.get()
                    .onTaskOpening(taskInfo, leash, t, t);
            t.apply();
        }
        if (!createdWindowDecor) {
            mSyncQueue.runInSync(t -> {
                if (!leash.isValid()) {
                    // Task vanished before sync completion
                    return;
                }
                // Reset several properties back to fullscreen (PiP, for example, leaves all these
                // properties in a bad state).
                t.setWindowCrop(leash, null);
                t.setPosition(leash, positionInParent.x, positionInParent.y);
                t.setAlpha(leash, 1f);
                t.setMatrix(leash, 1, 0, 0, 1);
                if (taskInfo.isVisible) {
                    t.show(leash);
                }
            });
        }
    }

    @Override
@@ -144,25 +116,6 @@ public class FullscreenTaskListener implements ShellTaskOrganizer.TaskListener {
            mWindowDecorViewModelOptional.get().onTaskInfoChanged(taskInfo);
        }
        state.mTaskInfo = taskInfo;
        if (Transitions.ENABLE_SHELL_TRANSITIONS) return;
        updateRecentsForVisibleFullscreenTask(taskInfo);

        final Point positionInParent = state.mTaskInfo.positionInParent;
        boolean positionInParentChanged = !oldPositionInParent.equals(positionInParent);
        boolean becameVisible = !oldVisible && state.mTaskInfo.isVisible;

        if (becameVisible || positionInParentChanged) {
            mSyncQueue.runInSync(t -> {
                if (!state.mLeash.isValid()) {
                    // Task vanished before sync completion
                    return;
                }
                if (becameVisible) {
                    t.show(state.mLeash);
                }
                t.setPosition(state.mLeash, positionInParent.x, positionInParent.y);
            });
        }
    }

    @Override
@@ -177,10 +130,6 @@ public class FullscreenTaskListener implements ShellTaskOrganizer.TaskListener {
                        provider.removeToken(taskInfo.getToken());
                    }
                });
        if (Transitions.ENABLE_SHELL_TRANSITIONS) return;
        if (mWindowDecorViewModelOptional.isPresent()) {
            mWindowDecorViewModelOptional.get().destroyWindowDecoration(taskInfo);
        }
    }

    private void updateRecentsForVisibleFullscreenTask(RunningTaskInfo taskInfo) {
+29 −241

File changed.

Preview size limit exceeded, changes collapsed.

Loading