Merge "Fix not tracking splitting tasks correctly" into udc-dev am: 303d6101fb
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23149642 Change-Id: Ic5d0971b0d6444bea6d5191bbf710679ee652fe7 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -127,23 +127,16 @@ public class TopTaskTracker extends ISplitScreenListener.Stub implements TaskSta
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTaskStageChanged(int taskId, @StageType int stage, boolean visible) {
|
public void onTaskStageChanged(int taskId, @StageType int stage, boolean visible) {
|
||||||
// If task is not visible but we are tracking it, stop tracking it
|
// If a task is not visible anymore or has been moved to undefined, stop tracking it.
|
||||||
if (!visible) {
|
if (!visible || stage == SplitConfigurationOptions.STAGE_TYPE_UNDEFINED) {
|
||||||
if (mMainStagePosition.taskId == taskId) {
|
if (mMainStagePosition.taskId == taskId) {
|
||||||
resetTaskId(mMainStagePosition);
|
mMainStagePosition.taskId = INVALID_TASK_ID;
|
||||||
} else if (mSideStagePosition.taskId == taskId) {
|
} else if (mSideStagePosition.taskId == taskId) {
|
||||||
resetTaskId(mSideStagePosition);
|
mSideStagePosition.taskId = INVALID_TASK_ID;
|
||||||
} // else it's an un-tracked child
|
} // else it's an un-tracked child
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If stage has moved to undefined, stop tracking the task
|
|
||||||
if (stage == SplitConfigurationOptions.STAGE_TYPE_UNDEFINED) {
|
|
||||||
resetTaskId(taskId == mMainStagePosition.taskId
|
|
||||||
? mMainStagePosition : mSideStagePosition);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stage == SplitConfigurationOptions.STAGE_TYPE_MAIN) {
|
if (stage == SplitConfigurationOptions.STAGE_TYPE_MAIN) {
|
||||||
mMainStagePosition.taskId = taskId;
|
mMainStagePosition.taskId = taskId;
|
||||||
} else {
|
} else {
|
||||||
@@ -161,10 +154,6 @@ public class TopTaskTracker extends ISplitScreenListener.Stub implements TaskSta
|
|||||||
mPinnedTaskId = INVALID_TASK_ID;
|
mPinnedTaskId = INVALID_TASK_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetTaskId(SplitStageInfo taskPosition) {
|
|
||||||
taskPosition.taskId = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return index 0 will be task in left/top position, index 1 in right/bottom position.
|
* @return index 0 will be task in left/top position, index 1 in right/bottom position.
|
||||||
* Will return empty array if device is not in staged split
|
* Will return empty array if device is not in staged split
|
||||||
|
|||||||
Reference in New Issue
Block a user