Loading services/core/java/com/android/server/wm/WindowContainer.java +6 −4 Original line number Diff line number Diff line Loading @@ -995,12 +995,14 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< * changes (eg. a transition animation might play out first). */ void onChildVisibilityRequested(boolean visible) { // If we are changing visibility, then a snapshot isn't necessary and we are no-longer // If we are losing visibility, then a snapshot isn't necessary and we are no-longer // part of a change transition. if (!visible) { mSurfaceFreezer.unfreeze(getSyncTransaction()); if (mDisplayContent != null) { mDisplayContent.mChangingContainers.remove(this); } } WindowContainer parent = getParent(); if (parent != null) { parent.onChildVisibilityRequested(visible); Loading services/core/java/com/android/server/wm/WindowOrganizerController.java +9 −7 Original line number Diff line number Diff line Loading @@ -324,12 +324,13 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub (task.isRootTask() && !task.mCreatedByOrganizer) || task.getParent().asTask().mCreatedByOrganizer; if (isNonOrganizedRootableTask) { Task newParent = hop.getNewParent() == null ? null : WindowContainer.fromBinder(hop.getNewParent()).asTask(); WindowContainer newParent = hop.getNewParent() == null ? dc.getDefaultTaskDisplayArea() : WindowContainer.fromBinder(hop.getNewParent()); if (task.getParent() != newParent) { if (newParent == null) { // Re-parent task to display as a root task. as.reparent(dc.getDefaultTaskDisplayArea(), hop.getToTop()); if (newParent instanceof TaskDisplayArea) { // For now, reparenting to displayarea is different from other reparents... as.reparent((TaskDisplayArea) newParent, hop.getToTop()); } else if (newParent.inMultiWindowMode() && !task.isResizeable() && task.isLeafTask()) { Slog.w(TAG, "Can't support task that doesn't support multi-window mode in" Loading @@ -341,8 +342,9 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub false /*moveParents*/, "sanitizeAndApplyHierarchyOp"); } } else { final ActivityStack rootTask = (ActivityStack) (newParent != null ? newParent : task.getRootTask()); final ActivityStack rootTask = (ActivityStack) ( (newParent != null && !(newParent instanceof TaskDisplayArea)) ? newParent : task.getRootTask()); if (hop.getToTop()) { as.getDisplayArea().positionStackAtTop(rootTask, false /* includingParents */); Loading services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java +8 −0 Original line number Diff line number Diff line Loading @@ -669,6 +669,14 @@ public class WindowOrganizerTests extends WindowTestsBase { assertEquals(1, lastReportedTiles.size()); assertEquals(ACTIVITY_TYPE_HOME, lastReportedTiles.get(info1.token.asBinder()).topActivityType); // This just needs to not crash (ie. it should be possible to reparent to display twice) wct = new WindowContainerTransaction(); wct.reparent(stack2.mRemoteToken.toWindowContainerToken(), null, true /* onTop */); mWm.mAtmService.mWindowOrganizerController.applyTransaction(wct); wct = new WindowContainerTransaction(); wct.reparent(stack2.mRemoteToken.toWindowContainerToken(), null, true /* onTop */); mWm.mAtmService.mWindowOrganizerController.applyTransaction(wct); } private List<Task> getTasksCreatedByOrganizer(DisplayContent dc) { Loading Loading
services/core/java/com/android/server/wm/WindowContainer.java +6 −4 Original line number Diff line number Diff line Loading @@ -995,12 +995,14 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< * changes (eg. a transition animation might play out first). */ void onChildVisibilityRequested(boolean visible) { // If we are changing visibility, then a snapshot isn't necessary and we are no-longer // If we are losing visibility, then a snapshot isn't necessary and we are no-longer // part of a change transition. if (!visible) { mSurfaceFreezer.unfreeze(getSyncTransaction()); if (mDisplayContent != null) { mDisplayContent.mChangingContainers.remove(this); } } WindowContainer parent = getParent(); if (parent != null) { parent.onChildVisibilityRequested(visible); Loading
services/core/java/com/android/server/wm/WindowOrganizerController.java +9 −7 Original line number Diff line number Diff line Loading @@ -324,12 +324,13 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub (task.isRootTask() && !task.mCreatedByOrganizer) || task.getParent().asTask().mCreatedByOrganizer; if (isNonOrganizedRootableTask) { Task newParent = hop.getNewParent() == null ? null : WindowContainer.fromBinder(hop.getNewParent()).asTask(); WindowContainer newParent = hop.getNewParent() == null ? dc.getDefaultTaskDisplayArea() : WindowContainer.fromBinder(hop.getNewParent()); if (task.getParent() != newParent) { if (newParent == null) { // Re-parent task to display as a root task. as.reparent(dc.getDefaultTaskDisplayArea(), hop.getToTop()); if (newParent instanceof TaskDisplayArea) { // For now, reparenting to displayarea is different from other reparents... as.reparent((TaskDisplayArea) newParent, hop.getToTop()); } else if (newParent.inMultiWindowMode() && !task.isResizeable() && task.isLeafTask()) { Slog.w(TAG, "Can't support task that doesn't support multi-window mode in" Loading @@ -341,8 +342,9 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub false /*moveParents*/, "sanitizeAndApplyHierarchyOp"); } } else { final ActivityStack rootTask = (ActivityStack) (newParent != null ? newParent : task.getRootTask()); final ActivityStack rootTask = (ActivityStack) ( (newParent != null && !(newParent instanceof TaskDisplayArea)) ? newParent : task.getRootTask()); if (hop.getToTop()) { as.getDisplayArea().positionStackAtTop(rootTask, false /* includingParents */); Loading
services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java +8 −0 Original line number Diff line number Diff line Loading @@ -669,6 +669,14 @@ public class WindowOrganizerTests extends WindowTestsBase { assertEquals(1, lastReportedTiles.size()); assertEquals(ACTIVITY_TYPE_HOME, lastReportedTiles.get(info1.token.asBinder()).topActivityType); // This just needs to not crash (ie. it should be possible to reparent to display twice) wct = new WindowContainerTransaction(); wct.reparent(stack2.mRemoteToken.toWindowContainerToken(), null, true /* onTop */); mWm.mAtmService.mWindowOrganizerController.applyTransaction(wct); wct = new WindowContainerTransaction(); wct.reparent(stack2.mRemoteToken.toWindowContainerToken(), null, true /* onTop */); mWm.mAtmService.mWindowOrganizerController.applyTransaction(wct); } private List<Task> getTasksCreatedByOrganizer(DisplayContent dc) { Loading