Only allow roots tasks to be organized
Non-root tasks are relative to their parents so no need to have them return true to the isOrganized() method. We can also: - Reset the windowing mode for a task we are moving to split screen before we reparent to the split task. - Remove code in sys-ui that was added to compensate for the method previous returning true. Bug: 152619437 Test: They pass Change-Id: I7a0381f535f2d0b245773ecb1fbb4fdb524954f9
This commit is contained in:
@@ -1085,14 +1085,6 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
|||||||
crop.offsetTo(-(otherTaskRect.left - otherRect.left),
|
crop.offsetTo(-(otherTaskRect.left - otherRect.left),
|
||||||
-(otherTaskRect.top - otherRect.top));
|
-(otherTaskRect.top - otherRect.top));
|
||||||
t.setWindowCrop(mTiles.mSecondarySurface, crop);
|
t.setWindowCrop(mTiles.mSecondarySurface, crop);
|
||||||
// Reposition home and recents surfaces or they would be positioned relatively to its
|
|
||||||
// parent (split-screen secondary task) position.
|
|
||||||
for (int i = mTiles.mHomeAndRecentsSurfaces.size() - 1; i >= 0; --i) {
|
|
||||||
t.setPosition(mTiles.mHomeAndRecentsSurfaces.get(i),
|
|
||||||
mTiles.mHomeBounds.left - otherTaskRect.left,
|
|
||||||
mTiles.mHomeBounds.top - otherTaskRect.top);
|
|
||||||
t.setWindowCrop(mTiles.mHomeAndRecentsSurfaces.get(i), null);
|
|
||||||
}
|
|
||||||
final SurfaceControl dividerCtrl = getWindowSurfaceControl();
|
final SurfaceControl dividerCtrl = getWindowSurfaceControl();
|
||||||
if (dividerCtrl != null) {
|
if (dividerCtrl != null) {
|
||||||
if (isHorizontalDivision()) {
|
if (isHorizontalDivision()) {
|
||||||
|
|||||||
@@ -2802,6 +2802,9 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
|||||||
false /* includingParents */);
|
false /* includingParents */);
|
||||||
}
|
}
|
||||||
WindowContainerTransaction wct = new WindowContainerTransaction();
|
WindowContainerTransaction wct = new WindowContainerTransaction();
|
||||||
|
// Clear out current windowing mode before reparenting to split taks.
|
||||||
|
wct.setWindowingMode(
|
||||||
|
task.getStack().mRemoteToken.toWindowContainerToken(), WINDOWING_MODE_UNDEFINED);
|
||||||
wct.reparent(task.getStack().mRemoteToken.toWindowContainerToken(),
|
wct.reparent(task.getStack().mRemoteToken.toWindowContainerToken(),
|
||||||
primarySplitTask.mRemoteToken.toWindowContainerToken(), toTop);
|
primarySplitTask.mRemoteToken.toWindowContainerToken(), toTop);
|
||||||
mWindowOrganizerController.applyTransaction(wct);
|
mWindowOrganizerController.applyTransaction(wct);
|
||||||
|
|||||||
@@ -4068,21 +4068,7 @@ class Task extends WindowContainer<WindowContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
boolean isOrganized() {
|
boolean isOrganized() {
|
||||||
final Task rootTask = getRootTask();
|
return mTaskOrganizer != null;
|
||||||
if (rootTask.mTaskOrganizer == null) {
|
|
||||||
// You are obviously not organized...
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (rootTask == this) {
|
|
||||||
// Root tasks can be organized.
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (rootTask.mCreatedByOrganizer && getParent() == rootTask) {
|
|
||||||
// Direct children of tasks added by the organizer can the organized.
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -4137,6 +4123,7 @@ class Task extends WindowContainer<WindowContainer> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@VisibleForTesting
|
||||||
boolean setTaskOrganizer(ITaskOrganizer organizer) {
|
boolean setTaskOrganizer(ITaskOrganizer organizer) {
|
||||||
if (mTaskOrganizer == organizer) {
|
if (mTaskOrganizer == organizer) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user