Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4700723 authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Update wallpaper target if the current target is gone" into tm-qpr-dev...

Merge "Update wallpaper target if the current target is gone" into tm-qpr-dev am: 50aee330 am: 630b3dcc

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19125378



Change-Id: I7d4eb402b2d78d1c1b0b50e6b47c0d3337b67787
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ea2ad47a 630b3dcc
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2082,7 +2082,7 @@ public class WindowManagerService extends IWindowManager.Stub
        if (win.mAttrs.type == TYPE_WALLPAPER) {
        if (win.mAttrs.type == TYPE_WALLPAPER) {
            dc.mWallpaperController.clearLastWallpaperTimeoutTime();
            dc.mWallpaperController.clearLastWallpaperTimeoutTime();
            dc.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
            dc.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
        } else if (win.hasWallpaper()) {
        } else if (dc.mWallpaperController.isWallpaperTarget(win)) {
            dc.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
            dc.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
        }
        }


+16 −0
Original line number Original line Diff line number Diff line
@@ -246,6 +246,22 @@ public class WallpaperControllerTests extends WindowTestsBase {
        assertEquals(otherWindowInitialZoom, wallpaperWindow.mWallpaperZoomOut, .01f);
        assertEquals(otherWindowInitialZoom, wallpaperWindow.mWallpaperZoomOut, .01f);
    }
    }


    @Test
    public void testUpdateWallpaperTarget() {
        final DisplayContent dc = mDisplayContent;
        final WindowState homeWin = createWallpaperTargetWindow(dc);
        final WindowState appWin = createWindow(null, TYPE_BASE_APPLICATION, "app");
        final RecentsAnimationController recentsController = mock(RecentsAnimationController.class);
        doReturn(true).when(recentsController).isWallpaperVisible(eq(appWin));
        mWm.setRecentsAnimationController(recentsController);

        dc.mWallpaperController.adjustWallpaperWindows();
        assertEquals(appWin, dc.mWallpaperController.getWallpaperTarget());
        // The wallpaper target is gone, so it should adjust to the next target.
        appWin.removeImmediately();
        assertEquals(homeWin, dc.mWallpaperController.getWallpaperTarget());
    }

    /**
    /**
     * Tests that the windowing mode of the wallpaper window must always be fullscreen.
     * Tests that the windowing mode of the wallpaper window must always be fullscreen.
     */
     */