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

Commit e5501c90 authored by Issei Suzuki's avatar Issei Suzuki
Browse files

Dedup predicates to check if remote animation target can be created.

The predicates below were used to check if remote animation target could
be created from a WindowContainer.

- WindowContainer#canCreateRemoteAnimationTarget
- WindowContainer#canBeAnimationTarget

The former was used by WM shell transition and the later was used by the
legacy transition. Merged the predicates.

Test: no-op refactoring. Existing tests pass.
Bug: 235601859
Change-Id: I985605b0c1eba22be16a32db6294e9623ea84705
parent 76232f4e
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -9788,11 +9788,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        super.finishSync(outMergedTransaction, cancel);
    }

    @Override
    boolean canBeAnimationTarget() {
        return true;
    }

    @Nullable
    Point getMinDimensions() {
        final ActivityInfo.WindowLayout windowLayout = info.windowLayout;
+0 −1
Original line number Diff line number Diff line
@@ -928,7 +928,6 @@ public class AppTransitionController {
                // TODO(b/213312721): Remove this once ShellTransition is enabled.
                continue;
            } else if (parent == null || !parent.canCreateRemoteAnimationTarget()
                    || !parent.canBeAnimationTarget()
                    // We cannot promote the animation on Task's parent when the task is in
                    // clearing task in case the animating get stuck when performing the opening
                    // task that behind it.
+3 −1
Original line number Diff line number Diff line
@@ -1778,7 +1778,9 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {

    @Override
    boolean canCreateRemoteAnimationTarget() {
        return true;
        // In the legacy transition system, promoting animation target from TaskFragment to
        // TaskDisplayArea prevents running finish animation. See b/194649929.
        return WindowManagerService.sEnableShellTransitions;
    }

    /**
+0 −5
Original line number Diff line number Diff line
@@ -2568,11 +2568,6 @@ class TaskFragment extends WindowContainer<WindowContainer> {
        }
    }

    @Override
    boolean canBeAnimationTarget() {
        return true;
    }

    @Override
    boolean fillsParent() {
        // From the perspective of policy, we still want to report that this task fills parent
+0 −8
Original line number Diff line number Diff line
@@ -3141,14 +3141,6 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        return false;
    }

    /**
     * {@code true} to indicate that this container can be a candidate of
     * {@link AppTransitionController#getAnimationTargets(ArraySet, ArraySet, boolean) animation
     * target}. */
    boolean canBeAnimationTarget() {
        return false;
    }

    boolean okToDisplay() {
        final DisplayContent dc = getDisplayContent();
        return dc != null && dc.okToDisplay();
Loading