Loading core/java/android/view/IWindowManager.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -346,6 +346,14 @@ interface IWindowManager */ Bitmap screenshotWallpaper(); /** * Mirrors the wallpaper for the given display. * * @param displayId ID of the display for the wallpaper. * @return A SurfaceControl for the parent of the mirrored wallpaper. */ SurfaceControl mirrorWallpaperSurface(int displayId); /** * Registers a wallpaper visibility listener. * @return Current visibility. Loading core/java/android/view/WindowManagerGlobal.java +11 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.view; import android.animation.ValueAnimator; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityManager; import android.compat.annotation.UnsupportedAppUsage; import android.content.ComponentCallbacks2; Loading Loading @@ -709,6 +710,16 @@ public final class WindowManagerGlobal { } } } /** @hide */ @Nullable public SurfaceControl mirrorWallpaperSurface(int displayId) { try { return getWindowManagerService().mirrorWallpaperSurface(displayId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } } final class WindowLeaked extends AndroidRuntimeException { Loading services/core/java/com/android/server/wm/WallpaperController.java +12 −0 Original line number Diff line number Diff line Loading @@ -801,6 +801,18 @@ class WallpaperController { wallpaperBuffer.getHardwareBuffer(), wallpaperBuffer.getColorSpace()); } /** * Mirrors the visible wallpaper if it's available. * * @return A SurfaceControl for the parent of the mirrored wallpaper. */ SurfaceControl mirrorWallpaperSurface() { final WindowState wallpaperWindowState = getTopVisibleWallpaper(); return wallpaperWindowState != null ? SurfaceControl.mirrorSurface(wallpaperWindowState.getSurfaceControl()) : null; } WindowState getTopVisibleWallpaper() { mTmpTopWallpaper = null; Loading services/core/java/com/android/server/wm/WindowManagerService.java +8 −0 Original line number Diff line number Diff line Loading @@ -3792,6 +3792,14 @@ public class WindowManagerService extends IWindowManager.Stub } } @Override public SurfaceControl mirrorWallpaperSurface(int displayId) { synchronized (mGlobalLock) { final DisplayContent dc = mRoot.getDisplayContent(displayId); return dc.mWallpaperController.mirrorWallpaperSurface(); } } /** * Takes a snapshot of the screen. In landscape mode this grabs the whole screen. * In portrait mode, it grabs the upper region of the screen based on the vertical dimension Loading Loading
core/java/android/view/IWindowManager.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -346,6 +346,14 @@ interface IWindowManager */ Bitmap screenshotWallpaper(); /** * Mirrors the wallpaper for the given display. * * @param displayId ID of the display for the wallpaper. * @return A SurfaceControl for the parent of the mirrored wallpaper. */ SurfaceControl mirrorWallpaperSurface(int displayId); /** * Registers a wallpaper visibility listener. * @return Current visibility. Loading
core/java/android/view/WindowManagerGlobal.java +11 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.view; import android.animation.ValueAnimator; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityManager; import android.compat.annotation.UnsupportedAppUsage; import android.content.ComponentCallbacks2; Loading Loading @@ -709,6 +710,16 @@ public final class WindowManagerGlobal { } } } /** @hide */ @Nullable public SurfaceControl mirrorWallpaperSurface(int displayId) { try { return getWindowManagerService().mirrorWallpaperSurface(displayId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } } final class WindowLeaked extends AndroidRuntimeException { Loading
services/core/java/com/android/server/wm/WallpaperController.java +12 −0 Original line number Diff line number Diff line Loading @@ -801,6 +801,18 @@ class WallpaperController { wallpaperBuffer.getHardwareBuffer(), wallpaperBuffer.getColorSpace()); } /** * Mirrors the visible wallpaper if it's available. * * @return A SurfaceControl for the parent of the mirrored wallpaper. */ SurfaceControl mirrorWallpaperSurface() { final WindowState wallpaperWindowState = getTopVisibleWallpaper(); return wallpaperWindowState != null ? SurfaceControl.mirrorSurface(wallpaperWindowState.getSurfaceControl()) : null; } WindowState getTopVisibleWallpaper() { mTmpTopWallpaper = null; Loading
services/core/java/com/android/server/wm/WindowManagerService.java +8 −0 Original line number Diff line number Diff line Loading @@ -3792,6 +3792,14 @@ public class WindowManagerService extends IWindowManager.Stub } } @Override public SurfaceControl mirrorWallpaperSurface(int displayId) { synchronized (mGlobalLock) { final DisplayContent dc = mRoot.getDisplayContent(displayId); return dc.mWallpaperController.mirrorWallpaperSurface(); } } /** * Takes a snapshot of the screen. In landscape mode this grabs the whole screen. * In portrait mode, it grabs the upper region of the screen based on the vertical dimension Loading