Merge "Fix switching a background task into split screen unexpectedly" into tm-dev am: 2a3709618b am: 85edc35835 am: 30a0204cc5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18425971 Change-Id: I7ee28914dbcb3aaa2d0249196cbe2a17126b1fe0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -418,6 +418,13 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
|
|||||||
}
|
}
|
||||||
|
|
||||||
RemoteAnimationTarget[] onGoingToRecentsLegacy(RemoteAnimationTarget[] apps) {
|
RemoteAnimationTarget[] onGoingToRecentsLegacy(RemoteAnimationTarget[] apps) {
|
||||||
|
if (isSplitScreenVisible()) {
|
||||||
|
// Evict child tasks except the top visible one under split root to ensure it could be
|
||||||
|
// launched as full screen when switching to it on recents.
|
||||||
|
final WindowContainerTransaction wct = new WindowContainerTransaction();
|
||||||
|
mStageCoordinator.prepareEvictInvisibleChildTasks(wct);
|
||||||
|
mSyncQueue.queue(wct);
|
||||||
|
}
|
||||||
return reparentSplitTasksForAnimation(apps, true /*splitExpectedToBeVisible*/);
|
return reparentSplitTasksForAnimation(apps, true /*splitExpectedToBeVisible*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -537,6 +537,11 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void prepareEvictInvisibleChildTasks(WindowContainerTransaction wct) {
|
||||||
|
mMainStage.evictInvisibleChildren(wct);
|
||||||
|
mSideStage.evictInvisibleChildren(wct);
|
||||||
|
}
|
||||||
|
|
||||||
Bundle resolveStartStage(@StageType int stage,
|
Bundle resolveStartStage(@StageType int stage,
|
||||||
@SplitPosition int position, @androidx.annotation.Nullable Bundle options,
|
@SplitPosition int position, @androidx.annotation.Nullable Bundle options,
|
||||||
@androidx.annotation.Nullable WindowContainerTransaction wct) {
|
@androidx.annotation.Nullable WindowContainerTransaction wct) {
|
||||||
|
|||||||
@@ -341,6 +341,15 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void evictInvisibleChildren(WindowContainerTransaction wct) {
|
||||||
|
for (int i = mChildrenTaskInfo.size() - 1; i >= 0; i--) {
|
||||||
|
final ActivityManager.RunningTaskInfo taskInfo = mChildrenTaskInfo.valueAt(i);
|
||||||
|
if (!taskInfo.isVisible) {
|
||||||
|
wct.reparent(taskInfo.token, null /* parent */, false /* onTop */);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void onSplitScreenListenerRegistered(SplitScreen.SplitScreenListener listener,
|
void onSplitScreenListenerRegistered(SplitScreen.SplitScreenListener listener,
|
||||||
@StageType int stage) {
|
@StageType int stage) {
|
||||||
for (int i = mChildrenTaskInfo.size() - 1; i >= 0; --i) {
|
for (int i = mChildrenTaskInfo.size() - 1; i >= 0; --i) {
|
||||||
|
|||||||
Reference in New Issue
Block a user