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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user