Merge "Fix animation target rule due to split screen arch change" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
992c55b46f
@@ -912,6 +912,15 @@ public class AppTransitionController {
|
||||
canPromote = false;
|
||||
}
|
||||
|
||||
// If the current window container is task and it have adjacent task, it means
|
||||
// both tasks will open or close app toghther but we want get their opening or
|
||||
// closing animation target independently so do not promote.
|
||||
if (current.asTask() != null
|
||||
&& current.asTask().getAdjacentTaskFragment() != null
|
||||
&& current.asTask().getAdjacentTaskFragment().asTask() != null) {
|
||||
canPromote = false;
|
||||
}
|
||||
|
||||
// Find all siblings of the current WindowContainer in "candidates", move them into
|
||||
// a separate list "siblings", and checks if an animation target can be promoted
|
||||
// to its parent.
|
||||
|
||||
@@ -19,6 +19,7 @@ package com.android.server.wm;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
|
||||
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
|
||||
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
||||
import static android.view.WindowManager.TRANSIT_CHANGE;
|
||||
@@ -552,6 +553,37 @@ public class AppTransitionControllerTest extends WindowTestsBase {
|
||||
opening, closing, false /* visible */));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAnimationTargets_splitScreenOpening() {
|
||||
// [DisplayContent] - [Task] -+- [split task 1] -+- [Task1] - [AR1] (opening, invisible)
|
||||
// +- [split task 2] -+- [Task2] - [AR2] (opening, invisible)
|
||||
final Task singleTopRoot = createTask(mDisplayContent);
|
||||
final TaskBuilder builder = new TaskBuilder(mSupervisor)
|
||||
.setWindowingMode(WINDOWING_MODE_MULTI_WINDOW)
|
||||
.setParentTaskFragment(singleTopRoot)
|
||||
.setCreatedByOrganizer(true);
|
||||
final Task splitRoot1 = builder.build();
|
||||
final Task splitRoot2 = builder.build();
|
||||
splitRoot1.setAdjacentTaskFragment(splitRoot2, false /* moveTogether */);
|
||||
final ActivityRecord activity1 = createActivityRecordWithParentTask(splitRoot1);
|
||||
activity1.setVisible(false);
|
||||
activity1.mVisibleRequested = true;
|
||||
final ActivityRecord activity2 = createActivityRecordWithParentTask(splitRoot2);
|
||||
activity2.setVisible(false);
|
||||
activity2.mVisibleRequested = true;
|
||||
|
||||
final ArraySet<ActivityRecord> opening = new ArraySet<>();
|
||||
opening.add(activity1);
|
||||
opening.add(activity2);
|
||||
final ArraySet<ActivityRecord> closing = new ArraySet<>();
|
||||
|
||||
// Promote animation targets up to Task level, not beyond.
|
||||
assertEquals(
|
||||
new ArraySet<>(new WindowContainer[]{splitRoot1, splitRoot2}),
|
||||
AppTransitionController.getAnimationTargets(
|
||||
opening, closing, true /* visible */));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAnimationTargets_openingClosingTaskFragment() {
|
||||
// [DefaultTDA] - [Task] -+- [TaskFragment1] - [ActivityRecord1] (opening, invisible)
|
||||
|
||||
@@ -1290,6 +1290,7 @@ class WindowTestsBase extends SystemServiceTestsBase {
|
||||
private TaskFragment mParentTaskFragment;
|
||||
|
||||
private boolean mCreateActivity = false;
|
||||
private boolean mCreatedByOrganizer = false;
|
||||
|
||||
TaskBuilder(ActivityTaskSupervisor supervisor) {
|
||||
mSupervisor = supervisor;
|
||||
@@ -1381,6 +1382,11 @@ class WindowTestsBase extends SystemServiceTestsBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
TaskBuilder setCreatedByOrganizer(boolean createdByOrganizer) {
|
||||
mCreatedByOrganizer = createdByOrganizer;
|
||||
return this;
|
||||
}
|
||||
|
||||
Task build() {
|
||||
SystemServicesTestRule.checkHoldsLock(mSupervisor.mService.mGlobalLock);
|
||||
|
||||
@@ -1416,7 +1422,8 @@ class WindowTestsBase extends SystemServiceTestsBase {
|
||||
.setActivityInfo(mActivityInfo)
|
||||
.setIntent(mIntent)
|
||||
.setOnTop(mOnTop)
|
||||
.setVoiceSession(mVoiceSession);
|
||||
.setVoiceSession(mVoiceSession)
|
||||
.setCreatedByOrganizer(mCreatedByOrganizer);
|
||||
final Task task;
|
||||
if (mParentTaskFragment == null) {
|
||||
task = builder.setActivityType(mActivityType)
|
||||
|
||||
Reference in New Issue
Block a user