Merge "Remove split pair according to last visible task" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d4ae1a52ab
@@ -1222,8 +1222,8 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
// Notify recents if we are exiting in a way that breaks the pair, and disable further
|
// Notify recents if we are exiting in a way that breaks the pair, and disable further
|
||||||
// updates to splits in the recents until we enter split again
|
// updates to splits in the recents until we enter split again
|
||||||
if (shouldBreakPairedTaskInRecents(exitReason) && mShouldUpdateRecents) {
|
if (shouldBreakPairedTaskInRecents(exitReason) && mShouldUpdateRecents) {
|
||||||
recentTasks.removeSplitPair(mMainStage.getTopVisibleChildTaskId());
|
recentTasks.removeSplitPair(mMainStage.getLastVisibleTaskId());
|
||||||
recentTasks.removeSplitPair(mSideStage.getTopVisibleChildTaskId());
|
recentTasks.removeSplitPair(mSideStage.getLastVisibleTaskId());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mShouldUpdateRecents = false;
|
mShouldUpdateRecents = false;
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
|
|||||||
protected SurfaceControl mDimLayer;
|
protected SurfaceControl mDimLayer;
|
||||||
protected SparseArray<ActivityManager.RunningTaskInfo> mChildrenTaskInfo = new SparseArray<>();
|
protected SparseArray<ActivityManager.RunningTaskInfo> mChildrenTaskInfo = new SparseArray<>();
|
||||||
private final SparseArray<SurfaceControl> mChildrenLeashes = new SparseArray<>();
|
private final SparseArray<SurfaceControl> mChildrenLeashes = new SparseArray<>();
|
||||||
|
private int mLastVisibleTaskId = INVALID_TASK_ID;
|
||||||
// TODO(b/204308910): Extracts SplitDecorManager related code to common package.
|
// TODO(b/204308910): Extracts SplitDecorManager related code to common package.
|
||||||
private SplitDecorManager mSplitDecorManager;
|
private SplitDecorManager mSplitDecorManager;
|
||||||
|
|
||||||
@@ -122,6 +123,13 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
|
|||||||
return contains(t -> t.token.asBinder() == binder);
|
return contains(t -> t.token.asBinder() == binder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the last visible task's id.
|
||||||
|
*/
|
||||||
|
int getLastVisibleTaskId() {
|
||||||
|
return mLastVisibleTaskId;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the top visible child task's id.
|
* Returns the top visible child task's id.
|
||||||
*/
|
*/
|
||||||
@@ -221,6 +229,9 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mChildrenTaskInfo.put(taskInfo.taskId, taskInfo);
|
mChildrenTaskInfo.put(taskInfo.taskId, taskInfo);
|
||||||
|
if (taskInfo.isVisible && taskInfo.taskId != mLastVisibleTaskId) {
|
||||||
|
mLastVisibleTaskId = taskInfo.taskId;
|
||||||
|
}
|
||||||
mCallbacks.onChildTaskStatusChanged(taskInfo.taskId, true /* present */,
|
mCallbacks.onChildTaskStatusChanged(taskInfo.taskId, true /* present */,
|
||||||
taskInfo.isVisible);
|
taskInfo.isVisible);
|
||||||
if (!ENABLE_SHELL_TRANSITIONS) {
|
if (!ENABLE_SHELL_TRANSITIONS) {
|
||||||
@@ -253,6 +264,9 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
|
|||||||
} else if (mChildrenTaskInfo.contains(taskId)) {
|
} else if (mChildrenTaskInfo.contains(taskId)) {
|
||||||
mChildrenTaskInfo.remove(taskId);
|
mChildrenTaskInfo.remove(taskId);
|
||||||
mChildrenLeashes.remove(taskId);
|
mChildrenLeashes.remove(taskId);
|
||||||
|
if (taskId == mLastVisibleTaskId) {
|
||||||
|
mLastVisibleTaskId = INVALID_TASK_ID;
|
||||||
|
}
|
||||||
mCallbacks.onChildTaskStatusChanged(taskId, false /* present */, taskInfo.isVisible);
|
mCallbacks.onChildTaskStatusChanged(taskId, false /* present */, taskInfo.isVisible);
|
||||||
if (ENABLE_SHELL_TRANSITIONS) {
|
if (ENABLE_SHELL_TRANSITIONS) {
|
||||||
// Status is managed/synchronized by the transition lifecycle.
|
// Status is managed/synchronized by the transition lifecycle.
|
||||||
|
|||||||
Reference in New Issue
Block a user