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

This commit is contained in:
Issei Suzuki
2022-06-14 13:50:21 +00:00
committed by Android (Google) Code Review
6 changed files with 6 additions and 20 deletions

View File

@@ -9787,11 +9787,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;

View File

@@ -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.

View File

@@ -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;
}
/**

View File

@@ -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

View File

@@ -3156,14 +3156,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();

View File

@@ -45,6 +45,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
@@ -210,6 +211,8 @@ public class TransitionTests extends WindowTestsBase {
@Test
public void testCreateInfo_DisplayArea() {
assumeTrue(mDisplayContent.mTransitionController.useShellTransitionsRotation());
final Transition transition = createTestTransition(TRANSIT_OPEN);
ArrayMap<WindowContainer, Transition.ChangeInfo> changes = transition.mChanges;
ArraySet<WindowContainer> participants = transition.mParticipants;