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

Commit db4dce33 authored by wilsonshih's avatar wilsonshih
Browse files

Prevent WallpaperManager#getBitmap return recycled bitmap.

The returned bitmap object could be recycled from client, check
isRecycled and re-create a new bitmap object if needed.

Bug: 176573309
Test: atest WallpaperManagerTests
Change-Id: I71d99d21836b73c93979685f3f7a6f49ba0df3e4
parent bdb91bf0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -562,7 +562,7 @@ public class WallpaperManager {
            }
            if (returnDefault) {
                Bitmap defaultWallpaper = mDefaultWallpaper;
                if (defaultWallpaper == null) {
                if (defaultWallpaper == null || defaultWallpaper.isRecycled()) {
                    defaultWallpaper = getDefaultWallpaper(context, which);
                    synchronized (this) {
                        mDefaultWallpaper = defaultWallpaper;