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
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user