Loading services/core/java/com/android/server/wm/DisplayContent.java +14 −9 Original line number Diff line number Diff line Loading @@ -3577,17 +3577,22 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo drawnWindowTypes.put(TYPE_NOTIFICATION_SHADE, true); final WindowState visibleNotDrawnWindow = getWindow(w -> { if (w.mViewVisibility == View.VISIBLE && !w.mObscured && !w.isDrawnLw()) { boolean isVisible = w.mViewVisibility == View.VISIBLE && !w.mObscured; boolean hasDrawn = w.isDrawnLw() && w.hasDrawnLw(); if (isVisible && !hasDrawn) { return true; } if (w.isDrawnLw()) { final int type = w.mAttrs.type; if (type == TYPE_BOOT_PROGRESS || type == TYPE_BASE_APPLICATION || type == TYPE_WALLPAPER) { drawnWindowTypes.put(type, true); } else if (type == TYPE_NOTIFICATION_SHADE) { if (hasDrawn) { switch (w.mAttrs.type) { case TYPE_BOOT_PROGRESS: case TYPE_BASE_APPLICATION: case TYPE_WALLPAPER: drawnWindowTypes.put(w.mAttrs.type, true); break; case TYPE_NOTIFICATION_SHADE: drawnWindowTypes.put(TYPE_NOTIFICATION_SHADE, mWmService.mPolicy.isKeyguardDrawnLw()); break; } } return false; Loading services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +20 −6 Original line number Diff line number Diff line Loading @@ -97,9 +97,7 @@ import android.view.InsetsState; import android.view.MotionEvent; import android.view.Surface; import android.view.SurfaceControl.Transaction; import android.view.ViewRootImpl; import android.view.WindowManager; import android.view.test.InsetsModeSession; import androidx.test.filters.SmallTest; Loading Loading @@ -448,7 +446,7 @@ public class DisplayContentTests extends WindowTestsBase { assertTrue(defaultDisplay.shouldWaitForSystemDecorWindowsOnBoot()); // Verify not waiting for drawn windows. makeWindowsDrawn(windows); makeWindowsDrawnState(windows, WindowStateAnimator.HAS_DRAWN); assertFalse(defaultDisplay.shouldWaitForSystemDecorWindowsOnBoot()); } Loading @@ -469,10 +467,26 @@ public class DisplayContentTests extends WindowTestsBase { assertTrue(secondaryDisplay.shouldWaitForSystemDecorWindowsOnBoot()); // Verify not waiting for drawn windows on display with system decorations. makeWindowsDrawn(windows); makeWindowsDrawnState(windows, WindowStateAnimator.HAS_DRAWN); assertFalse(secondaryDisplay.shouldWaitForSystemDecorWindowsOnBoot()); } @Test public void testShouldWaitForSystemDecorWindowsOnBoot_OnWindowReadyToShowAndDrawn() { mWm.mSystemBooted = true; final DisplayContent defaultDisplay = mWm.getDefaultDisplayContentLocked(); final WindowState[] windows = createNotDrawnWindowsOn(defaultDisplay, TYPE_WALLPAPER, TYPE_APPLICATION); // Verify waiting for windows to be drawn. makeWindowsDrawnState(windows, WindowStateAnimator.READY_TO_SHOW); assertTrue(defaultDisplay.shouldWaitForSystemDecorWindowsOnBoot()); // Verify not waiting for drawn windows. makeWindowsDrawnState(windows, WindowStateAnimator.HAS_DRAWN); assertFalse(defaultDisplay.shouldWaitForSystemDecorWindowsOnBoot()); } private WindowState[] createNotDrawnWindowsOn(DisplayContent displayContent, int... types) { final WindowState[] windows = new WindowState[types.length]; for (int i = 0; i < types.length; i++) { Loading @@ -483,10 +497,10 @@ public class DisplayContentTests extends WindowTestsBase { return windows; } private static void makeWindowsDrawn(WindowState[] windows) { private static void makeWindowsDrawnState(WindowState[] windows, int state) { for (WindowState window : windows) { window.mHasSurface = true; window.mWinAnimator.mDrawState = WindowStateAnimator.HAS_DRAWN; window.mWinAnimator.mDrawState = state; } } Loading Loading
services/core/java/com/android/server/wm/DisplayContent.java +14 −9 Original line number Diff line number Diff line Loading @@ -3577,17 +3577,22 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo drawnWindowTypes.put(TYPE_NOTIFICATION_SHADE, true); final WindowState visibleNotDrawnWindow = getWindow(w -> { if (w.mViewVisibility == View.VISIBLE && !w.mObscured && !w.isDrawnLw()) { boolean isVisible = w.mViewVisibility == View.VISIBLE && !w.mObscured; boolean hasDrawn = w.isDrawnLw() && w.hasDrawnLw(); if (isVisible && !hasDrawn) { return true; } if (w.isDrawnLw()) { final int type = w.mAttrs.type; if (type == TYPE_BOOT_PROGRESS || type == TYPE_BASE_APPLICATION || type == TYPE_WALLPAPER) { drawnWindowTypes.put(type, true); } else if (type == TYPE_NOTIFICATION_SHADE) { if (hasDrawn) { switch (w.mAttrs.type) { case TYPE_BOOT_PROGRESS: case TYPE_BASE_APPLICATION: case TYPE_WALLPAPER: drawnWindowTypes.put(w.mAttrs.type, true); break; case TYPE_NOTIFICATION_SHADE: drawnWindowTypes.put(TYPE_NOTIFICATION_SHADE, mWmService.mPolicy.isKeyguardDrawnLw()); break; } } return false; Loading
services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +20 −6 Original line number Diff line number Diff line Loading @@ -97,9 +97,7 @@ import android.view.InsetsState; import android.view.MotionEvent; import android.view.Surface; import android.view.SurfaceControl.Transaction; import android.view.ViewRootImpl; import android.view.WindowManager; import android.view.test.InsetsModeSession; import androidx.test.filters.SmallTest; Loading Loading @@ -448,7 +446,7 @@ public class DisplayContentTests extends WindowTestsBase { assertTrue(defaultDisplay.shouldWaitForSystemDecorWindowsOnBoot()); // Verify not waiting for drawn windows. makeWindowsDrawn(windows); makeWindowsDrawnState(windows, WindowStateAnimator.HAS_DRAWN); assertFalse(defaultDisplay.shouldWaitForSystemDecorWindowsOnBoot()); } Loading @@ -469,10 +467,26 @@ public class DisplayContentTests extends WindowTestsBase { assertTrue(secondaryDisplay.shouldWaitForSystemDecorWindowsOnBoot()); // Verify not waiting for drawn windows on display with system decorations. makeWindowsDrawn(windows); makeWindowsDrawnState(windows, WindowStateAnimator.HAS_DRAWN); assertFalse(secondaryDisplay.shouldWaitForSystemDecorWindowsOnBoot()); } @Test public void testShouldWaitForSystemDecorWindowsOnBoot_OnWindowReadyToShowAndDrawn() { mWm.mSystemBooted = true; final DisplayContent defaultDisplay = mWm.getDefaultDisplayContentLocked(); final WindowState[] windows = createNotDrawnWindowsOn(defaultDisplay, TYPE_WALLPAPER, TYPE_APPLICATION); // Verify waiting for windows to be drawn. makeWindowsDrawnState(windows, WindowStateAnimator.READY_TO_SHOW); assertTrue(defaultDisplay.shouldWaitForSystemDecorWindowsOnBoot()); // Verify not waiting for drawn windows. makeWindowsDrawnState(windows, WindowStateAnimator.HAS_DRAWN); assertFalse(defaultDisplay.shouldWaitForSystemDecorWindowsOnBoot()); } private WindowState[] createNotDrawnWindowsOn(DisplayContent displayContent, int... types) { final WindowState[] windows = new WindowState[types.length]; for (int i = 0; i < types.length; i++) { Loading @@ -483,10 +497,10 @@ public class DisplayContentTests extends WindowTestsBase { return windows; } private static void makeWindowsDrawn(WindowState[] windows) { private static void makeWindowsDrawnState(WindowState[] windows, int state) { for (WindowState window : windows) { window.mHasSurface = true; window.mWinAnimator.mDrawState = WindowStateAnimator.HAS_DRAWN; window.mWinAnimator.mDrawState = state; } } Loading