Merge "Prevent WallpaperManager#getBitmap return recycled bitmap." into sc-v2-dev

This commit is contained in:
Lucas Dupin
2021-09-14 15:14:19 +00:00
committed by Android (Google) Code Review

View File

@@ -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;