Loading services/core/java/com/android/server/wm/WindowState.java +4 −2 Original line number Diff line number Diff line Loading @@ -3380,8 +3380,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP if (cleanupOnResume) { requestUpdateWallpaperIfNeeded(); } if (!mHasSurface) { mDestroying = false; destroyedSomething = true; } // Since mDestroying will affect ActivityRecord#allDrawn, we need to perform another // traversal in case we are waiting on this window to start the transition. Loading services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java +23 −0 Original line number Diff line number Diff line Loading @@ -352,6 +352,29 @@ public class WindowStateTests extends WindowTestsBase { assertTrue(windows.isEmpty()); } @Test public void testDestroySurface() { final WindowState win = createWindow(null, TYPE_APPLICATION, "win"); win.mHasSurface = win.mAnimatingExit = true; win.mWinAnimator.mSurfaceControl = mock(SurfaceControl.class); win.onExitAnimationDone(); assertFalse("Case 1 destroySurface no-op", win.destroySurface(false /* cleanupOnResume */, false /* appStopped */)); assertTrue(win.mHasSurface); assertTrue(win.mDestroying); assertFalse("Case 2 destroySurface no-op", win.destroySurface(true /* cleanupOnResume */, false /* appStopped */)); assertTrue(win.mHasSurface); assertTrue(win.mDestroying); assertTrue("Case 3 destroySurface destroys surface", win.destroySurface(false /* cleanupOnResume */, true /* appStopped */)); assertFalse(win.mDestroying); assertFalse(win.mHasSurface); } @Test public void testPrepareWindowToDisplayDuringRelayout() { // Call prepareWindowToDisplayDuringRelayout for a window without FLAG_TURN_SCREEN_ON before Loading Loading
services/core/java/com/android/server/wm/WindowState.java +4 −2 Original line number Diff line number Diff line Loading @@ -3380,8 +3380,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP if (cleanupOnResume) { requestUpdateWallpaperIfNeeded(); } if (!mHasSurface) { mDestroying = false; destroyedSomething = true; } // Since mDestroying will affect ActivityRecord#allDrawn, we need to perform another // traversal in case we are waiting on this window to start the transition. Loading
services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java +23 −0 Original line number Diff line number Diff line Loading @@ -352,6 +352,29 @@ public class WindowStateTests extends WindowTestsBase { assertTrue(windows.isEmpty()); } @Test public void testDestroySurface() { final WindowState win = createWindow(null, TYPE_APPLICATION, "win"); win.mHasSurface = win.mAnimatingExit = true; win.mWinAnimator.mSurfaceControl = mock(SurfaceControl.class); win.onExitAnimationDone(); assertFalse("Case 1 destroySurface no-op", win.destroySurface(false /* cleanupOnResume */, false /* appStopped */)); assertTrue(win.mHasSurface); assertTrue(win.mDestroying); assertFalse("Case 2 destroySurface no-op", win.destroySurface(true /* cleanupOnResume */, false /* appStopped */)); assertTrue(win.mHasSurface); assertTrue(win.mDestroying); assertTrue("Case 3 destroySurface destroys surface", win.destroySurface(false /* cleanupOnResume */, true /* appStopped */)); assertFalse(win.mDestroying); assertFalse(win.mHasSurface); } @Test public void testPrepareWindowToDisplayDuringRelayout() { // Call prepareWindowToDisplayDuringRelayout for a window without FLAG_TURN_SCREEN_ON before Loading