Loading services/core/java/com/android/server/wm/WindowContainer.java +3 −2 Original line number Diff line number Diff line Loading @@ -1020,10 +1020,11 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< * @param dc The display this container is on after changes. */ void onDisplayChanged(DisplayContent dc) { if (mDisplayContent != null) { if (mDisplayContent != null && mDisplayContent != dc) { // Cancel any change transition queued-up for this container on the old display when // this container is moved from the old display. mDisplayContent.mClosingChangingContainers.remove(this); if (mDisplayContent.mChangingContainers.remove(this)) { // Cancel any change transition queued-up for this container on the old display. mSurfaceFreezer.unfreeze(getSyncTransaction()); } } Loading services/tests/wmtests/src/com/android/server/wm/WindowContainerTests.java +22 −0 Original line number Diff line number Diff line Loading @@ -868,6 +868,28 @@ public class WindowContainerTests extends WindowTestsBase { assertEquals(newDc, activity.mDisplayContent); } @Test public void testOnDisplayChanged_cleanupChanging() { final Task task = createTask(mDisplayContent); spyOn(task.mSurfaceFreezer); mDisplayContent.mChangingContainers.add(task); // Don't remove the changing transition of this window when it is still the old display. // This happens on display info changed. task.onDisplayChanged(mDisplayContent); assertTrue(mDisplayContent.mChangingContainers.contains(task)); verify(task.mSurfaceFreezer, never()).unfreeze(any()); // Remove the changing transition of this window when it is moved or reparented from the old // display. final DisplayContent newDc = createNewDisplay(); task.onDisplayChanged(newDc); assertFalse(mDisplayContent.mChangingContainers.contains(task)); verify(task.mSurfaceFreezer).unfreeze(any()); } @Test public void testHandleCompleteDeferredRemoval() { final DisplayContent displayContent = createNewDisplay(); Loading Loading
services/core/java/com/android/server/wm/WindowContainer.java +3 −2 Original line number Diff line number Diff line Loading @@ -1020,10 +1020,11 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< * @param dc The display this container is on after changes. */ void onDisplayChanged(DisplayContent dc) { if (mDisplayContent != null) { if (mDisplayContent != null && mDisplayContent != dc) { // Cancel any change transition queued-up for this container on the old display when // this container is moved from the old display. mDisplayContent.mClosingChangingContainers.remove(this); if (mDisplayContent.mChangingContainers.remove(this)) { // Cancel any change transition queued-up for this container on the old display. mSurfaceFreezer.unfreeze(getSyncTransaction()); } } Loading
services/tests/wmtests/src/com/android/server/wm/WindowContainerTests.java +22 −0 Original line number Diff line number Diff line Loading @@ -868,6 +868,28 @@ public class WindowContainerTests extends WindowTestsBase { assertEquals(newDc, activity.mDisplayContent); } @Test public void testOnDisplayChanged_cleanupChanging() { final Task task = createTask(mDisplayContent); spyOn(task.mSurfaceFreezer); mDisplayContent.mChangingContainers.add(task); // Don't remove the changing transition of this window when it is still the old display. // This happens on display info changed. task.onDisplayChanged(mDisplayContent); assertTrue(mDisplayContent.mChangingContainers.contains(task)); verify(task.mSurfaceFreezer, never()).unfreeze(any()); // Remove the changing transition of this window when it is moved or reparented from the old // display. final DisplayContent newDc = createNewDisplay(); task.onDisplayChanged(newDc); assertFalse(mDisplayContent.mChangingContainers.contains(task)); verify(task.mSurfaceFreezer).unfreeze(any()); } @Test public void testHandleCompleteDeferredRemoval() { final DisplayContent displayContent = createNewDisplay(); Loading