From fb2bf07f91b169a023b1bd92295585b0cae3a444 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Tue, 6 Oct 2020 20:30:33 +0800 Subject: [PATCH] Fix test of wait-for-window-on-boot if wallpaper is disabled One of condition of the test is to verify that the visible-not-drawn windows need to wait. But since commit 1e43150, mHasSurface becomes the criteria of visible window (WindowState#isVisible). So the test only relied on wallpaper window to pass. Because config_enableWallpaperService may be false on car product. That causes the test fails. This change correct the invisible testing window to restore the original test purpose. So another non-wallpaper window can take effect to pass the verification. Bug: 169904362 Bug: 169904497 Test: DisplayContentTests# \ testShouldWaitForSystemDecorWindowsOnBoot_OnDefaultDisplay testShouldWaitForSystemDecorWindowsOnBoot_OnSecondaryDisplay Change-Id: I5bf3efc82fd600946114b31d921cc5097743393f --- .../wmtests/src/com/android/server/wm/DisplayContentTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java index 4a90466247799..e45b28e3f8c49 100644 --- a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java @@ -526,7 +526,8 @@ public class DisplayContentTests extends WindowTestsBase { for (int i = 0; i < types.length; i++) { final int type = types[i]; windows[i] = createWindow(null /* parent */, type, displayContent, "window-" + type); - windows[i].mHasSurface = false; + windows[i].setHasSurface(true); + windows[i].mWinAnimator.mDrawState = WindowStateAnimator.DRAW_PENDING; } return windows; }