Loading services/core/java/com/android/server/wm/WallpaperWindowToken.java +2 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.wm; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYERS; Loading Loading @@ -45,6 +46,7 @@ class WallpaperWindowToken extends WindowToken { DisplayContent dc, boolean ownerCanManageAppTokens) { super(service, token, TYPE_WALLPAPER, explicit, dc, ownerCanManageAppTokens); dc.mWallpaperController.addWallpaperToken(this); setWindowingMode(WINDOWING_MODE_FULLSCREEN); } @Override Loading services/tests/wmtests/src/com/android/server/wm/WallpaperControllerTests.java +19 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.server.wm; import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION; Loading Loading @@ -251,6 +254,22 @@ public class WallpaperControllerTests extends WindowTestsBase { assertEquals(otherWindowInitialZoom, wallpaperWindow.mWallpaperZoomOut, .01f); } /** * Tests that the windowing mode of the wallpaper window must always be fullscreen. */ @Test public void testWallpaperTokenWindowingMode() { final DisplayContent dc = mWm.mRoot.getDefaultDisplay(); final WallpaperWindowToken token = new WallpaperWindowToken(mWm, mock(IBinder.class), true, dc, true /* ownerCanManageAppTokens */); // The wallpaper should have requested override fullscreen windowing mode, so the // configuration (windowing mode) propagation from display won't change it. dc.setWindowingMode(WINDOWING_MODE_FREEFORM); assertEquals(WINDOWING_MODE_FULLSCREEN, token.getWindowingMode()); dc.setWindowingMode(WINDOWING_MODE_UNDEFINED); assertEquals(WINDOWING_MODE_FULLSCREEN, token.getWindowingMode()); } private WindowState createWallpaperTargetWindow(DisplayContent dc) { final ActivityRecord homeActivity = new ActivityTestsBase.ActivityBuilder(mWm.mAtmService) Loading Loading
services/core/java/com/android/server/wm/WallpaperWindowToken.java +2 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.wm; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYERS; Loading Loading @@ -45,6 +46,7 @@ class WallpaperWindowToken extends WindowToken { DisplayContent dc, boolean ownerCanManageAppTokens) { super(service, token, TYPE_WALLPAPER, explicit, dc, ownerCanManageAppTokens); dc.mWallpaperController.addWallpaperToken(this); setWindowingMode(WINDOWING_MODE_FULLSCREEN); } @Override Loading
services/tests/wmtests/src/com/android/server/wm/WallpaperControllerTests.java +19 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.server.wm; import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION; Loading Loading @@ -251,6 +254,22 @@ public class WallpaperControllerTests extends WindowTestsBase { assertEquals(otherWindowInitialZoom, wallpaperWindow.mWallpaperZoomOut, .01f); } /** * Tests that the windowing mode of the wallpaper window must always be fullscreen. */ @Test public void testWallpaperTokenWindowingMode() { final DisplayContent dc = mWm.mRoot.getDefaultDisplay(); final WallpaperWindowToken token = new WallpaperWindowToken(mWm, mock(IBinder.class), true, dc, true /* ownerCanManageAppTokens */); // The wallpaper should have requested override fullscreen windowing mode, so the // configuration (windowing mode) propagation from display won't change it. dc.setWindowingMode(WINDOWING_MODE_FREEFORM); assertEquals(WINDOWING_MODE_FULLSCREEN, token.getWindowingMode()); dc.setWindowingMode(WINDOWING_MODE_UNDEFINED); assertEquals(WINDOWING_MODE_FULLSCREEN, token.getWindowingMode()); } private WindowState createWallpaperTargetWindow(DisplayContent dc) { final ActivityRecord homeActivity = new ActivityTestsBase.ActivityBuilder(mWm.mAtmService) Loading