Loading core/java/android/view/DisplayListCanvas.java +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ public final class DisplayListCanvas extends RecordingCanvas { // view hierarchy because display lists are generated recursively. private static final int POOL_LIMIT = 25; private static final int MAX_BITMAP_SIZE = 100 * 1024 * 1024; // 100 MB public static final int MAX_BITMAP_SIZE = 100 * 1024 * 1024; // 100 MB private static final SynchronizedPool<DisplayListCanvas> sPool = new SynchronizedPool<>(POOL_LIMIT); Loading packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +7 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.service.wallpaper.WallpaperService; import android.util.Log; import android.view.Display; import android.view.DisplayInfo; import android.view.DisplayListCanvas; import android.view.Surface; import android.view.SurfaceHolder; import android.view.WindowManager; Loading Loading @@ -366,7 +367,12 @@ public class ImageWallpaper extends WallpaperService { protected Bitmap doInBackground(Void... params) { Throwable exception; try { return mWallpaperManager.getBitmap(true /* hardware */); Bitmap wallpaper = mWallpaperManager.getBitmap(true /* hardware */); if (wallpaper != null && wallpaper.getByteCount() > DisplayListCanvas.MAX_BITMAP_SIZE) { throw new RuntimeException("Wallpaper is too large to draw!"); } return wallpaper; } catch (RuntimeException | OutOfMemoryError e) { exception = e; } Loading Loading
core/java/android/view/DisplayListCanvas.java +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ public final class DisplayListCanvas extends RecordingCanvas { // view hierarchy because display lists are generated recursively. private static final int POOL_LIMIT = 25; private static final int MAX_BITMAP_SIZE = 100 * 1024 * 1024; // 100 MB public static final int MAX_BITMAP_SIZE = 100 * 1024 * 1024; // 100 MB private static final SynchronizedPool<DisplayListCanvas> sPool = new SynchronizedPool<>(POOL_LIMIT); Loading
packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +7 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.service.wallpaper.WallpaperService; import android.util.Log; import android.view.Display; import android.view.DisplayInfo; import android.view.DisplayListCanvas; import android.view.Surface; import android.view.SurfaceHolder; import android.view.WindowManager; Loading Loading @@ -366,7 +367,12 @@ public class ImageWallpaper extends WallpaperService { protected Bitmap doInBackground(Void... params) { Throwable exception; try { return mWallpaperManager.getBitmap(true /* hardware */); Bitmap wallpaper = mWallpaperManager.getBitmap(true /* hardware */); if (wallpaper != null && wallpaper.getByteCount() > DisplayListCanvas.MAX_BITMAP_SIZE) { throw new RuntimeException("Wallpaper is too large to draw!"); } return wallpaper; } catch (RuntimeException | OutOfMemoryError e) { exception = e; } Loading